-
Notifications
You must be signed in to change notification settings - Fork 8.3k
stm32: xspi: Allow flash driver usage in RAM_LOAD mode #99729
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
base: main
Are you sure you want to change the base?
stm32: xspi: Allow flash driver usage in RAM_LOAD mode #99729
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
Additional metadata changed:
⛔ DNM label due to: 1 project with PR revision and 1 project with metadata changes Note: This message is automatically posted and updated by the Manifest GitHub Action. |
95dfb79 to
7eedd31
Compare
Instantiate a `soc-nv-flash` compatible node to allow using XSPI flash driver as a real flash controller on NOR device. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
7eedd31 to
5bab295
Compare
5bab295 to
c72d334
Compare
| spi-flash0 = &mx66uw1g45g; | ||
| zephyr,flash-controller = &mx66uw1g45g; | ||
| zephyr,flash = &mx66uw1g45g; | ||
| zephyr,flash = &ext_flash; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a nit really, but ospi-nor-flash@0 node should not have the label mx66uw1g45g, rather something like ext_flash_controller, and consequently zephyr,flash-controller should be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems my comment was lost:
I propose to fix this globally in one shot (at least on stm32 based boards). Would you mind raising an issue, so i doesn't get lost ?
c72d334 to
1ed8b00
Compare
drivers/flash/flash_stm32_xspi.c
Outdated
| /* Memory-mapping could have been set by previous application */ | ||
| /* Force HAL instance in correct state */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Memory-mapping could have been set by previous application.
* Force HAL instance in correct state.
*/
Current driver protections prevent to initialize driver when run as from an external application running from ext flash. Aim is to avoid performing full driver initialization of the NOR flash controller the application is read from. But this problem is actually only valid when application is running in XIP mode (read in memory mapped mode at run time). In ram load mode, since there is no direct activity from the application on the NOR device, nothing prevents the ext flash driver to be used fully. Hence, we should allow the controller initialization to happen, with some adjustments. Mostly, what we need is to: - skip the hal init - abort memory mapping afterwards to let the jedec reading happen. Remove conditions around `stm32_xspi_is_memorymap()` and `stm32_xspi_abort()` which can finally be useful in various cases. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Point upstream mcuboot PR fixing stm32n6 fsbl variant configuration Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
1ed8b00 to
d169be2
Compare
|
|
Why did the Bot add the Buffalo Lab label 🤔 |



Currently, STM32 XSPI flash driver initialization aborts if application is run from external flash.
Though, constraints are actually different if:
Fix XSPI driver to allow flash operations in RAM LOAD.
Make necessary changes on N6 DK to be able to make use of it.
Once approved, it will have to be extended to O/QSPI drivers.
Then, we should also make sure this work using MSPI drivers.
Edit: Depends on mcu-tools/mcuboot#2547