modules: segger: RTT control block alignment

Make the alignment of the RTT control block configurable, defaulting to
16 bytes. The default is chosen as PyOCD fails to discover the control
block if the 16 byte ID array falls across a 32 byte boundary.

Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
Jordan Yates 2025-02-04 16:22:27 +10:00 committed by Benjamin Cabé
commit 4a6e478d71
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,6 @@
if(CONFIG_USE_SEGGER_RTT) if(CONFIG_USE_SEGGER_RTT)
zephyr_library() zephyr_library()
zephyr_library_compile_definitions(SEGGER_RTT_ALIGNMENT=CONFIG_SEGGER_RTT_CB_ALIGNMENT)
set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) set(SEGGER_DIR ${ZEPHYR_CURRENT_MODULE_DIR})
zephyr_include_directories_ifdef(CONFIG_USE_SEGGER_RTT zephyr_include_directories_ifdef(CONFIG_USE_SEGGER_RTT
${SEGGER_DIR}/SEGGER ${SEGGER_DIR}/SEGGER

View file

@ -25,6 +25,14 @@ config SEGGER_RTT_CUSTOM_LOCKING
help help
Enable custom locking using Zephyr APIs. Enable custom locking using Zephyr APIs.
config SEGGER_RTT_CB_ALIGNMENT
int "Alignment of the RTT control block"
default 16
help
Specify the alignment of the RTT control block in memory. The default
alignment of 16 bytes is chosen because PyOCD fails to discover blocks
where the 16 byte `acID` field falls across a 32 byte boundary.
config SEGGER_RTT_MAX_NUM_UP_BUFFERS config SEGGER_RTT_MAX_NUM_UP_BUFFERS
int "Maximum number of up-buffers" int "Maximum number of up-buffers"
default 3 default 3