This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Opening RTT console causes repeated resets

One of the nRF52840-DK (PCA10056 v2.0.0) we are using as a programmer and debugger for our custom board has started repeatedly resetting the custom board whenever an RTT console is opened. However it still works as a programmer and can control the program execution fine through JLink commander.

This behaviour is definitely caused by the one nRF52840-DK board as other DKs we have do not produce the same behaviour when attached to the same custom board. The problematic DK produces the behaviour on all the custom boards we have tried.

Reflashing the bootloader on the DKs with the latest version of the firmware available (either through Segger Embedded Studio or the Nordic website) does not change this behaviour. Updating SES and JLink RTT viewer also had no effect.

Do you have any recommendations for what to try next?

  • In my experience, it's not the RTT message case the system reset. It's usual the error handle procedure case the system reset. In your project code, it must be some error in some case. for example:

    err_code = some_func();
    APP_ERROR_CHECK(err_code);

    if the err_code happen, RTT will show log first, but error handle here

    __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
    NRF_LOG_ERROR("Fatal\r\n");
    NRF_LOG_FINAL_FLUSH();
    // On assert, the system can only recover with a reset.
    #ifndef DEBUG
    NVIC_SystemReset();
    #else
    app_error_save_and_stop(id, pc, info);
    #endif // DEBUG
    }

    cause system reset. I think you have better to find out the real error cause.

    Else you may disable the RTT log backend in your sdk_config.h

    And try the root cause is RTT function or not?

  • If the cause is elsewhere in the code, why does this issue only occur with one particular board and not all others? Another debugging board has started doing the same behaviour, however when run with a third debugger and the same code these resets do not occur.

    Loading programs onto the custom board has also become hit-or-miss; failing for several 'undocumented errors' in a row before succeeding. This is possibly due to the constant resets.

    Regardless, I have tried disabling RTT logging and it fixed the issue of constant resets. However, this is not a practical solution as both of the UARTs are used so the only logging is from the SD card which cannot be accessed live. (Additionally UART logging occasionally causes the whole system to hang whilst waiting for a interrupt that never triggers.) Do you have an recommendations for the next steps to try and fix this?

Related