-
Notifications
You must be signed in to change notification settings - Fork 7.4k
STM32N6: Add XSPI Flash memory map support #88790
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
STM32N6: Add XSPI Flash memory map support #88790
Conversation
@@ -8,10 +8,9 @@ | |||
|
|||
config STM32_MEMMAP | |||
bool "NOR Flash in MemoryMapped for XiP" | |||
depends on XIP && \ |
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.
XiP should be removed from description & the help below as well.
Remove XIP dependency for enabling memory mapping for Q/O/XSPI NOR Flash. It is not necessary and is preventing configuring an external Flash in memmap mode if there is no internal Flash (like on STM32N6) Signed-off-by: Guillaume Gautier <[email protected]>
Add memory-mapped support for STM32N6 XSPI Flash driver. Signed-off-by: Guillaume Gautier <[email protected]>
86a9bfd
to
c3f0200
Compare
@@ -7,13 +7,12 @@ | |||
# SPDX-License-Identifier: Apache-2.0 | |||
|
|||
config STM32_MEMMAP | |||
bool "NOR Flash in MemoryMapped for XiP" | |||
depends on XIP && \ |
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.
As a consequence of this, all instances of if(CONFIG_STM32_MEMMAP)
in board.cmake
files (https://github.com/search?q=repo%3Azephyrproject-rtos%2Fzephyr+path%3A%2F%5Eboards%5C%2Fst%5C%2F%2F+if+%28CONFIG_STM32_MEMMAP%29&type=code) should be changed to if(CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT)
in a follow-up PR.
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.
Not sure,
when building the samples/application_development/code_relocation for stm32h573i_dk, for example, the CONFIG_STM32_MEMMAP is set, the CONFIG_XIP is set but CONFIG_BOOTLOADER_MCUBOOT is not
(not build with mcuboot sysbuild)
However we need to flash the zephyr.hex with the external loader of the stm32CubeProgrammer
--> CONFIG_STM32_MEMMAP is not always equal to CONFIG_XIP & CONFIG_BOOTLOADER_MCUBOOT
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.
However, we can see that CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT
is for selecting the external loader when flashing the samples/sysbuild/with_mcuboot
I would recommend for the board.cmake :
if(CONFIG_STM32_MEMMAP OR (CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT))
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.
when building the samples/application_development/code_relocation for stm32h573i_dk, for example, the CONFIG_STM32_MEMMAP is set, the CONFIG_XIP is set but CONFIG_BOOTLOADER_MCUBOOT is not
(not build with mcuboot sysbuild)
However we need to flash the zephyr.hex with the external loader of the stm32CubeProgrammer
You are right, I mistakenly thought that the external loader is not needed when using Zephyr Code Relocation with external Flash XiP.
I would recommend for the board.cmake :
if(CONFIG_STM32_MEMMAP OR (CONFIG_XIP AND CONFIG_BOOTLOADER_MCUBOOT))
I think it should be:
if(CONFIG_XIP AND (CONFIG_STM32_MEMMAP OR CONFIG_BOOTLOADER_MCUBOOT))
CONFIG_STM32_MEMMAP
alone does not mean we are necessarily going to eXecute in Place code in external Flash (that should be downloaded there by external loader).
Add the support of the XSPI Flash memory map support for STM32N6