Allows optionally placing Segger RTT data either in a specific linker section that is located at RAM start, or in a specific linker section defined by a memory region in DTS, as third and fourth alternative to the DTCM section or the default data section. This is useful to share the fixed address for different programs, typically bootloader and application, and have seamless logging. Signed-off-by: Giancarlo Stasi <giancarlo.stasi.co@gmail.com>
31 lines
956 B
CMake
31 lines
956 B
CMake
if(CONFIG_USE_SEGGER_RTT)
|
|
zephyr_library()
|
|
set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR})
|
|
zephyr_include_directories_ifdef(CONFIG_USE_SEGGER_RTT
|
|
${SEGGER_DIR}/SEGGER
|
|
${SEGGER_DIR}/Config
|
|
)
|
|
zephyr_library_sources(
|
|
${SEGGER_DIR}/SEGGER/SEGGER_RTT.c
|
|
SEGGER_RTT_zephyr.c
|
|
)
|
|
zephyr_library_sources_ifdef(CONFIG_SEGGER_SYSTEMVIEW ${SEGGER_DIR}/SEGGER/SEGGER_SYSVIEW.c)
|
|
# Using sort key AAA to ensure that we are placed at start of RAM
|
|
zephyr_linker_sources_ifdef(CONFIG_SEGGER_RTT_SECTION_CUSTOM RAM_SECTIONS SORT_KEY aaa segger_rtt.ld)
|
|
endif()
|
|
|
|
if(CONFIG_SEGGER_DEBUGMON)
|
|
if(!CONFIG_USE_SEGGER_RTT)
|
|
zephyr_library()
|
|
endif()
|
|
|
|
set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR})
|
|
zephyr_include_directories_ifdef(CONFIG_SEGGER_DEBUGMON
|
|
${SEGGER_DIR}/SEGGER/DebugMon/include
|
|
)
|
|
zephyr_library_sources(
|
|
${SEGGER_DIR}/SEGGER/DebugMon/JLINK_MONITOR.c
|
|
${SEGGER_DIR}/SEGGER/DebugMon/JLINK_MONITOR_ISR_SES.s
|
|
)
|
|
endif()
|