Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 73 additions & 8 deletions cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ endfunction()

#
# zephyr_library versions of normal CMake target_<func> functions
# Note, paths passed to this function must be relative in order
# to support the library relocation feature of zephyr_code_relocate
#
function(zephyr_library_sources source)
target_sources(${ZEPHYR_CURRENT_LIBRARY} PRIVATE ${source} ${ARGN})
Expand Down Expand Up @@ -1283,22 +1285,85 @@ endfunction(zephyr_linker_sources)


# Helper function for CONFIG_CODE_DATA_RELOCATION
# Call this function with 2 arguments file and then memory location.
# One optional [NOCOPY] flag can be used.
function(zephyr_code_relocate file location)
# This function may either be invoked with a list of files, or a library
# name to relocate.
#
# The FILES directive will relocate a list of files (wildcards supported)
# This directive will relocate file1. and file2.c to SRAM:
# zephyr_code_relocate(FILES file1.c file2.c LOCATION SRAM)
# Note, files can also be passed as a comma separated list to support using
# cmake generator arguments
#
# The LIBRARY directive will relocate a library
# This directive will relocate the target my_lib to SRAM:
# zephyr_code_relocate(LIBRARY my_lib SRAM)
#
# The following optional arguments are supported:
# - NOCOPY: this flag indicates that the file data does not need to be copied
# at boot time (For example, for flash XIP).
# - PHDR [program_header]: add program header. Used on Xtensa platforms.
function(zephyr_code_relocate)
set(options NOCOPY)
cmake_parse_arguments(CODE_REL "${options}" "" "" ${ARGN})
if(NOT IS_ABSOLUTE ${file})
set(file ${CMAKE_CURRENT_SOURCE_DIR}/${file})
set(single_args LIBRARY LOCATION PHDR)
set(multi_args FILES)
cmake_parse_arguments(CODE_REL "${options}" "${single_args}"
"${multi_args}" ${ARGN})
# Argument validation
if(CODE_REL_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "zephyr_code_relocate(${ARGV0} ...) "
"given unknown arguments: ${CODE_REL_UNPARSED_ARGUMENTS}")
endif()
if((NOT CODE_REL_FILES) AND (NOT CODE_REL_LIBRARY))
message(FATAL_ERROR
"zephyr_code_relocate() requires either FILES or LIBRARY be provided")
endif()
if(CODE_REL_FILES AND CODE_REL_LIBRARY)
message(FATAL_ERROR "zephyr_code_relocate() only accepts "
"one argument between FILES and LIBRARY")
endif()
if(NOT CODE_REL_LOCATION)
message(FATAL_ERROR "zephyr_code_relocate() requires a LOCATION argument")
endif()
if(CODE_REL_LIBRARY)
# Use cmake generator expression to convert library to file list
set(genex_src_dir "$<TARGET_PROPERTY:${CODE_REL_LIBRARY},SOURCE_DIR>")
set(genex_src_list "$<TARGET_PROPERTY:${CODE_REL_LIBRARY},SOURCES>")
set(file_list
"${genex_src_dir}/$<JOIN:${genex_src_list},$<SEMICOLON>${genex_src_dir}/>")
else()
# Check if CODE_REL_FILES is a generator expression, if so leave it
# untouched.
string(GENEX_STRIP "${CODE_REL_FILES}" no_genex)
if(CODE_REL_FILES STREQUAL no_genex)
Comment on lines +1336 to +1337
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever way of testing for genex in a variable.
I would just have used if("${argument}" MATCHES ".*\\$\\<.*\\>.*") to test for any genex, but this code is much more readable 👍

# no generator expression in CODE_REL_FILES, check if list of files
# is absolute
foreach(file ${CODE_REL_FILES})
if(NOT IS_ABSOLUTE ${file})
set(file ${CMAKE_CURRENT_SOURCE_DIR}/${file})
endif()
list(APPEND file_list ${file})
endforeach()
else()
# Generator expression is present in file list. Leave the list untouched.
set(file_list ${CODE_REL_FILES})
Comment on lines +1347 to +1348
Copy link
Contributor

@tejlmand tejlmand Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit unfortunate that we require a comma separated list here: https://github.com/NXPmicro/zephyr/blob/fe4f6cdb9209d36d8a2044113ad7abac8ca2af3d/scripts/build/gen_relocate_app.py#L438-L439

