NRF_LOG causes device reset if RTT viewer not connected

When RTT viewer is not connected, the buffer will eventually overflow and it causes device hanging and being reset by wdt eventually. When I connect to the RTT viewer before wdt resets the device, all logs will flush and the device will continue to work correctly. In the application I call NRF_LOG_INFO, NRF_LOG_HEXDUMP_INFO and NRF_LOG_FLUSH(). 

Here are my sdk_configs:

#define NRF_LOG_BACKEND_RTT_ENABLED 1
#define NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE 64
#define NRF_LOG_BACKEND_RTT_TX_RETRY_DELAY_MS 1
#define NRF_LOG_BACKEND_RTT_TX_RETRY_CNT 3
#define NRF_LOG_ENABLED 1
#define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20
#define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8
#define NRF_LOG_ALLOW_OVERFLOW 1
#define NRF_LOG_BUFSIZE 1024
#define NRF_LOG_CLI_CMDS 0
#define NRF_LOG_DEFAULT_LEVEL 3
#define NRF_LOG_DEFERRED 1
#define NRF_LOG_FILTERS_ENABLED 0
#define NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED 0
#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128

Parents
  • Assuming that you are using nRF5SDKv 17.1.0, you can put the breakpoints at the below places and run your application in the debugger.

    nRF5_SDK_17.1.0_ddde560/components/boards/boards.c(120):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/hardfault/hardfault_implementation.c(59):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c(409):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/util/app_error_weak.c(105):NVIC_SystemReset();

    When one of them is hit, then we get the context of the error.

    I tried to flood the RTT and also used your config and disconnect it from the RTT viewer and I did not see any resets. 

Reply
  • Assuming that you are using nRF5SDKv 17.1.0, you can put the breakpoints at the below places and run your application in the debugger.

    nRF5_SDK_17.1.0_ddde560/components/boards/boards.c(120):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/hardfault/hardfault_implementation.c(59):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c(409):NVIC_SystemReset();
    nRF5_SDK_17.1.0_ddde560/components/libraries/util/app_error_weak.c(105):NVIC_SystemReset();

    When one of them is hit, then we get the context of the error.

    I tried to flood the RTT and also used your config and disconnect it from the RTT viewer and I did not see any resets. 

Children
No Data
Related