Can not using debug (NRF_LOG_INFO) when using reading large data via UARTE

Hi,
I'm developing an application using UARTE to reading response from Module Sim. The content response from Module Sim has 495 characters.
When I debug, I only read some information I logged before and after that Segger will be crashed
Here is my uarte init

NRF_LIBUARTE_ASYNC_DEFINE(libuarte1, 0, 1, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 1000, 3);
// using app timer for this uarte
NRF_LIBUARTE_ASYNC_DEFINE(libuarte2, 1, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 1000, 3);



static void uarte1_init(void) {
uint32_t err_code;
nrf_libuarte_async_config_t nrf_libuarte_async_config = {
.tx_pin = TX_PIN_NUMBER1,
.rx_pin = RX_PIN_NUMBER1,
.baudrate = NRF_UARTE_BAUDRATE_115200,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.hwfc = NRF_UARTE_HWFC_DISABLED,
.timeout_us = 100,
.int_prio = APP_IRQ_PRIORITY_LOW_MID};

err_code = nrf_libuarte_async_init(&libuarte1, &nrf_libuarte_async_config, uart_event_handler_1, (void *)&libuarte1);
APP_ERROR_CHECK(err_code);
nrf_libuarte_async_enable(&libuarte1);
}



static void uarte2_init(void) {
uint32_t err_code;
nrf_libuarte_async_config_t nrf_libuarte_async_config2 = {
.tx_pin = TX_PIN_NUMBER2,
.rx_pin = RX_PIN_NUMBER2,
.baudrate = NRF_UARTE_BAUDRATE_115200,
.parity = NRF_UARTE_PARITY_EXCLUDED,
.hwfc = NRF_UARTE_HWFC_DISABLED,
.timeout_us = 100,
.int_prio = APP_IRQ_PRIORITY_LOW_MID};

err_code = nrf_libuarte_async_init(&libuarte2, &nrf_libuarte_async_config2, uart_event_handler_2, (void *)&libuarte2);
APP_ERROR_CHECK(err_code);
nrf_libuarte_async_enable(&libuarte2);
}

 

Parents Reply Children
  • Hi, I'm using 2 libuartes to communicate with module sim and gps
    I'm using debug (NRF_LOG_INFO) to log contents I want to show. Debug Terminal showed correctly the content but for a while it stop at random line I used NRF_LOG_INFO and do nothing.
    For example I have an piece of code (I suppose it's easy to understand, because my code is quite complicated.)

    int main(){
    NRF_LOG_INFO("init example");
    for(;;){
    NRF_LOG_INFO("data from sim");
    NRF_LOG_INFO("data from GPS");
    }
    }
    
    



    Here is my debug terminal
    init example
    data from sim
    data from GPS
    
    data from sim
    data from GPS
    
    data from sim
    data from GPS
    
    data from sim
    data from GPS
    
    data from sim


    As usual, it will have to continue to print. "data from GPS", but It stop at "data from sim" and do nothing.
    I use uart terminal as well (Hercules) and my data is still send and receive, but my debug terminal stop show like at initialize steps after reset

    This issue occurs when my nRF use libuarte1 to receive file http response from module sim (475 characters).

    My debug terminal is still running but nothing else occur,

  • It looks like either (1) deadlock somewhere in the code or (2) the libuarte has not responded correctly to the incoming data

    (1) For deadlock debugging

    Can you start your application in debugger mode and start the debugger and run your application.

    Once you reach to a point where nothing happens, pause the debugger and see which instruction is being executed and the context of it. 

    (2) For checking if the data arrived but the driver misbehaved

    Connect the UART pins to an analyzer like logic analyzer and make sure that the data (475 characters or part of it) actually came from the module sim. You can check this in the logic analyzer. If it did arrive from the sim then there is something wrong in the handling of incoming data. 

    Check if the application is handling errors properly from libuarte or other devices.


  • Here is my debug terminal when it stuck. I'm new at debug so I can not read register yet. 

  • This does not look like a fault (crash), it seems your device is still responsive at the context of this snapshot. Why do you think it is crashing at this point?

  • I mean device not crashed. As I mentioned above. I am using libuarte in this application and while my debug terminal stop show info, my Serial Monitor (Hercules) is still show RX data that nRF receive from Module Sim (Device is working normally (observe Hercules, data is transfer and receive normally, but debug terminal not show any info, at like my snapshot)

Related