When enabling RTT the program runs until the first NRF_LOG_PROCESS() Verification and then directly in the HardFault-Handler

Hello,

our project which started 7 years ago with SDK13.0 has been migrated some time ago to SDK 15.3 and now to SDK17.1. At the beginning we were quite happy with the RTT functions, but since a certain time (maybe beginning with SDK15.3) we can not use it any more because the firmware runs directly to the HardFault handler.

We have verified and updated our code already using some tickets from this forum like 

  • Case ID: 123565: RTT & RTT disable sdk 12/13 nRF52832/nRF52840
    or
  • Case ID: 213834: RTT Logging not working when building with ARM GCC
    or
  • Case ID: 128187: RTT logs broken in SDK14.2 with GCC

but still RTT does not work.

In sdk_config.h we have defined

NRF_LOG_ENABLED = 1

NRF_LOG_BACKEND_RTT_ENABLED = 1

NRF_LOG_BACKEND_SERIAL_USES_RTT = 1

NRF_LOG_BACKEND_SERIAL_USES_UART = 0

I have joined a screenshot from the debugging phase where the first NRF_LOG_PROCESS() check is done, at the left side of the screenshot

you can see how the µC runs to the HardFault Handler.

We use the nRF52840 and gcc GNU_ARM/9 2020-q2-update.

What can we do to make RTT run? 

BR, matthK

Related