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

UART Logging Backend hangs in nrf_bootloader_app_start

Hi Community,

I want to use the UART Logging backend in my bootloader. Whenever I want to start the actual application via nrf_bootloader_app_start(), the bootloader hangs in nrf_fprintf_buffer_flush in a while loop.

    while (m_async_mode && (m_xfer_done == false))
    {

    }

Can someone help solving this issue?

Best regards,

Nico

Parents
  • Hi Niecore, 

    NRF_LOG_FLUSH should return when the queued log data has been emptied. THis is not an issue in our DFU debug examples that uses the UART backend for logging. Are you calling NRF_LOG_FLUSH or  NRF_LOG_PROCESS from any other places in your code except main()?  Does commenting out the NRF_LOG_FLUSH call in nrf_bootloader_app_start allow you to jump to the application? 

    void nrf_bootloader_app_start(void)
    {
        uint32_t start_addr = MBR_SIZE; // Always boot from end of MBR. If a SoftDevice is present, it will boot the app.
        NRF_LOG_DEBUG("Running nrf_bootloader_app_start with address: 0x%08x", start_addr);
        uint32_t err_code;
    
        // Disable and clear interrupts
        // Notice that this disables only 'external' interrupts (positive IRQn).
        NRF_LOG_DEBUG("Disabling interrupts. NVIC->ICER[0]: 0x%x", NVIC->ICER[0]);
    
        NVIC->ICER[0]=0xFFFFFFFF;
        NVIC->ICPR[0]=0xFFFFFFFF;
    #if defined(__NRF_NVIC_ISER_COUNT) && __NRF_NVIC_ISER_COUNT == 2
        NVIC->ICER[1]=0xFFFFFFFF;
        NVIC->ICPR[1]=0xFFFFFFFF;
    #endif
    
        err_code = nrf_dfu_mbr_irq_forward_address_set();
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_ERROR("Failed running nrf_dfu_mbr_irq_forward_address_set()");
        }
    
        NRF_LOG_FLUSH();
        nrf_bootloader_app_start_final(start_addr);
    }

    Best regards

    Bjørn

  • I quick fixed my problem by setting NRF_LOG_DEFERRED to "0"

Reply Children
No Data
Related