Skip to content

Commit e7a53cf

Browse files
arbraunscarlescufi
authored andcommitted
samples: code_relocation_nocopy: add stm32f769i_disco board
This board has memory-mapped QSPI flash. Signed-off-by: Armin Brauns <[email protected]>
1 parent 0023986 commit e7a53cf

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

samples/application_development/code_relocation_nocopy/README.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@ using a custom linker script.
1010

1111
Differently from the code relocation sample, this sample is relocating the
1212
content of the ext_code.c file to a different FLASH section and the code is XIP
13-
directly from there without the need to copy / relocate the code.
13+
directly from there without the need to copy / relocate the code. All other code
14+
(e.g. main(), Zephyr kernel) stays in the internal flash.
1415

1516
nRF5340 DK platform instructions
1617
********************************
1718

1819
The nRF5340 DK has a 64 Mb external flash memory supporting Quad SPI. It is
19-
possible to do XIP from the external flash memory.
20-
21-
The external flash memory is mapped to 0x10000000.
22-
23-
In this sample we relocate some of the code to the external flash memory with
24-
the remaining Zephyr kernel in the internal flash.
20+
mapped to 0x10000000.
2521

2622
To build and flash the application (including the external memory part):
2723

@@ -31,7 +27,20 @@ To build and flash the application (including the external memory part):
3127
:goals: build flash
3228
:compact:
3329

34-
Execution output:
30+
STM32F769I-Discovery platform instructions
31+
******************************************
32+
33+
The stm32f769i_disco has 64MB of external flash attached via QSPI. It is mapped
34+
to 0x90000000.
35+
36+
.. zephyr-app-commands::
37+
:zephyr-app: samples/application_development/code_relocation_nocopy
38+
:board: stm32f769i_disco
39+
:goals: build flash
40+
:compact:
41+
42+
Execution output
43+
****************
3544

3645
.. code-block:: console
3746
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_qspi_nor))
30+
/* On stm32 QSPI, external flash is mapped in XIP region at address given by the reg property. */
31+
32+
#define EXTFLASH_NODE DT_INST(0, st_stm32_qspi_nor)
33+
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor))
34+
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_qspi_nor), 1)
35+
2936
#else
3037

3138
/*

samples/application_development/code_relocation_nocopy/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tests:
66
platform_allow:
77
- qemu_cortex_m3
88
- nrf5340dk/nrf5340/cpuapp
9+
- stm32f769i_disco
910
integration_platforms:
1011
- qemu_cortex_m3
1112
tags: linker

0 commit comments

Comments
 (0)