NUS example UART RX can't receive all data

NCS v2.7.0

peripheral_uart (nRF52832-DK)

central_uart (nRF52840-DK)

PC console -> JLink VCOM -> BLE peripheral(nRF52832-DK) -> BLE central (nRF52840-DK) -> JLink VCOM -> PC console 

1) send 240 bytes (repeat "0123456789" to form one 240 bytes packet) from PC UART in 100ms interval to peripheral_uart side, UART RX central_uart side sometimes can't receive all data in PC UART, like 

...01234567890127890123456789...

lost 4 bytes.

2) modify peripheral_uart and central_uart according to thread 

 nRF Connect SDK NUS throughput modifications and issues for peripheral_uart/central_uart example applications 

3) add 

CONFIG_UART_0_NRF_HW_ASYNC=y
CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1
according to thread
4) attached my projects for reference.

Parents
  • You did not seem to enable hardware flowcontrol (HWFC) enabled in the uart?

    It looks like one side of the uart connection is unable to handle the speed with which data comes in and there might be an overflow error in the hardware which is ignored.

    enable the hardware flow control by adding it in your .overlay file &uart0 node like  below

    &uart0 {
    	status = "okay";
    	hw-flow-control;
    };

    You need to do this for both central and peripheral and make sure that the pins are properly assigned for CTS and RTS pins for the UART.

Reply
  • You did not seem to enable hardware flowcontrol (HWFC) enabled in the uart?

    It looks like one side of the uart connection is unable to handle the speed with which data comes in and there might be an overflow error in the hardware which is ignored.

    enable the hardware flow control by adding it in your .overlay file &uart0 node like  below

    &uart0 {
    	status = "okay";
    	hw-flow-control;
    };

    You need to do this for both central and peripheral and make sure that the pins are properly assigned for CTS and RTS pins for the UART.

Children
Related