Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The entry-point rename and incomplete RTT integration break unit-test, stage-1, and test-app builds, while the benchmark default no longer enables floating-point output.
4 open issues
What changed in this PR
Adds SEGGER RTT as an alternative logging backend, reusing wolfBoot’s minimal formatter and preserving UART precedence when both backends are enabled.
Changes:
- Routes the shared formatter to UART or RTT up-channel 0.
- Adds RTT build settings and setup documentation.
- Renames formatter entry points and updates float-formatting guards and existing tests.
| File | Description |
|---|---|
| tools/unit-tests/unit-string.c | Updates tests to use the renamed formatter functions. |
| test-app/syscalls.c | Uses the backend-neutral float-formatting guard. |
| test-app/Makefile | Adjusts float-formatting defaults and compiler definitions. |
| src/string.c | Shares formatting code between UART and RTT output. |
| options.mk | Adds RTT include paths, compiler flags, and implementation object. |
| include/printf.h | Routes logging through tiny_printf for either backend. |
| docs/compile.md | Documents RTT configuration and UART precedence. |
| arch.mk | Adds a DEBUG_RTT=1 compiler-definition check. |
Review effort: Balanced
dgarske
left a comment
There was a problem hiding this comment.
Please review the copilot feedback. #969 (review)
danielinux
left a comment
There was a problem hiding this comment.
LGTM, when reachability of tiny_printf in unit test is fixed.
Add RTT as an alternative output backend for the existing minimal UART printf implementation, sharing the formatter rather than introducing a separate one. RTT output uses up-channel 0; UART takes precedence when both backends are enabled. To enable RTT, check out https://github.com/SEGGERMicro/RTT and build with DEBUG_RTT=/path/to/segger_rtt and DEBUG_UART=0. Supply the configuration header as SEGGER_RTT_Conf.h and add its directory using CFLAGS_EXTRA=-I/path/to/rtt_config/. The build links the RTT implementation and enables PRINTF_ENABLED automatically.
|
Fixed (i think, waiting for CI). in the end, I'm not really satisfied with the name 'tiny_printf'. What do you think about renaming it to log_printf? because that's really the only thing it's used for. |


This PR adds support for SEGGER RTT as an alternative output backend for print statements. It piggy-backs onto the existing minimal UART printf implementation, sharing the formatter rather than introducing a separate one. RTT output uses up-channel 0; UART takes precedence when both backends are enabled.
To enable RTT, check out https://github.com/SEGGERMicro/RTT and build with DEBUG_RTT=/path/to/segger_rtt and DEBUG_UART=0. Supply the configuration header as SEGGER_RTT_Conf.h and add its directory using CFLAGS_EXTRA=-I/path/to/rtt_config/. The build links the RTT implementation and enables PRINTF_ENABLED automatically.