Skip to content
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

samples: code relocation for the stm32f746 disco kit #86136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FRASTM
Copy link
Collaborator

@FRASTM FRASTM commented Feb 21, 2025

Add the configuration for using the external FLASh Memory and execute the samples/application_development/code_relocation_nocopy/ on the stm32f746g_disco board

Fixes #86123

The ext_memory region is declared directly in the stm32f746g_disco.dts
The stm32cubeprogrammer runner includes the corresponding external loader to flash in internal and external memory

--> download the zephyr.hex in internal and external flash (for example : west flash or west flash --runner openocd)

@FRASTM
Copy link
Collaborator Author

FRASTM commented Feb 21, 2025

[00:00:00.000,000] <inf> flash_stm32_qspi: Reading SFDP
[00:00:00.000,000] <inf> flash_stm32_qspi: qspi-nor-flash@90000000: SFDP v 1.5 AP ff with 2 PH
[00:00:00.000,000] <inf> flash_stm32_qspi: PH0: ff00 rev 1.5: 16 DW @ 30
[00:00:00.000,000] <inf> flash_stm32_qspi: Reading SFDP
[00:00:00.000,000] <inf> flash_stm32_qspi: qspi-nor-flash@90000000: 16 MiBy flash
[00:00:00.000,000] <inf> flash_stm32_qspi: PH1: ff03 rev 1.0: 2 DW @ 100
[00:00:00.000,000] <inf> flash_stm32_qspi: Memory-mapped NOR quad-flash at 0x90000000 (0x1000000 bytes)
*** Booting Zephyr OS build v4.0.0-37-g162d3f4f15b1 ***
Address of main function 0x800059d
Address of function_in_ext_flash 0x90000001
Address of var_ext_sram_data 0x200100e0 (10)
Address of function_in_sram 0x20010001
Address of var_sram_data 0x200100e4 (10)                                                                                   
Hello World! stm32f746g_disco  

Add the configuration to download and execute code in the
external flash of the stm32f746 disco kit :
ext memory attribute to support code execution and external flash loader

Signed-off-by: Francois Ramu <[email protected]>
Add the configuration for using the external FLASh Memory
and execute the samples/application_development/code_relocation_nocopy/
on the stm32f746g_disco board

Signed-off-by: Francois Ramu <[email protected]>
compatible = "zephyr,memory-region";
reg = <0x90000000 DT_SIZE_M(16)>; /* max addressable area */
zephyr,memory-region = "EXTMEM";
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this comment? ATTR_MPU_EXTMEM is expected to cause MPU faults:

#define REGION_EXTMEM_ATTR(size) {(STRONGLY_ORDERED_SHAREABLE | size | NO_ACCESS_Msk)}

(Emphasis mine: | NO_ACCESS_Msk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Samples Samples platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sample code_relocation_nocopy doesn't work on STM32F746-DISCO
4 participants