-
Notifications
You must be signed in to change notification settings - Fork 7.4k
stm32 XiP with ospi external NOR flash #64641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Example to build and link an application for the external NOR and execute it in XiP. Flashing operation is done with the STM32CubeProgrammer application or command line:
|
It is also consist in :
In case the sysbuild/mcuboot.conf
|
43c5947
to
6d2447b
Compare
ca5288c
to
576b7cc
Compare
For the flash driver, the base address is the MCU internal flash address (usualyy 0x8000000). This PR gets the that address from the device tree node "st,stm32-nv-flash" instead of relying on the CONFIG_FLASH_BASE_ADDRESS which might differ when building for another flash memory. Signed-off-by: Francois Ramu <[email protected]>
This CONFIG_STM32_MEMMAP is for enabling the MemoryMapped mode on external octo or quad spi memory. In this case, the flash_stm32_read is done in mem map mode the flash_stm32_erase is not available. Signed-off-by: Francois Ramu <[email protected]>
Enable the MemoryMapped Mode for the stm32 octoFlash driver Configure the Flash in MemoryMapped to use in XiP mode. With this mode the erase and write are not supported. Address and size are given by the DTS register property. Signed-off-by: Francois Ramu <[email protected]>
This change is aborting the memoryMapped mode of the octo-flash before erasing or writing the NOR. Operations are performed in command mode. Reading is always performed in MemoryMapped mode (memcopy) Signed-off-by: Francois Ramu <[email protected]>
Enable the DCACHE1 in INCR burt mode to allow writing to the external NOR octoFlash when in MemoryMapped mode Signed-off-by: Francois Ramu <[email protected]>
Define the Device tree of the b_u585i_iot02a disco kit to access the external NOR octo-flash in MemoryMapped mode for XiP Signed-off-by: Francois Ramu <[email protected]>
Gives a sample to execute the little fs on external memory map (XiP) where the lfs1 partition is in internal mcu flash The application is built/linked/stored in the external NOR flash on slot1 partition. Signed-off-by: Francois Ramu <[email protected]>
Skip the PLL1 init if it is already running, this will avoid disabling the PLL when running after a jump from mcuboot Signed-off-by: Francois Ramu <[email protected]>
Define the MPU attribute to be ATTR_MPU_IO for the qspi region, starting at 0x90000000 of the stm32h7 serie. Signed-off-by: Francois Ramu <[email protected]>
Define the Device tree of the stm32h7b3i_dk disco board to access the external NOR octo-flash in MemoryMapped mode for XiP Set openocd runner for debugging. Signed-off-by: Francois Ramu <[email protected]>
Gives a sample to execute the little fs on external memory map (XiP) where the lfs1 partition is in internal mcu flash Signed-off-by: Francois Ramu <[email protected]>
Configures the external NOR Flash in MemoryMapped Mode, at the end of the NOR flash-controller initialization. Then reading/writing are performed in MemoryMapped mode with memcopy (and no more with command mode). In this mode: erasing is not supported anymore. The flash size and address are given by the DTS <reg> property. Signed-off-by: Francois Ramu <[email protected]>
Define the Device tree of the stm32l496g_disco board or stm32h750b disco kit to access the external NOR quad-flash in MemoryMapped mode for XiP Signed-off-by: Francois Ramu <[email protected]>
Gives a sample to execute the little fs on external memory map (XiP) where the lfs1 partition is in internal mcu flash Signed-off-by: Francois Ramu <[email protected]>
west sign accepts signing image when built and linked for an external NOR memory (which has no write-block size property) Signed-off-by: Francois Ramu <[email protected]>
Samples to demonstrate the XiP mode when using an external NOR flash in MemoryMapped mode Signed-off-by: Francois Ramu <[email protected]>
Sample to configure the octo/quad external Flash in memory Mapped mode so that read is accessible in memecopy Write too even if not recommended. Signed-off-by: Francois Ramu <[email protected]>
not relevant anymore Refer to #68597 |
Gives example to execute an application from the external octo NOR flash in XiP mode
Requires patching the ../bootloader/mcuboot/boot/flash_map_extended.c:
Requires a ../bootloader/mcuboot/boot/zephyr/boards/ .conf and .overlay files to set
CONFIG_BOOT_DIRECT_XIP=y
CONFIG_STM32_MEMMAP=y
CONFIG_STM32_MEMMAP_EXT_FLASH_BASE_ADDRESS
and define the slot1 partition of the external NOR flash and as the
<zephyr,chosen>