• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/04-Jan-2025-2517

src/04-Jan-2025-9350

CMakeLists.txtD04-Jan-2025611 1912

README.rstD04-Jan-20252 KiB6649

linker_arm_nocopy.ldD04-Jan-20252.1 KiB6749

prj.confD04-Jan-2025160 76

sample.yamlD04-Jan-2025580 2423

README.rst

1.. zephyr:code-sample:: code_relocation_nocopy
2   :name: Code relocation nocopy
3
4   Relocate code, data, or bss sections using a custom linker script.
5
6Overview
7********
8A simple example that demonstrates how relocation of code, data or bss sections
9using a custom linker script.
10
11Differently from the code relocation sample, this sample is relocating the
12content of the ext_code.c file to a different FLASH section and the code is XIP
13directly from there without the need to copy / relocate the code. All other code
14(e.g. main(), Zephyr kernel) stays in the internal flash.
15
16nRF5340 DK platform instructions
17********************************
18
19The nRF5340 DK has a 64 Mb external flash memory supporting Quad SPI. It is
20mapped to 0x10000000.
21
22To build and flash the application (including the external memory part):
23
24.. zephyr-app-commands::
25   :zephyr-app: samples/application_development/code_relocation_nocopy
26   :board: nrf5340dk/nrf5340/cpuapp
27   :goals: build flash
28   :compact:
29
30STM32F769I-Discovery platform instructions
31******************************************
32
33The stm32f769i_disco has 64MB of external flash attached via QSPI. It is mapped
34to 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
42STM32 b_u585i_iot02a Discovery kit instructions
43***********************************************
44
45The b_u585i_iot02a has 64MB of external flash attached via OSPI. It is mapped
46to 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
54Execution output
55****************
56
57.. code-block:: console
58
59  *** Booting Zephyr OS build v3.0.0-rc3-25-g0df32cec1ff2  ***
60  Address of main function 0x4f9
61  Address of function_in_ext_flash 0x10000001
62  Address of var_ext_sram_data 0x200000a0 (10)
63  Address of function_in_sram 0x20000001
64  Address of var_sram_data 0x200000a4 (10)
65  Hello World! nrf5340dk/nrf5340/cpuapp
66