Repository: incubator-mynewt-core Updated Branches: refs/heads/master b79f75dff -> c527b867a
MYNEWT-714: Add DC/DC enable for nordic platforms As discussed on the dev list, added a call to hal_system_init() in the startup code (in gcc_startup_nrfxx.s). Added the function hal_system_init() to hal_system.c for both nrf51 and nrf52. All BSP directories were updated to enable DC/DC regulator EXCEPT for arduino 101 and BBC microbit. I cannot find specific microbit schematics but the reference design does not appear to have the necessary circuitry. Not sure about Arduino 101. 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/dd2cde28 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/dd2cde28 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/dd2cde28 Branch: refs/heads/master Commit: dd2cde286bd307354266ff811120ca61054d3f2a Parents: b8a3549 Author: William San Filippo <wi...@runtime.io> Authored: Mon Apr 10 16:33:23 2017 -0700 Committer: William San Filippo <wi...@runtime.io> Committed: Mon Apr 10 16:49:58 2017 -0700 ---------------------------------------------------------------------- .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/ada_feather_nrf52/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/arduino_primo_nrf52/syscfg.yml | 1 + .../src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51_split.s | 3 +++ .../bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51_split.s | 3 +++ hw/bsp/bmd200/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/bmd300eval/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/nina-b1/syscfg.yml | 1 + .../src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51_split.s | 3 +++ hw/bsp/nrf51-blenano/syscfg.yml | 1 + .../src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51_split.s | 3 +++ hw/bsp/nrf51dk-16kbram/syscfg.yml | 1 + .../src/arch/cortex_m0/gcc_startup_nrf51.s | 3 +++ .../src/arch/cortex_m0/gcc_startup_nrf51_split.s | 3 +++ hw/bsp/nrf51dk/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52840.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/nrf52840pdk/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/nrf52dk/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/rb-blend2/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/rb-nano2/syscfg.yml | 1 + .../src/arch/cortex_m4/gcc_startup_nrf52.s | 2 ++ .../src/arch/cortex_m4/gcc_startup_nrf52_split.s | 3 +++ hw/bsp/telee02/syscfg.yml | 1 + hw/mcu/nordic/nrf51xxx/src/hal_system.c | 18 ++++++++++++++++++ hw/mcu/nordic/nrf51xxx/syscfg.yml | 7 +++++++ hw/mcu/nordic/nrf52xxx/src/hal_system.c | 18 ++++++++++++++++++ hw/mcu/nordic/nrf52xxx/syscfg.yml | 7 +++++++ 46 files changed, 141 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s index b45a73c..8ce6ee5 100755 --- a/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100755 --- a/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/ada_feather_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/ada_feather_nrf52/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/ada_feather_nrf52/syscfg.yml b/hw/bsp/ada_feather_nrf52/syscfg.yml index fdb43b9..3c407bd 100644 --- a/hw/bsp/ada_feather_nrf52/syscfg.yml +++ b/hw/bsp/ada_feather_nrf52/syscfg.yml @@ -95,6 +95,7 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 # The module on the board has +/- 40 ppm crystal. A value of 5 is # for crystals in the range of 31 to 50 ppm. http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s index 4a9417c..73c5053 100755 --- a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100755 --- a/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/arduino_primo_nrf52/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/arduino_primo_nrf52/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/arduino_primo_nrf52/syscfg.yml b/hw/bsp/arduino_primo_nrf52/syscfg.yml index fdbd00b..c3146bd 100644 --- a/hw/bsp/arduino_primo_nrf52/syscfg.yml +++ b/hw/bsp/arduino_primo_nrf52/syscfg.yml @@ -109,3 +109,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s index e58e8bc..7b53105 100755 --- a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -185,6 +185,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s index c347187..171f66f 100755 --- a/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s +++ b/hw/bsp/bbc_microbit/src/arch/cortex_m0/gcc_startup_nrf51_split.s @@ -169,6 +169,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s index 233d899..33463cd 100644 --- a/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -185,6 +185,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51_split.s index 62ab10a..ddcf4a4 100644 --- a/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51_split.s +++ b/hw/bsp/bmd200/src/arch/cortex_m0/gcc_startup_nrf51_split.s @@ -169,6 +169,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd200/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd200/syscfg.yml b/hw/bsp/bmd200/syscfg.yml index 8890a38..7aba1b7 100644 --- a/hw/bsp/bmd200/syscfg.yml +++ b/hw/bsp/bmd200/syscfg.yml @@ -94,3 +94,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s index 4a9417c..73c5053 100755 --- a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100755 --- a/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/bmd300eval/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/bmd300eval/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/bmd300eval/syscfg.yml b/hw/bsp/bmd300eval/syscfg.yml index 0018ee1..8777e4f 100644 --- a/hw/bsp/bmd300eval/syscfg.yml +++ b/hw/bsp/bmd300eval/syscfg.yml @@ -97,3 +97,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52.s index b45a73c..8ce6ee5 100644 --- a/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100644 --- a/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/nina-b1/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nina-b1/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nina-b1/syscfg.yml b/hw/bsp/nina-b1/syscfg.yml index 9558fea..592c770 100644 --- a/hw/bsp/nina-b1/syscfg.yml +++ b/hw/bsp/nina-b1/syscfg.yml @@ -109,3 +109,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51-arduino_101/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-arduino_101/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/nrf51-arduino_101/src/arch/cortex_m0/gcc_startup_nrf51.s index e6d9fe0..4b2a5e4 100755 --- a/hw/bsp/nrf51-arduino_101/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/nrf51-arduino_101/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -182,6 +182,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s index e58e8bc..7b53105 100755 --- a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -185,6 +185,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51_split.s index c347187..171f66f 100755 --- a/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51_split.s +++ b/hw/bsp/nrf51-blenano/src/arch/cortex_m0/gcc_startup_nrf51_split.s @@ -169,6 +169,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51-blenano/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/syscfg.yml b/hw/bsp/nrf51-blenano/syscfg.yml index 8908bb0..86128f8 100644 --- a/hw/bsp/nrf51-blenano/syscfg.yml +++ b/hw/bsp/nrf51-blenano/syscfg.yml @@ -72,3 +72,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51.s index 3ece57c..a6c2611 100755 --- a/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -185,6 +185,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51_split.s index 8ce6427..e7cebd0 100755 --- a/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51_split.s +++ b/hw/bsp/nrf51dk-16kbram/src/arch/cortex_m0/gcc_startup_nrf51_split.s @@ -168,6 +168,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk-16kbram/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk-16kbram/syscfg.yml b/hw/bsp/nrf51dk-16kbram/syscfg.yml index 83f29d2..fd6b40f 100644 --- a/hw/bsp/nrf51dk-16kbram/syscfg.yml +++ b/hw/bsp/nrf51dk-16kbram/syscfg.yml @@ -76,3 +76,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s index 8a4ec2f..42dbc9c 100755 --- a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s +++ b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51.s @@ -185,6 +185,9 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s index ec41c56..f9a6fd0 100755 --- a/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s +++ b/hw/bsp/nrf51dk/src/arch/cortex_m0/gcc_startup_nrf51_split.s @@ -169,6 +169,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf51dk/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51dk/syscfg.yml b/hw/bsp/nrf51dk/syscfg.yml index 8f13b42..6b8bbfb 100644 --- a/hw/bsp/nrf51dk/syscfg.yml +++ b/hw/bsp/nrf51dk/syscfg.yml @@ -76,3 +76,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52840.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52840.s b/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52840.s index f43a77c..8f44373 100755 --- a/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52840.s +++ b/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52840.s @@ -186,6 +186,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52_split.s index 32343d5..5a0532c 100755 --- a/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/nrf52840pdk/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -152,6 +152,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52840pdk/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52840pdk/syscfg.yml b/hw/bsp/nrf52840pdk/syscfg.yml index 23671b4..218bd39 100644 --- a/hw/bsp/nrf52840pdk/syscfg.yml +++ b/hw/bsp/nrf52840pdk/syscfg.yml @@ -95,3 +95,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s index b45a73c..8ce6ee5 100755 --- a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100755 --- a/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/nrf52dk/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf52dk/syscfg.yml b/hw/bsp/nrf52dk/syscfg.yml index 3778c50..e98bd34 100644 --- a/hw/bsp/nrf52dk/syscfg.yml +++ b/hw/bsp/nrf52dk/syscfg.yml @@ -95,3 +95,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52.s index 4a9417c..73c5053 100755 --- a/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52_split.s index 66a960d..c955590 100755 --- a/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/rb-blend2/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -152,6 +152,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-blend2/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-blend2/syscfg.yml b/hw/bsp/rb-blend2/syscfg.yml index 27c5a96..4e018b7 100644 --- a/hw/bsp/rb-blend2/syscfg.yml +++ b/hw/bsp/rb-blend2/syscfg.yml @@ -96,3 +96,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52.s index 4a9417c..73c5053 100755 --- a/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s index 66a960d..c955590 100755 --- a/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/rb-nano2/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -152,6 +152,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/rb-nano2/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-nano2/syscfg.yml b/hw/bsp/rb-nano2/syscfg.yml index f7cf2fc..41ebdf8 100644 --- a/hw/bsp/rb-nano2/syscfg.yml +++ b/hw/bsp/rb-nano2/syscfg.yml @@ -82,3 +82,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52.s ---------------------------------------------------------------------- diff --git a/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52.s b/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52.s index b45a73c..8ce6ee5 100755 --- a/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52.s +++ b/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52.s @@ -177,6 +177,8 @@ Reset_Handler: LDR R0, =SystemInit BLX R0 + BL hal_system_init + LDR R0, =_start BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52_split.s ---------------------------------------------------------------------- diff --git a/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52_split.s b/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52_split.s index de1ce6e..044aa17 100755 --- a/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52_split.s +++ b/hw/bsp/telee02/src/arch/cortex_m4/gcc_startup_nrf52_split.s @@ -151,6 +151,9 @@ Reset_Handler_split: LDR R0, =SystemInit BLX R0 + + BL hal_system_init + LDR R0, =_start_split BX R0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/bsp/telee02/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/bsp/telee02/syscfg.yml b/hw/bsp/telee02/syscfg.yml index 7e81559..a98b4a9 100644 --- a/hw/bsp/telee02/syscfg.yml +++ b/hw/bsp/telee02/syscfg.yml @@ -95,3 +95,4 @@ syscfg.vals: REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG NFFS_FLASH_AREA: FLASH_AREA_NFFS COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1 + MCU_DCDC_ENABLED: 1 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/mcu/nordic/nrf51xxx/src/hal_system.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_system.c b/hw/mcu/nordic/nrf51xxx/src/hal_system.c index b5150bb..f95c37d 100644 --- a/hw/mcu/nordic/nrf51xxx/src/hal_system.c +++ b/hw/mcu/nordic/nrf51xxx/src/hal_system.c @@ -23,6 +23,24 @@ #include <nrf51.h> #include <nrf51_bitfields.h> +/** + * Function called at startup. Called after BSS and .data initialized but + * prior to the _start function. + * + * NOTE: this function is called by both the bootloader and the application. + * If you add code here that you do not want executed in either case you need + * to conditionally compile it using the config variable BOOT_LOADER (will + * be set to 1 in case of bootloader build) + * + */ +void +hal_system_init(void) +{ +#if MYNEWT_VAL(MCU_DCDC_ENABLED) + NRF_POWER->DCDCEN = 1; +#endif +} + void hal_system_reset(void) { http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/mcu/nordic/nrf51xxx/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/nrf51xxx/syscfg.yml b/hw/mcu/nordic/nrf51xxx/syscfg.yml index d0c40be..04b6d65 100644 --- a/hw/mcu/nordic/nrf51xxx/syscfg.yml +++ b/hw/mcu/nordic/nrf51xxx/syscfg.yml @@ -24,3 +24,10 @@ syscfg.defs: Specifies the required alignment for internal flash writes. Used internally by the newt tool. value: 1 + + MCU_DCDC_ENABLED: + description: > + Specifies whether or not to enable DC/DC regulator. This requires + external circuitry so is defined to be zero by default and + expected to be overridden by the BSP. + value: 0 http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/mcu/nordic/nrf52xxx/src/hal_system.c ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_system.c b/hw/mcu/nordic/nrf52xxx/src/hal_system.c index b82a7a4..cab0fd0 100644 --- a/hw/mcu/nordic/nrf52xxx/src/hal_system.c +++ b/hw/mcu/nordic/nrf52xxx/src/hal_system.c @@ -20,6 +20,24 @@ #include <mcu/cortex_m4.h> #include "hal/hal_system.h" +/** + * Function called at startup. Called after BSS and .data initialized but + * prior to the _start function. + * + * NOTE: this function is called by both the bootloader and the application. + * If you add code here that you do not want executed in either case you need + * to conditionally compile it using the config variable BOOT_LOADER (will + * be set to 1 in case of bootloader build) + * + */ +void +hal_system_init(void) +{ +#if MYNEWT_VAL(MCU_DCDC_ENABLED) + NRF_POWER->DCDCEN = 1; +#endif +} + void hal_system_reset(void) { http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd2cde28/hw/mcu/nordic/nrf52xxx/syscfg.yml ---------------------------------------------------------------------- diff --git a/hw/mcu/nordic/nrf52xxx/syscfg.yml b/hw/mcu/nordic/nrf52xxx/syscfg.yml index d0c40be..04b6d65 100644 --- a/hw/mcu/nordic/nrf52xxx/syscfg.yml +++ b/hw/mcu/nordic/nrf52xxx/syscfg.yml @@ -24,3 +24,10 @@ syscfg.defs: Specifies the required alignment for internal flash writes. Used internally by the newt tool. value: 1 + + MCU_DCDC_ENABLED: + description: > + Specifies whether or not to enable DC/DC regulator. This requires + external circuitry so is defined to be zero by default and + expected to be overridden by the BSP. + value: 0