This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git

commit bfd56c36a888ba9088a8b51bd66acbf173541698
Author: Christopher Collins <ccoll...@apache.org>
AuthorDate: Thu Feb 8 15:05:09 2018 -0800

    smp_svr - Update zephyr port for compatibility.
---
 samples/smp_svr/zephyr/prj.conf   | 6 ++++++
 samples/smp_svr/zephyr/src/main.c | 9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/samples/smp_svr/zephyr/prj.conf b/samples/smp_svr/zephyr/prj.conf
index fc2f99c..9e04c3c 100644
--- a/samples/smp_svr/zephyr/prj.conf
+++ b/samples/smp_svr/zephyr/prj.conf
@@ -1,3 +1,6 @@
+# Enable mcumgr.
+CONFIG_MCUMGR=y
+
 # Some command handlers require a large stack.
 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
 
@@ -16,6 +19,9 @@ CONFIG_BT_RX_BUF_LEN=260
 CONFIG_MCUMGR_SMP_BT=y
 CONFIG_MCUMGR_SMP_SHELL=y
 
+# Enable flash operations.
+CONFIG_FLASH=y
+
 # Enable the NFFS file system.
 CONFIG_FILE_SYSTEM=y
 CONFIG_FILE_SYSTEM_NFFS=y
diff --git a/samples/smp_svr/zephyr/src/main.c 
b/samples/smp_svr/zephyr/src/main.c
index 47e5de2..3e06e40 100644
--- a/samples/smp_svr/zephyr/src/main.c
+++ b/samples/smp_svr/zephyr/src/main.c
@@ -151,11 +151,10 @@ static int init_fcb(void)
         .f_version = MDLOG_VERSION,
         .f_sector_cnt = sector_cnt - 1,
         .f_scratch_cnt = 1,
-        .f_area_id = 4,
         .f_sectors = sectors,
     };
 
-    rc = fcb_init(&smp_svr_fcb);
+    rc = fcb_init(4, &smp_svr_fcb);
     if (rc != 0) {
         return rc;
     }
@@ -168,7 +167,9 @@ void main(void)
     int rc;
 
     rc = init_fcb();
-    assert(rc == 0);
+    if (rc != 0) {
+        printk("Failed to initialize FCB; rc=%d\n", rc);
+    }
 
 #ifdef CONFIG_REBOOT_LOG
     reboot_log_configure(&smp_svr_log);
@@ -205,7 +206,7 @@ void main(void)
     /* Initialize the Bluetooth mcumgr transport. */
     smp_bt_register();
 
-#ifdef CONFIG_MDLOG
+#if defined(CONFIG_MDLOG) && defined(CONFIG_FCB)
     mdlog_register("smp_svr", &smp_svr_log, &mdlog_fcb_handler, &smp_svr_fcb,
                    MDLOG_LEVEL_DEBUG);
 #endif

-- 
To stop receiving notification emails like this one, please contact
ccoll...@apache.org.

Reply via email to