Hello all,
i need to save uint64_t in to a specific memory address.
__attribute__((section(".flash_id_number"))) const uint64_t my_id_number = 0x1500080507032592;SECTIONS
{
.flash_id_number 0x40000 :
{
*(.flash_id_number)
KEEP(*(.flash_id_number*))
} > FLASH
}#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
cmake_minimum_required(VERSION 3.20.0)
set(LINKER_SCRIPT "C:/Users/Enrico/PTT_Dual_2_0/my_memory.ld")
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
....
ztest :
{
_ztest_expected_result_entry_list_start = .; KEEP(*(SORT_BY_NAME(._ztest_expected_result_entry.static.*))); _ztest_expected_result_entry_list_end = .;
_ztest_suite_node_list_start = .; KEEP(*(SORT_BY_NAME(._ztest_suite_node.static.*))); _ztest_suite_node_list_end = .;
_ztest_unit_test_list_start = .; KEEP(*(SORT_BY_NAME(._ztest_unit_test.static.*))); _ztest_unit_test_list_end = .;
_ztest_test_rule_list_start = .; KEEP(*(SORT_BY_NAME(._ztest_test_rule.static.*))); _ztest_test_rule_list_end = .;
} > FLASH
.flash_id_number 0x40000 :
{
*(.flash_id_number)
KEEP(*(.flash_id_number*))
} > FLASH
....It works, and I can see the values written at the correct memory address, but when I recompile the main.c it deletes the changes in the linker.cmd file, and I no longer have the values at the correct memory address.
I'm using nrf52840 and ncs 2.6.1
Can you help me in some way?