but the way mem region and copy flag are passed makes it hard to use nargs='*'.

The benefit of nargs='*' would be that a genex could be passed as-is, but now caller must be aware that any genex which results in a CMake list must have semicolons replaced with comma. (the nargs='*' helps because it allows multi args separated by spaces, which is ensured in CMake with COMMAND_EXPAND_LIST.

So the options I currently see are:

  • Put responsibility on caller to substitute ; with , on any genex results.
  • Always do a $<JOIN:${input},$<COMMA>> to ensure input lists has commans instead of semicolons.

First is errorprone to users as they can easily miss this, second is not so nice cause it's manipulating user argument behind their back (although not modifying anything if there is just a single element returned by the genex)

Will do some extra thinking on this, but @danieldegrasse please share any thoughts you have made on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the substitution method is probably best, with some documentation provided to the user. It is unfortunate, but if we don't perform some type of modification on the user input then the other alternative I can see be to change the genex directive in target_relocation.cmake to something like the following:

-i \"$<JOIN:$<TARGET_PROPERTY:code_data_relocation_target,COMPILE_DEFINITIONS>,$<COMMA>>\"

which would require the genex passed to zephyr_library_relocate to be modified, otherwise this JOIN directive would change it as well. So either way, we are left needing to change user input.

If we wanted to place the responsibility on the caller, we could update the gen_relocate_app.py script to print a warning when it detects a relocation directive without : present, which would be the failure mode of the script when a genex expression was passed without , subsituted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tejlmand What are your thoughts here? I'd like to move this PR forwards, as #50792 depends on a feature like this being available. Once we settle on a method here I can make other requested updates

endif()
endif()
if(NOT CODE_REL_NOCOPY)
set(copy_flag COPY)
else()
set(copy_flag NOCOPY)
endif()
if(CODE_REL_PHDR)
set(CODE_REL_LOCATION "${CODE_REL_LOCATION}\ :${CODE_REL_PHDR}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly why is an escaped space needed here ?
That doesn't seem to have been necessary before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHDR directive was previously paired with the relocation location, as you can see in this diff: https://github.com/zephyrproject-rtos/zephyr/pull/50791/files#diff-7087c4d7b0a6595b501520d5eb10ed5ecb01b3540831e3a141a6a662632ac940R20. This directive makes sure that the PHDR is still paired with the code location, so it can be parsed by gen_relocate_app.py. gen_relocate_app.py treats the PHDR as being paired with the relocation location, so this line preserves that behavior with the new API. An alternative here would be to integrate PHDR as a parameter like NOCOPY is used.

endif()
# We use the "|" character to separate code relocation directives instead
# of using CMake lists. This way, the ";" character can be reserved for
# generator expression file lists.
get_property(code_rel_str TARGET code_data_relocation_target
PROPERTY COMPILE_DEFINITIONS)
set_property(TARGET code_data_relocation_target
APPEND PROPERTY COMPILE_DEFINITIONS
"${location}:${copy_flag}:${file}")
PROPERTY COMPILE_DEFINITIONS
"${code_rel_str}|${CODE_REL_LOCATION}:${copy_flag}:${file_list}")
endfunction()

# Usage:
Expand Down
36 changes: 28 additions & 8 deletions doc/kernel/code-relocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ for data copy operations from ROM to required memory type.
* Inside the ``CMakeLists.txt`` file in the project, mention
all the files that need relocation.

``zephyr_code_relocate(src/*.c SRAM2)``
``zephyr_code_relocate(FILES src/*.c LOCATION SRAM2)``

Where the first argument is the file/files and the second
argument is the memory where it must be placed.

.. note::

The file argument supports limited regular expressions.
function zephyr_code_relocate() can be called as many times as required.
This step has to be performed before calling find_package(Zephyr ...)
in the application's CMakeLists.txt.
Expand All @@ -77,21 +76,30 @@ This section shows additional configuration options that can be set in

.. code-block:: none

zephyr_code_relocate(src/file1.c SRAM2)
zephyr_code_relocate(src/file2.c.c SRAM)
zephyr_code_relocate(FILES src/file1.c LOCATION SRAM2)
zephyr_code_relocate(FILES src/file2.c LOCATION SRAM)

* if the memory type is appended with _DATA, _TEXT, _RODATA or _BSS, only the
selected memory is placed in the required memory region.
for example:

.. code-block:: none

zephyr_code_relocate(src/file1.c SRAM2_DATA)
zephyr_code_relocate(src/file2.c.c SRAM2_TEXT)
zephyr_code_relocate(FILES src/file1.c LOCATION SRAM2_DATA)
zephyr_code_relocate(FILES src/file2.c LOCATION SRAM2_TEXT)

* Multiple regions can also be appended together such as: SRAM2_DATA_BSS.
This will place data and bss inside SRAM2.

* Multiple files can be passed to the FILES argument, or CMake generator
expressions can be used to relocate a comma-separated list of files
Comment on lines +94 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with this feature in place, I believe the note can be updated and this line removed:

The file argument supports limited regular expressions.

we don't need to inform users of an approach that is sub-optimal (incremental build wise) and harder to debug.

and when at it, maybe remove this line as well:

This step has to be performed before the inclusion of boilerplate.cmake.
as we no longer includes boilerplate.cmake directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this note in the latest push, so that regular expressions are no longer documented.


.. code-block:: none

file(GLOB sources "file*.c")
zephyr_code_relocate(FILES ${sources} LOCATION SRAM)
zephyr_code_relocate(FILES $<TARGET_PROPERTY:my_tgt,SOURCES> LOCATION SRAM)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as described in other comment, then I believe this example will not work unfortunately, because the python relocation script will expect the files to be comma separated,

But let's wait with adjusting this until the final approach has been decided.


NOCOPY flag
===========

Expand All @@ -106,8 +114,20 @@ to the ``EXTFLASH`` memory region where it will be executed from (XIP). The

.. code-block:: none

zephyr_code_relocate(src/xip_external_flash.c EXTFLASH_TEXT NOCOPY)
zephyr_code_relocate(src/xip_external_flash.c SRAM_DATA)
zephyr_code_relocate(FILES src/xip_external_flash.c LOCATION EXTFLASH_TEXT NOCOPY)
zephyr_code_relocate(FILES src/xip_external_flash.c LOCATION SRAM_DATA)

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:

.. code-block:: none

zephyr_code_relocate(LIBRARY kernel LOCATION ITCM_TEXT)
zephyr_code_relocate(LIBRARY drivers__serial LOCATION SRAM2)

Sample
======
Expand Down
5 changes: 5 additions & 0 deletions doc/releases/release-notes-3.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ Boards & SoC Support
Build system and infrastructure
*******************************

* Code relocation

* ``zephyr_code_relocate`` API has changed to accept a list of files to
relocate and a location to place the files.

Drivers and Sensors
*******************

Expand Down
6 changes: 3 additions & 3 deletions drivers/flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
dt_chosen(chosen_flash PROPERTY "zephyr,flash")
dt_prop(compat_flash PATH ${chosen_flash} PROPERTY compatible)
if(compat_flash MATCHES "nxp,imx-flexspi-nor")
zephyr_code_relocate(flash_mcux_flexspi_nor.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
zephyr_code_relocate(FILES flash_mcux_flexspi_nor.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
elseif(compat_flash MATCHES "nxp,imx-flexspi-mx25um51345g")
zephyr_code_relocate(flash_mcux_flexspi_mx25um51345g.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
zephyr_code_relocate(FILES flash_mcux_flexspi_mx25um51345g.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
elseif(compat_flash MATCHES "nxp,imx-flexspi-hyperflash")
zephyr_code_relocate(flash_mcux_flexspi_hyperflash.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
zephyr_code_relocate(FILES flash_mcux_flexspi_hyperflash.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion drivers/memc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ zephyr_library_sources_ifdef(CONFIG_MEMC_MCUX_FLEXSPI_APS6408L memc_mcux_flexspi
zephyr_library_sources_ifdef(CONFIG_MEMC_SAM_SMC memc_sam_smc.c)

if((DEFINED CONFIG_FLASH_MCUX_FLEXSPI_XIP) AND (DEFINED CONFIG_FLASH))
zephyr_code_relocate(memc_mcux_flexspi.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
zephyr_code_relocate(FILES memc_mcux_flexspi.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ target_sources(app PRIVATE ${app_sources})
target_sources_ifdef(CONFIG_NRFX_QSPI app PRIVATE boards/nrf5340dk_nrf5340_cpuapp/ext_mem_init.c)

# Run ext_code from the external flash (XIP). No need to copy.
zephyr_code_relocate(src/ext_code.c EXTFLASH_TEXT NOCOPY)
zephyr_code_relocate(FILES src/ext_code.c LOCATION EXTFLASH_TEXT NOCOPY)

# But still relocate (copy) the data to RAM
zephyr_code_relocate(src/ext_code.c RAM_DATA)
zephyr_code_relocate(FILES src/ext_code.c LOCATION RAM_DATA)

# sram_code instead runs entirely from SRAM after being copied there.
zephyr_code_relocate(src/sram_code.c RAM)
zephyr_code_relocate(FILES src/sram_code.c LOCATION RAM)
10 changes: 5 additions & 5 deletions samples/boards/intel_adsp/code_relocation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ project(adsp_cavs_code_relocation)

target_sources(app PRIVATE src/main.c src/reloc.c)

zephyr_code_relocate(src/reloc.c SRAM2_LITERAL)
zephyr_code_relocate(src/reloc.c SRAM2_TEXT)
zephyr_code_relocate(src/reloc.c SRAM3_DATA)
zephyr_code_relocate(src/reloc.c SRAM3_RODATA)
zephyr_code_relocate(src/reloc.c SRAM4_BSS)
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM2_LITERAL)
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM2_TEXT)
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM3_DATA)
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM3_RODATA)
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM4_BSS)
23 changes: 17 additions & 6 deletions scripts/build/gen_relocate_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,24 +464,35 @@ def create_dict_wrt_mem():

if args.input_rel_dict == '':
sys.exit("Disable CONFIG_CODE_DATA_RELOCATION if no file needs relocation")
for line in args.input_rel_dict.split(';'):
for line in args.input_rel_dict.split('|'):
if ':' not in line:
continue

mem_region, phdr, copy_flag, file_name = parse_input_string(line)
mem_region, phdr, copy_flag, file_list = parse_input_string(line)

# Handle any program header
if phdr != '':
phdrs[mem_region] = f':{phdr}'

file_name_list = glob.glob(file_name)
if not file_name_list:
warnings.warn("File: "+file_name+" Not found")
# Split file names by semicolons, to support generator expressions
file_glob_list = file_list.split(';')
file_name_list = []
# Use glob matching on each file in the list
for file_glob in file_glob_list:
glob_results = glob.glob(file_glob)
if not glob_results:
warnings.warn("File: "+file_glob+" Not found")
continue
elif len(glob_results) > 1:
warnings.warn("Regex in file lists is deprecated, please use file(GLOB) instead")
file_name_list.extend(glob_results)
if len(file_name_list) == 0:
warnings.warn("No files in string: "+file_list+" found")
continue
if mem_region == '':
continue
if args.verbose:
print("Memory region ", mem_region, " Selected for file:", file_name_list)
print("Memory region ", mem_region, " Selected for files:", file_name_list)

mem_region = "|".join((mem_region, copy_flag))

Expand Down
4 changes: 2 additions & 2 deletions soc/arm/nxp_imx/rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ endif()

if (CONFIG_PM AND CONFIG_SOC_SERIES_IMX_RT10XX)
zephyr_sources(power_rt10xx.c)
zephyr_code_relocate(power_rt10xx.c ITCM_TEXT)
zephyr_code_relocate(FILES power_rt10xx.c LOCATION ITCM_TEXT)
if (CONFIG_SOC_MIMXRT1064)
zephyr_sources(lpm_rt1064.c)
zephyr_code_relocate(lpm_rt1064.c ITCM_TEXT)
zephyr_code_relocate(FILES lpm_rt1064.c LOCATION ITCM_TEXT)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion soc/arm/nxp_imx/rt5xx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ zephyr_linker_sources_ifdef(CONFIG_NXP_IMX_RT5XX_BOOT_HEADER
zephyr_linker_sources_ifdef(CONFIG_USB_DEVICE_DRIVER
SECTIONS usb.ld)

zephyr_code_relocate(flash_clock_setup.c RAM)
zephyr_code_relocate(FILES flash_clock_setup.c LOCATION RAM)
2 changes: 1 addition & 1 deletion soc/arm/nxp_imx/rt6xx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ zephyr_linker_sources_ifdef(CONFIG_USB_DEVICE_DRIVER
SECTIONS usb.ld)

if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
zephyr_code_relocate(flash_clock_setup.c RAM)
zephyr_code_relocate(FILES flash_clock_setup.c LOCATION RAM)
endif()
36 changes: 26 additions & 10 deletions tests/application_development/code_relocation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 NXP

cmake_minimum_required(VERSION 3.20.0)

Expand All @@ -9,24 +10,39 @@ FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

if (CONFIG_BOARD_QEMU_XTENSA)
set(RAM_PHDR :sram0_phdr)
set(SRAM2_PHDR :sram2_phdr)
set(RAM_PHDR PHDR sram0_phdr)
set(SRAM2_PHDR PHDR sram2_phdr)
endif()

# Code relocation feature
zephyr_code_relocate(src/test_file1.c "SRAM2 ${SRAM2_PHDR}")
zephyr_code_relocate(FILES src/test_file1.c ${SRAM2_PHDR} LOCATION SRAM2)

zephyr_code_relocate(src/test_file2.c "RAM ${RAM_PHDR}")
zephyr_code_relocate(FILES src/test_file2.c ${RAM_PHDR} LOCATION RAM)

zephyr_code_relocate(src/test_file3.c SRAM2_LITERAL)
zephyr_code_relocate(src/test_file3.c SRAM2_TEXT)
zephyr_code_relocate(src/test_file3.c RAM_DATA)
zephyr_code_relocate(src/test_file3.c SRAM2_BSS)
# Add custom library that we can relocate code for
add_subdirectory(test_lib)
target_link_libraries(app PUBLIC test_lib)
target_include_directories(app PUBLIC ${CMAKE_CURRENT_LIST_DIR}/test_lib)
# Relocate library code
zephyr_code_relocate(LIBRARY test_lib LOCATION SRAM2)

zephyr_code_relocate(../../../kernel/sem.c "RAM ${RAM_PHDR}")
# Test support for a simple generator expression to relocate two files
set(reloc_files src/test_file4.c src/test_file5.c)
set(genex_expr
${CMAKE_CURRENT_LIST_DIR}/$<JOIN:${reloc_files},$<SEMICOLON>${CMAKE_CURRENT_LIST_DIR}/>)
zephyr_code_relocate(FILES ${genex_expr} LOCATION SRAM2)

zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_LITERAL)
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_TEXT)
zephyr_code_relocate(FILES src/test_file3.c LOCATION RAM_DATA)
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_BSS)


zephyr_code_relocate(FILES ${ZEPHYR_BASE}/kernel/sem.c ${RAM_PHDR} LOCATION RAM)

if (CONFIG_RELOCATE_TO_ITCM)
zephyr_code_relocate(../../../lib/libc/minimal/source/string/string.c ITCM_TEXT)
zephyr_code_relocate(FILES ${ZEPHYR_BASE}/lib/libc/minimal/source/string/string.c
LOCATION ITCM_TEXT)
endif()

zephyr_linker_sources(SECTIONS custom-sections.ld)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <zephyr/sys/printk.h>
#include <zephyr/ztest.h>

#include "test_lib.h"

/*
* These values will typically be placed in the appropriate sections, but may be moved around
* by the compiler; for instance var_sram2_data might end up in .rodata if the compiler can prove
Expand Down Expand Up @@ -63,6 +65,8 @@ ZTEST(code_relocation, test_function_in_sram2)

/* Print values from sram */
function_in_sram(var_sram2_data);
/* Call library function */
relocated_library();

/* Print values which were placed using attributes */
printk("Address of custom_section, func placed using attributes %p\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ void function_in_sram(int32_t value)

printk("Hello World! %s\n", CONFIG_BOARD);
memcpy(dst, src, 8);
printk("Address of memcpy %p\n", &memcpy);
printk("Address of memcpy %p\n\n", &memcpy);
zassert_mem_equal(src, dst, 8, "memcpy compare error");
}
Loading