Skip to content

Commit cde66e1

Browse files
FRASTMnordicjm
authored andcommitted
boot: zephyr: defines FLASH device for external NOR
With CONFIG_STM32_MEMMAP flag get NOR flash 32 bytes header Read the NOR flash to get header of the image. The FLASH_DEVICE is now given by the parent of the "st,stm32-xspi-nor" node, which is the "st,stm32-xspi" compatible same for qspi/ospi instances of stm32 devices. Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent 6a178d2 commit cde66e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

boot/zephyr/flash_map_extended.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ BOOT_LOG_MODULE_DECLARE(mcuboot);
2828
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_xspi_nor)
2929
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 1)
3030
#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_ospi_nor), okay)
31+
#define DT_DRV_COMPAT st_stm32_ospi_nor
3132
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_ospi_nor)
32-
#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor))
33+
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 1)
3334
#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_qspi_nor), okay)
35+
#define DT_DRV_COMPAT st_stm32_qspi_nor
3436
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_qspi_nor)
35-
#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor))
37+
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 1)
3638
#else
3739
#error "FLASH_DEVICE_NODE could not be determined"
3840
#endif

0 commit comments

Comments
 (0)