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

It hang in ble_app_uart + libuarte

Hello,

I'm developing a BLE device and it consist of nRF52833 and a external UART component.

ble_app_uart example in SDK v17.0.0 is replaced app_uart to libuarte. The UART component is sent a variable length data to nRF52833. Normally, it send 384 or 512 bytes per second.  sometimes it send 2048 bytes, but nRF52833 go to hang.  I enabled log options - NRF_LIBUARTE_CONFIG_LOG_ENABLED and NRF_BALLOC_CONFIG_LOG_ENABLED.

This is a initialization parameter for libuarte.

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 1, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 9);
    
    nrf_libuarte_async_config_t nrf_libuarte_async_config = {
            .tx_pin     = TX_PIN_NUMBER, //TX_PIN_NUMBER,
            .rx_pin     = RX_PIN_NUMBER, //RX_PIN_NUMBER,
            .baudrate   = NRF_UARTE_BAUDRATE_115200,
            .parity     = NRF_UARTE_PARITY_EXCLUDED,
            .hwfc       = NRF_UARTE_HWFC_DISABLED,
            .timeout_us = 100,
            .int_prio   = APP_IRQ_PRIORITY_MID
    };

The data size is 2048 bytes. but it is not done to receive. No more progress.

00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:255, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=66 80
00> 
00> <debug> libUARTE_async: (evt) RX: 223 (addr:0x20003AB0, internal index: 32)
00> 
00> <debug> app: >> RX Buf:0x20003AD0 Len:223
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003AB0, 223, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003CB0), Provided buffer:0x20003AB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:510, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003BB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003BB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003BB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003AB0), Provided buffer:0x20003BB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:765, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003CB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003CB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003CB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003BB0), Provided buffer:0x20003CB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:1020, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003AB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003AB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003AB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003CB0), Provided buffer:0x20003AB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:1275, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003BB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003BB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003BB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003AB0), Provided buffer:0x20003BB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:1530, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003CB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003CB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003CB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003BB0), Provided buffer:0x20003CB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:1785, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003AB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003AB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003AB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA
00> 
00> <debug> libUARTE: RX buf response (mp_next_rx not NULL:0x20003CB0), Provided buffer:0x20003AB0
00> 
00> <debug> libUARTE: (evt) RX dma_cnt:255, endrx_cnt:2040, stop_cnt:0
00> 
00> <debug> libUARTE: RX END chunk0:255, chunk1:0, data[0]=0 0
00> 
00> <debug> libUARTE_async: (evt) RX: 255 (addr:0x20003BB0, internal index: 0)
00> 
00> <debug> app: >> RX Buf:0x20003BB0 Len:255
00> 
00> <info> libUARTE_async: Freeing full buffer 0x20003BB0, 255, (currently allocated:2).
00> 
00> <debug> app: END RXDATA

Please somebody help !!

Regards,

HyunSuk Lee

Parents
  • I would recommend you to use HWFC at that high baudrates. Also check in your application registered event handler that you get some error (NRF_LIBUARTE_DRV_EVT_ERROR) without HWFC. If you do, you most likely need to flush UART fifos on both ends and restart the transmission. That is why HWFC makes it simple and reduces such errors a lot.

  • Hello,

    There is no occured NRF_LIBUARTE_DRV_EVT_ERROR without HWFC. And it is enough to RX Buffers.  When it occurs this, LED of the connected status is still ON. but the BLE connection is broken.  The RTT Viewer is not dump message any more, There is all of the log messages in the previous text.  I don't know what nRF52833 is doing, I want to know how to debugging it.

    The external UART Device is not supported HWFC.  

  • Sorry for the late reply. I was on holidays and Happy New Year. 

    HyunSuk said:
    When it occurs this, LED of the connected status is still ON. but the BLE connection is broken. 

     It is not clear to me if the "hang" you mention and the BLE disconnect that happens is caused by the libuarte library? What happens if you send only 100 bytes every second from the peer and what happens if you do not send any data on UARTE? It is possible that the BLE discconect is caused by something else (I say this since you do not see any NRF_LIBUARTE_DRV_EVT_ERROR )

  • Hi,

    It must have occurred if it runs over 40 hours with RTT viewer and a SWD interface.  It makes to worse the PC status.

    It worked during 140 hours without RTT viewer and a SWD interface.

    I don't know what is cause.  Please give me a advice.

Reply Children
Related