doc: kernel: code-relocation: Remove kernel example and add tips

The Kernel code relocation example does not work, as the kernel
contains early initialization code that executes before code
relocation takes place

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
This commit is contained in:
Grant Ramsay 2024-04-07 13:57:24 +12:00 committed by Fabio Baltieri
commit 0933cdec15

View file

@ -135,13 +135,21 @@ Relocating libraries
Libraries can be relocated using the LIBRARY argument to
``zephyr_code_relocation()`` with the library name. For example, the following
snippet will relocate kernel code to ITCM and serial drivers to SRAM2:
snippet will relocate serial drivers to SRAM2:
.. code-block:: none
zephyr_code_relocate(LIBRARY kernel LOCATION ITCM_TEXT)
zephyr_code_relocate(LIBRARY drivers__serial LOCATION SRAM2)
Tips
====
Take care if relocating kernel/arch files, some contain early initialization
code that executes before code relocation takes place.
Additional MPU/MMU configuration may be required to ensure that the
destination memory region is configured to allow code execution.
Samples/ Tests
==============