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

Received length (UART + EasyDMA)

I would like to implement UARTE.

· Nrf 52
· SDK15
· S 132

The big advantage of EasyDMA is that it does not issue interrupts for each byte received.
In nrf 51, "app_uart_get" was done for each "APP_UART_DATA_READY" in the prepared buffer.
If you do not issue an interrupt for each received byte, how do you recognize the currently received length?

Parents
  • Hello,

     

    I can really recommend reading through this page about UARTE.

     

    When you are using the UART with EasyDMA, your application will only receive an interrupt when the RX buffer is filled. The UARTE peripheral will keep track of the number of received bytes, but it doesn't require the CPU in order to do this.

     

    In the case when the buffer will always be filled, this is quite easy to use. However, if the RX buffer is not filled, and the other device has stopped sending data, you can use a timer to end the RX operation by triggering the STOPRX task. This is described in the section beneath Figure 3.

     

    It also explains that you can read the number of received bytes from the register RXD.AMOUNT.

     

    Best regards,

    Edvin

  • Edvin, Thank you for your reply.

    I want to confirm the following.

    There is no example about EasyDMA in nRF5_SDK_15.0.0.
    Do you agree with this recognition?
    This recognition is the conclusion of searching the question of the other person.

    I am looking at the example below.
    · NRF5_SDK_15.0.0_a53641a \ examples \ peripheral \ uart
    · NRF5_SDK_15.0.0_a53641a \ examples \ ble_central \ ble_app_uart_c

    These examples seem to distinguish EasyDMA by #define.
    Are these examples really using EasyDMA?

  • Hello,

    Actually, the examples\ble_app_uart  (not ble_app_uart_c, as far as I can tell) uses UART with EasyDMA.

    You can see in the file called apply_old_config.h file in the ble_app_uart example, that it redefines some of the defines from sdk_config. If you try to set a breakpoint in nrfx_uarte.c, e.g. in nrfx_uarte_init() or nrfx_uarte_tx() you will see that it stops there, so this example uses the uarte driver.

     

    Best regards,

    Edvin

Reply
  • Hello,

    Actually, the examples\ble_app_uart  (not ble_app_uart_c, as far as I can tell) uses UART with EasyDMA.

    You can see in the file called apply_old_config.h file in the ble_app_uart example, that it redefines some of the defines from sdk_config. If you try to set a breakpoint in nrfx_uarte.c, e.g. in nrfx_uarte_init() or nrfx_uarte_tx() you will see that it stops there, so this example uses the uarte driver.

     

    Best regards,

    Edvin

Children
No Data
Related