KSDK v1.3 UART_DRV_Edma driver questions (k22F, FreeRTOS)

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

KSDK v1.3 UART_DRV_Edma driver questions (k22F, FreeRTOS)

455 Views
thcooke77
Contributor III

I have an interesting case where I use the non-blocking function UART_DRV_EdmaReceiveData to receive 64 bytes. What I receive can either be 64 bytes or 4bytes.

 

To deal with the 4 byte packet, I continuously call UART_DRV_EdmaGetReceiveStatus from a task. When I have received at least 4 bytes (when bytesRemaiining < 61) I check the first byte received to determine if it is a small or big packet. I have verified with a debugger that bytesRemaining will tell me that I have received at least 4 bytes.

 

So if it is a small packet I call UART_DRV_EdmaAbortReceivingData, assuming that since byteRemaining reports that I have 4 bytes, I have received my whole small packet copied to my buffer.

 

What I have found however is that sometimes the Edma will not have actually copied the last couple of bytes into my buffer even though it says it has received 4 bytes. And when I call the UART_DRV_EdmaAbortReceivingData I never actually get the bytes it reports I received.

 

I understand this is not exactly how these drivers where intended, but can anyone explain what is happening? How can UART_DRV_EdmaGetReceiveStatus report I have 4 bytes, before they were actually copied?

 

Thanks,

Terry Cooke

 

2/19/2016: I am still waiting on a response to this, does anyone have any further infromation?

Labels (1)
0 Kudos
0 Replies