Skip to content

Cannot see both bootloader and application RTT output #53544

@giansta

Description

@giansta

When attaching the SEGGER J-Link RTT Viewer to a nRF52 based target, in most cases only the logs from application are visible and not the logs from MCUboot, more seldom only logs from MCUboot.

Expected behaviour: both logs from MCUboot and from application are expected to be visible, like using serial or SWO.

Found solution:
The issue is due to the fact that the viewer or debugger looks in the target memory for RTT control block and buffer, searching for the "SEGGER RTT" signature. As MCUboot and application have them at different addresses, it either finds one or the other. The solution would be having them at same address for both and avoiding the application to re-initialize them if already initialized by MCUboot.
Confirmation and fixing hints can be found i.e. in https://devzone.nordicsemi.com/f/nordic-q-a/30310/easy-way-to-merge-bootloader-and-application-rtt-output
In the Nordic SDK this patch works well.

In Zephyr CONFIG_SEGGER_RTT_SECTION_DTCM defines a different section (.dtcm_data) for RTT control block and buffer, yet it seems that:

  • The linker file doesn't support this config and a orphan section .dtcm_data warning is given by the linker;
  • The SEGGER_RTT.c module needs patches to initialize properly the variables in `.dtcm_data' section and to not initialize them if already done by MCUboot.

I could verify that the two fixing above solve the issue and both logs are finally visible.
I didn't find any other open issue or PR mentioning it. I'll propose new PRs for the above changes, unless a better solution exists.

Impact: difficult to debug and diagnose proprietary DFU.

Environment:

  • OS: Windows 10 (Linux will be tested soon)
  • Toolchain: zephyr-sdk-0.14.2
  • commit 8e4137f

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions