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

Uarte and ble

According to the description of S132_SDS_v5.0 on page 82, when the establishment of connection, in accordance with the BLE protocol, softdevice will be interrupted frequent send connection event, to ensure that the connection is not broken. (Each tisr (0) is greater than 10us)

In other words, if this time uart baud rate is 1M (each byte takes about 10us), which is what I need, it will lead to the loss of data, and this situation, I have two solutions:

1, DMA buffer to receive, to avoid softdevice timing-critical occupation of cpu lead to loss of bytes

2, hardware flow control, is it will make the RTS pin frequently switch level?

3, the above two cases at the same time use

Is there any other choice?

Parents
  • Hi,

    The UARTE peripheral will use EasyDMA for directly accessing RAM buffer. You can also use legacy UART peripheral on nRF52832, without EasyDMA. When using together with softdevice, I would highly recommend that you use the EasyDMA feature to avoid data loss. HWFC should also be used with such high baud rate to avoid overflow.

    Best regards,

    Jørgen

  • Thanks.

    Maybe I understand it wrong.

    In ble_app_uart, UART_RX_BUF_SIZE does not seem to work? Because it is in the interrupt (whether it is ENDRX or RXTO) just received the byte processing, and will not buffer more than 1 byte?

    Other problems, in the uart_event_handler function in app_uart_fifo.c, if the flow control event is generated and still received 4 bytes after RTS is pulled down, because FIFO_LENGTH (m_rx_fifo) <= m_rx_fifo.buf_size_mask is absolute, Implementation of nrf_drv_uart_rx (&app_uar_inst, rx_buffer, 1), then this time is not it will produce BUG? Because there are four bytes inside the RX FIFO? Here read only one.

Reply
  • Thanks.

    Maybe I understand it wrong.

    In ble_app_uart, UART_RX_BUF_SIZE does not seem to work? Because it is in the interrupt (whether it is ENDRX or RXTO) just received the byte processing, and will not buffer more than 1 byte?

    Other problems, in the uart_event_handler function in app_uart_fifo.c, if the flow control event is generated and still received 4 bytes after RTS is pulled down, because FIFO_LENGTH (m_rx_fifo) <= m_rx_fifo.buf_size_mask is absolute, Implementation of nrf_drv_uart_rx (&app_uar_inst, rx_buffer, 1), then this time is not it will produce BUG? Because there are four bytes inside the RX FIFO? Here read only one.

Children
No Data
Related