File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed
samples/application_development/code_relocation_nocopy Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -10,18 +10,14 @@ using a custom linker script.
1010
1111Differently from the code relocation sample, this sample is relocating the
1212content 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
1516nRF5340 DK platform instructions
1617********************************
1718
1819The 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
2622To 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
Original file line number Diff line number Diff line change 1+ CONFIG_FLASH=y
2+ CONFIG_STM32_MEMMAP=y
Original file line number Diff line number Diff line change 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/*
Original file line number Diff line number Diff line change 66 platform_allow :
77 - qemu_cortex_m3
88 - nrf5340dk/nrf5340/cpuapp
9+ - stm32f769i_disco
910 integration_platforms :
1011 - qemu_cortex_m3
1112 tags : linker
You can’t perform that action at this time.
0 commit comments