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

NRF_LOG enabled on DFU BLE disables NRF_LOG in main application

Hello:

We had a main application with NRF_LOG using RTT as its backend, and it was working great. We are using the BLE_DFU and recently added NRF_LOG capabilities to this bootloader. However, it seems that now the RTT/NRF_LOG stops working when the application jumps from the bootloader to the main application!

Bootloader "main.c" init:

int main(void)
{
    uint32_t ret_val;
    NRF_WDT->RR[0] = WDT_RR_RR_Reload;
    (void) NRF_LOG_INIT(NULL);
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    NRF_LOG_INFO("Inside main"); //Can see message in RTT Viewer
    ret_val = CLK_watchdogInit();
    ...
    //Rest of bootloader (BLE)
    
}

Main application code

int main(void)
{
    int32_t err_code = 0;
    int32_t task_error = 0;

    // Initialize RTT
    err_code  = NRF_LOG_INIT(NULL);
    NRF_LOG_DEFAULT_BACKENDS_INIT();
    NRF_LOG_INFO("Hello!"); //Showed before, not now!
    NRF_LOG_FLUSH();
    SEGGER_RTT_WriteString(0, "NORMAL/ RTT initialized\n"); //Also showed before, not now!
    
    ...
    
    }

Related