-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
stm32 QSPI flash driver enables XiP on external NOR flash #68607
Conversation
Running the sample to relocate code on the external NOR flash of the stm32h750b_dk disco kit (also valid with stm32l496g_disco) :
TODO : fix ***** USAGE FAULT ***** after cold reset on the stm32h750b_dk disco kit |
f283d25
to
58e4dc0
Compare
stm32h750 disco kit the QSPI driver in memorymap does not read the same data in the external flash memory.
but wrong after cold reset (power off/on)
|
a1ca7a4
to
2ade820
Compare
adding the support of the stm32l496 disco kit with single quad-flash :
|
f73709c
to
fdfbb29
Compare
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]>
Skip the PLL1 init if it is already running, this will avoid disabling the PLL when running after a jump from mcuboot. In case of XiP, the pll must not be reinit because it clocks the octo-quad SPI instance which accesses the external NOR flash. Signed-off-by: Francois Ramu <[email protected]>
Define the configuration to run the code_relocation application on the external memory octo flash of the stm32u585 or stm32h7b3i disco kit in XIP 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]>
I would like to use it on a stm32f7508_dk since the internal flash is very small, but I get a MPU_FAULT at boot:
Is it possible? Am I doing something wrong? |
flash_stm32_qspi driver supporting the dual flash mode with 2 identical quad-NOR mounted
|
Configure the quad-spi in DualFlash Mode when enabling the MemoryMapped then reading is possible with memcopy. DUAL flash mode is possible on stm32 series with QUADSPI_CR_DFM Signed-off-by: Francois Ramu <[email protected]>
Define the MPU attribute to be ATTR_MPU_EXTMEM for the external region (qspi- or octo-spi NOR flash) starting at 0x90000000 of the stm32h7 serie. Another region should be Included inside with attribute ATTR_MPU_IO, to access the external memory in XIP. Signed-off-by: Francois Ramu <[email protected]>
efine the MPU attribute to be ATTR_MPU_EXTMEM for the external region (qspi-spi NOR flash) starting at 0x90000000 of the stm32f7 serie. Another region should be Included inside with attribute ATTR_MPU_IO, to access the external memory in XIP. Signed-off-by: Francois Ramu <[email protected]>
Enable the Dual Flash Mode on the stm32h750b_dk to access both quad flash in parallel as mounted on the hardware. Signed-off-by: Francois Ramu <[email protected]>
Declare a sub-region of the whole ext_memory with attributes ATTR_MPU_IO so that XiP becomes possible on this external quad- octo- NOR flash Signed-off-by: Francois Ramu <[email protected]>
Define a partition to the stm32l496g_dk board Signed-off-by: Francois Ramu <[email protected]>
Consider the quad-NOR is single flash mode enabled That will avoid configuring the dual flash on this target Signed-off-by: Francois Ramu <[email protected]>
Define a partition to the stm32h747_disco board Signed-off-by: Francois Ramu <[email protected]>
Well, I have checked with a stm32f746g_disco, the flash_stm32_qspi driver and the qspi_set_memorymap function requires 10 dummy cylce for the this quad-NOR
|
new quad-spi driver supporting dual or single quad-flash |
Define the configuration to run the code_relocation application on the external memory quad flash of the stm32h7 or stm32f7 or stm32l496g disco kit in XIP Signed-off-by: Francois Ramu <[email protected]>
This PR is similar to #72339 |
With this PR the stm32l496 and stm32h750 target board with quad-NOR flash can configure this external flash to eXecute In Place a sample code application stored on this external memory.
The qspi flash driver is configuring the external NOR in MemoryMapped mode at init so that code is XiP at the external NOR flash address.
This is demonstrated by the samples/application_development/code_relocation_nocopy/ running on the stm32h750b or stm32l496 disco kits.
This PR completes the #68597