More boot loader fixes; bugs caused by syscfg.

Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/77144ec4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/77144ec4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/77144ec4

Branch: refs/heads/develop
Commit: 77144ec461149ab93e4f1771dcf0ce97602560b6
Parents: 1540d5b
Author: Christopher Collins <ccoll...@apache.org>
Authored: Wed Sep 14 14:30:02 2016 -0700
Committer: Christopher Collins <ccoll...@apache.org>
Committed: Wed Sep 14 19:39:13 2016 -0700

----------------------------------------------------------------------
 apps/boot/src/boot.c                     | 28 ---------------------------
 libs/os/src/arch/cortex_m0/os_arch_arm.c |  3 ---
 libs/os/src/arch/sim/os_arch_sim.c       |  2 --
 sys/sysinit/include/sysinit/sysinit.h    |  1 +
 4 files changed, 1 insertion(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/77144ec4/apps/boot/src/boot.c
----------------------------------------------------------------------
diff --git a/apps/boot/src/boot.c b/apps/boot/src/boot.c
index af573a4..49d4083 100755
--- a/apps/boot/src/boot.c
+++ b/apps/boot/src/boot.c
@@ -69,31 +69,8 @@ static struct conf_file my_conf = {
 static void
 setup_for_nffs(void)
 {
-    struct nffs_area_desc nffs_descs[NFFS_AREA_MAX + 1];
-    int cnt;
     int rc;
 
-    /*
-     * Make sure we have enough left to initialize the NFFS with the
-     * right number of maximum areas otherwise the file-system will not
-     * be readable.
-     */
-    cnt = NFFS_AREA_MAX;
-    rc = nffs_misc_desc_from_flash_area(FLASH_AREA_NFFS, &cnt, nffs_descs);
-    assert(rc == 0);
-
-    /*
-     * Initializes the flash driver and file system for use by the boot loader.
-     */
-    rc = nffs_init();
-    if (rc == 0) {
-        /* Look for an nffs file system in internal flash.  If no file
-         * system gets detected, all subsequent file operations will fail,
-         * but the boot loader should proceed anyway.
-         */
-        nffs_detect(nffs_descs);
-    }
-
     rc = conf_file_src(&my_conf);
     assert(rc == 0);
     rc = conf_file_dst(&my_conf);
@@ -142,9 +119,6 @@ main(void)
 
     os_init();
 
-    rc = hal_flash_init();
-    assert(rc == 0);
-
     cnt = BOOT_AREA_DESC_MAX;
     rc = flash_area_to_sectors(FLASH_AREA_IMAGE_0, &cnt, descs);
     img_starts[0] = 0;
@@ -166,8 +140,6 @@ main(void)
 
     req.br_num_image_areas = total;
 
-    conf_init();
-
 #if MYNEWT_VAL(BOOT_NFFS)
     setup_for_nffs();
 #elif MYNEWT_VAL(BOOT_FCB)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/77144ec4/libs/os/src/arch/cortex_m0/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/libs/os/src/arch/cortex_m0/os_arch_arm.c 
b/libs/os/src/arch/cortex_m0/os_arch_arm.c
index ef1be4d..65adc28 100755
--- a/libs/os/src/arch/cortex_m0/os_arch_arm.c
+++ b/libs/os/src/arch/cortex_m0/os_arch_arm.c
@@ -216,9 +216,6 @@ os_arch_os_init(void)
             NVIC_SetVector(i, (uint32_t)os_default_irq_asm);
         }
 
-        /* Call bsp related OS initializations */
-        bsp_init();
-
         /* Set the PendSV interrupt exception priority to the lowest priority 
*/
         NVIC_SetPriority(PendSV_IRQn, PEND_SV_PRIO);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/77144ec4/libs/os/src/arch/sim/os_arch_sim.c
----------------------------------------------------------------------
diff --git a/libs/os/src/arch/sim/os_arch_sim.c 
b/libs/os/src/arch/sim/os_arch_sim.c
index 4970522..36fc87d 100644
--- a/libs/os/src/arch/sim/os_arch_sim.c
+++ b/libs/os/src/arch/sim/os_arch_sim.c
@@ -419,8 +419,6 @@ os_arch_os_init(void)
     os_init_idle_task();
     os_sanity_task_init(1);
 
-    bsp_init();
-
     return OS_OK;
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/77144ec4/sys/sysinit/include/sysinit/sysinit.h
----------------------------------------------------------------------
diff --git a/sys/sysinit/include/sysinit/sysinit.h 
b/sys/sysinit/include/sysinit/sysinit.h
index fe86b78..2363242 100644
--- a/sys/sysinit/include/sysinit/sysinit.h
+++ b/sys/sysinit/include/sysinit/sysinit.h
@@ -25,6 +25,7 @@
 typedef void sysinit_panic_fn(const char *file, int line);
 
 #if !MYNEWT_VAL(SYSINIT_PANIC_FN)
+#include <assert.h>
 #define SYSINIT_PANIC() assert(0)
 #else
 #define SYSINIT_PANIC() MYNEWT_VAL(SYSINIT_PANIC_FN)(__FILE__, __LINE__)

Reply via email to