diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/Kconfig b/boards/arm/stm32wl5/nucleo-wl55jc/Kconfig index 134d59c7aed..b22834bb01b 100644 --- a/boards/arm/stm32wl5/nucleo-wl55jc/Kconfig +++ b/boards/arm/stm32wl5/nucleo-wl55jc/Kconfig @@ -46,6 +46,19 @@ comment "FLASH partitioning and mounting requires !DISABLE_MOUNTPOINT" if ARCH_BOARD_FLASH_MOUNT +config ARCH_BOARD_FLASH_BL_PROG_SIZE + int "Size reserved for bootloader program code" + default 0 + ---help--- + How much memory to reserve for bootloader program code. + If you are using bootloader in your application, specify + max size of bootloader partition. This memory will be + reserved at the beginning of flash, and CPU1 progmem will + be right after bootloader. + + If you don't use bootloader and just want to run program + directly after reset, set this to 0. + config ARCH_BOARD_FLASH_CPU1_PROG_SIZE int "Size reserved for CPU1 program code" default 127 diff --git a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_flash.c b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_flash.c index 1906580d35b..e9e7ed58913 100644 --- a/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_flash.c +++ b/boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_flash.c @@ -41,6 +41,10 @@ /* Define default values to silent compiler warning about undefined macro */ +#ifndef CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE +#define CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE 0 +#endif + #ifndef CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE #define CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE 0 #endif @@ -65,7 +69,8 @@ #define CONFIG_ARCH_BOARD_FLASH_PART4_SIZE 0 #endif -#if (CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE + \ +#if (CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE + \ + CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE + \ CONFIG_ARCH_BOARD_FLASH_CPU2_PROG_SIZE + \ CONFIG_ARCH_BOARD_FLASH_PART1_SIZE + \ CONFIG_ARCH_BOARD_FLASH_PART2_SIZE + \ @@ -74,7 +79,8 @@ # error "Sum of all flash pertitions cannot be bigger than 128" #endif -#if (CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE + \ +#if (CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE + \ + CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE + \ CONFIG_ARCH_BOARD_FLASH_CPU2_PROG_SIZE + \ CONFIG_ARCH_BOARD_FLASH_PART1_SIZE + \ CONFIG_ARCH_BOARD_FLASH_PART2_SIZE + \ @@ -101,6 +107,15 @@ struct part_table static const struct part_table part_table[] = { +#if CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE > 0 + { + .size = CONFIG_ARCH_BOARD_FLASH_BL_PROG_SIZE, + .name = "bl-progmem", + .mnt = NULL, + .fs = "rawfs" + }, +#endif + { .size = CONFIG_ARCH_BOARD_FLASH_CPU1_PROG_SIZE, .name = "cpu1-progmem",