From 9c52b9e54407fdcf6b11c55cbc69af7e7620fe24 Mon Sep 17 00:00:00 2001 From: Giancarlo Stasi Date: Tue, 31 Jan 2023 10:57:28 +0100 Subject: [PATCH] linker: arm: support CONFIG_SEGGER_RTT_SECTION_FIXED_ADDR for Cortex-M When CONFIG_SEGGER_RTT_SECTION_FIXED_ADDR is defined, the ".rtt_buff_data" section contains RTT control block and buffers. The linker command/script file places this section at beginning of RAM to allow different programs (typically bootloader and application) to share this address and have seamless logging. Signed-off-by: Giancarlo Stasi --- .../zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld index 567e213fe6d158d..7d3b4476f6c8286 100644 --- a/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/zephyr/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -232,6 +232,16 @@ SECTIONS . = ALIGN(_region_min_align); _image_ram_start = .; +#if defined(CONFIG_SEGGER_RTT_SECTION_FIXED_ADDR) + SECTION_DATA_PROLOGUE(_DTCM_SECTION_NAME,(NOLOAD),) + { + __rtt_buff_data_start = .; + *(.rtt_buff_data) + __rtt_buff_data_end = ALIGN(4); + } GROUP_DATA_LINK_IN(RAMABLE_REGION, RAMABLE_REGION) + __rtt_buff_data_size = __rtt_buff_data_end - __rtt_buff_data_start; +#endif + /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */