nrf_log_backend_uart error 11

MCU : nrf52840

SDK :  sdk_17.1.0

Hello, we are developing a product using the nRF52840.

However, we have observed that while the nrf_log_backend_uart~ function is operating, it returns error code 11, causing the device to reset.

Our device uses the following two UARTs:

  • backend_uart: for logging
  • jig_uart: for communication with the test jig

The jig_uart operates only during production and is implemented as a separate task (uartTask).

We confirmed that changing the idle_state_handle function in uartTask to the sub_idle_state_handle below resolved the device reset issue:

void idle_state_handle(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_lesc_request_handler();
    APP_ERROR_CHECK(err_code);

    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}

void sub_idle_state_handle(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_lesc_request_handler();
    APP_ERROR_CHECK(err_code);

    nrf_pwr_mgmt_run();
}

In conclusion, we suspect that the NRF_LOG_PROCESS() in idle_state_handle could be causing a problem when used in parallel in two different tasks. However, we haven't found any mention of this anywhere, so we're reaching out to inquire.

Could the NRF_LOG_PROCESS() function cause error code 11 when used in two different tasks? Thank you.

Parents
  • Hello,

    I assume the error is 0x11==17=NRF_ERROR_BUSY?  NRF_LOG_PROCESS() should only be called from the main context. Otherwise, there's a risk of the UART send function being called again while it's still sending data, which will result in a busy error. If you need logs to be processed in place, you can disable the NRF_LOG_DEFERRED symbol in sdk_config.h and remove the NRF_LOG_PROCESS() calls.

    Best regards,

    Vidar

Reply
  • Hello,

    I assume the error is 0x11==17=NRF_ERROR_BUSY?  NRF_LOG_PROCESS() should only be called from the main context. Otherwise, there's a risk of the UART send function being called again while it's still sending data, which will result in a busy error. If you need logs to be processed in place, you can disable the NRF_LOG_DEFERRED symbol in sdk_config.h and remove the NRF_LOG_PROCESS() calls.

    Best regards,

    Vidar

Children
No Data
Related