summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2020-06-18 19:36:16 +1000
committerDamien George <damien@micropython.org>2020-06-22 14:18:15 +1000
commit6f40e6e131b666b373ff3245a095c7e710578c16 (patch)
tree8c0e993ebcbb8ae13907f482c71b542abaa27ec8
parent705728369d7422905825e8e4d4c8001524b990e7 (diff)
stm32/boards: Add build-time option for NUCLEO_WB55 to use mboot.
As an example of how to use mboot on a WB series MCU. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk11
-rw-r--r--ports/stm32/boards/stm32wb55xg.ld1
2 files changed, 11 insertions, 1 deletions
diff --git a/ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk
index 416364df9..dcec788ed 100644
--- a/ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk
+++ b/ports/stm32/boards/NUCLEO_WB55/mpconfigboard.mk
@@ -1,9 +1,18 @@
MCU_SERIES = wb
CMSIS_MCU = STM32WB55xx
AF_FILE = boards/stm32wb55_af.csv
-LD_FILES = boards/stm32wb55xg.ld boards/common_basic.ld
STARTUP_FILE = lib/stm32lib/CMSIS/STM32WBxx/Source/Templates/gcc/startup_stm32wb55xx_cm4.o
+ifeq ($(USE_MBOOT),1)
+# When using Mboot all the text goes together after the bootloader
+LD_FILES = boards/stm32wb55xg.ld boards/common_bl.ld
+TEXT0_ADDR = 0x08004000
+else
+# When not using Mboot the text goes at the start of flash
+LD_FILES = boards/stm32wb55xg.ld boards/common_basic.ld
+TEXT0_ADDR = 0x08000000
+endif
+
# MicroPython settings
MICROPY_PY_BLUETOOTH = 1
MICROPY_BLUETOOTH_NIMBLE = 1
diff --git a/ports/stm32/boards/stm32wb55xg.ld b/ports/stm32/boards/stm32wb55xg.ld
index 77596d775..dbeccc189 100644
--- a/ports/stm32/boards/stm32wb55xg.ld
+++ b/ports/stm32/boards/stm32wb55xg.ld
@@ -6,6 +6,7 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* sectors 0-127 */
+ FLASH_APP (rx) : ORIGIN = 0x08004000, LENGTH = 496K /* sectors 4-127 */
FLASH_FS (r) : ORIGIN = 0x08080000, LENGTH = 256K /* sectors 128-191 */
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K /* SRAM1 */
RAM2A (xrw) : ORIGIN = 0x20030020, LENGTH = 8K /* SRAM2A */