From 13bbffb56d6e17050deba092ad8193dc9f5944ab Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Wed, 20 Nov 2024 23:15:37 +0800 Subject: [PATCH] [jlink] add build option RTT_BUFFER_SIZE to set the RTT buffer size (#938) When debugging OT via the RTT, OT output logs are often truncated because the RTT buffer size is too small. This commit adds the build option RTT_BUFFER_SIZE to easily change the RTT buffer size. --- third_party/jlink/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/third_party/jlink/CMakeLists.txt b/third_party/jlink/CMakeLists.txt index 02da35b0..dac3e0e8 100644 --- a/third_party/jlink/CMakeLists.txt +++ b/third_party/jlink/CMakeLists.txt @@ -45,6 +45,13 @@ else() ) endif() +option(RTT_BUFFER_SIZE "sets the RTT up buffer size") +if(RTT_BUFFER_SIZE) + target_compile_options(jlinkrtt PRIVATE + -DSEGGER_RTT_CONFIG_BUFFER_SIZE_UP=${RTT_BUFFER_SIZE} + ) +endif() + target_compile_options(jlinkrtt PRIVATE -DSEGGER_RTT_CONFIG_H=\"${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT_Conf.h\" -DUSE_APP_CONFIG=1