Skip to content

Commit 4101948

Browse files
FRASTMdleach02
authored andcommitted
samples: code relocation in external memory of stm32 disco kit
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]>
1 parent ae06f92 commit 4101948

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

samples/application_development/code_relocation_nocopy/README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ to 0x90000000.
3939
:goals: build flash
4040
:compact:
4141

42+
STM32 b_u585i_iot02a Discovery kit instructions
43+
***********************************************
44+
45+
The b_u585i_iot02a has 64MB of external flash attached via OSPI. It is mapped
46+
to 0x70000000.
47+
48+
.. zephyr-app-commands::
49+
:zephyr-app: samples/application_development/code_relocation_nocopy
50+
:board: b_u585i_iot02a
51+
:goals: build flash
52+
:compact:
53+
4254
Execution output
4355
****************
4456

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_FLASH=y
2+
CONFIG_STM32_MEMMAP=y
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_FLASH=y
2+
CONFIG_STM32_MEMMAP=y

samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
#define EXTFLASH_SIZE DT_PROP_OR(EXTFLASH_NODE, size_in_bytes, \
2727
DT_PROP(EXTFLASH_NODE, size) / 8)
2828

29+
#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_ospi_nor))
30+
/* On stm32 OSPI, external flash is mapped in XIP region at address given by the reg property. */
31+
32+
#define EXTFLASH_NODE DT_INST(0, st_stm32_ospi_nor)
33+
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor))
34+
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_ospi_nor), 1)
35+
2936
#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_qspi_nor))
3037
/* On stm32 QSPI, external flash is mapped in XIP region at address given by the reg property. */
3138

samples/application_development/code_relocation_nocopy/sample.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ tests:
77
- qemu_cortex_m3
88
- nrf5340dk/nrf5340/cpuapp
99
- stm32f769i_disco
10+
- stm32h7b3i_dk
11+
- b_u585i_iot02a
1012
integration_platforms:
1113
- qemu_cortex_m3
1214
tags: linker

0 commit comments

Comments
 (0)