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

Parents Reply
  • Hi Amanda,

    thanks for the input - in the meantime I have found the reason why this problem appeared: At the end of the RTC Timer handler I wanted to erase any appeared event flag.

    NRF_RTC0->EVENTS_COMPARE[0] = 0;

    This was no good idea...

    Since I have commented this out the problem disappeared.

    Now I have 2 remaining problems; let's start with the 'easier' one: In our application we use BLE with the Softdevice S140. As long as our electronics (using nRF52840) is not BLE-connected, only advertising, RTT runs mostly fine. But when a BLE central connects then an error appears and the µC starts and stays in the error-handler. We can see an error-number, but in earlier versions we could also see the module and the line where this appeared. 

    Maybe I have overseen any modifications to do when migrating from SDK13.0 to 15.3 and even to 17.1?

    I would appreciate your help to make run this very helpful function as we know that from earlier days.

    BR, matthK

Children
No Data
Related