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!
    
    ...
    
    }

Parents Reply
  • Hello:

    Thank you for your response! I have tried what you said, but when I type something while on the application side I get a "Warning: Sent 0 of 8 Bytes". It seems the RTT is not sending anything while on the application! Is there any code that must be done on the App side to make this work?

    For now I prefer this solution than the link you provided as it fits more with our current system.

    Thanks!

Children
Related