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

[SDK10][NRF51-DK][S110] Aborting UART rx during transfer

Hi,
It is written in the nf_drv_uart.h file for nrf_drv_uart_rx_abort() that

If Easy DMA is not used event will be called from the function context. If Easy DMA is used it will be called from UART interrupt context.

What does function context mean here?
When I call the function, it executes without anything happening. Looking at the .c file, it shows that the interrupts are disabled, so how can I go about stopping uart during the transfer for nrf51?
Thanks in advance.

Regards
Lalit

Edit:
After changing parameters of uart driver, I am able to reach NRF_DRV_UART_EVT_RX_DONE event, when I call abort function. This event is reached only after the current function is completed, so I guess this is what function context means. Still it would be helpful if someone could confirm this for me.

Parents
  • Looks like there is something wrong with the documentation. nrf_drv_uart_rx_abort() will trigger the stoptx task which will lead to a RXTO event. From there it looks like the event handler is called in both cases (with or without Easy DMA). I will make an internal request to change the documentation for this function.

    Function context means the context the function was called from (f.ex. main context).

Reply
  • Looks like there is something wrong with the documentation. nrf_drv_uart_rx_abort() will trigger the stoptx task which will lead to a RXTO event. From there it looks like the event handler is called in both cases (with or without Easy DMA). I will make an internal request to change the documentation for this function.

    Function context means the context the function was called from (f.ex. main context).

Children
Related