Blocking in Lpuart_Uart_Ip_AbortReceivingData until timeout

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Blocking in Lpuart_Uart_Ip_AbortReceivingData until timeout

545 Views
xudequn
Contributor II
issue: 
Blocking in Lpuart_Uart_Ip_AbortReceivingData until timeout.
 
driver version information:
*   Autosar Version      : 4.7.0
*   Autosar Revision     : ASR_REL_4_7_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 3.0.0
*   Build Version        : S32K3_RTD_3_0_0_P01_D2303_ASR_REL_4_7_REV_0000_20230331
 
detail:
I use DMA on Uart Receiving by calling Lpuart_Uart_Ip_AsyncReceive .
And I want stop receiving when micon goes to sleep.
So I call Lpuart_Uart_Ip_AbortReceivingData.
But the API is blocked until timeout.
Blocking location:
Lpuart_Uart_Ip_AbortReceivingData 
-> Lpuart_Uart_Ip_CompleteReceiveUsingDma
-> 
while (!Lpuart_Uart_Ip_GetStatusFlag(Base, LPUART_UART_IP_DATA_REG_FULL) && \
!Lpuart_Uart_Ip_CheckTimeout(&StartTime, &ElapsedTicks, TimeoutTicks, LPUART_UART_IP_TIMEOUT_TYPE))
It seems to be waiting for the DMA receiving completing, 
but the DMA receiving has been disabled before this action.
 
How can I resolve this problem?
0 Kudos
Reply
2 Replies

519 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what kind of timeout method is used in your code? For default OSIF_COUNTER_DUMMY a function Lpuart_Uart_Ip_CheckTimeout returns TRUE immediately and so while should break timeout occur.
Are you able to measure real RX signal and add some GPIO to know when abort is requested and leaves function?

BR, Petr

0 Kudos
Reply

509 Views
xudequn
Contributor II

Yes,we use OSIF_COUNTER_DUMMY as the timeout check function,and leave the timeout value 1000000(default).
We have already added a pit timer to measure the sys time in millisecond.
when we read the the sys time before and after Lpuart_Uart_Ip_AbortReceivingData.
We figure out that about 1300ms was blocked.

Before calling Lpuart_Uart_Ip_AbortReceivingData,we have already turned off the uart communication target.
And there won't have any Rx signal.

0 Kudos
Reply