Hi,
I want to set up SCI Rx with DMA. However I don't know how many bytes to expect.
I might receive anything between [17, 270] bytes.
So, Not sure what to set the FRCNT. (One element is 8-bits. Element count is 1.)
If I set the FRCNT to max (270) and the PC App sends a packet of 145 bytes, how would DMA behave?
How would I know if Rx DMA is done since I can not check the status of Frame Transfer complete Status Flag (since 145 is less than 270). So, not sure how to figure out when SCI Rx is done.
How about checking if DMA is done by: while (dmaREG->DMASTAT & (1 << dmaChannel))
Any guidance? thanks
====
The rough scheme is: The PC app will send a packet whose size vary from 17 to 270 bytes.
firmware will receive and digest this packet and respond back to the PC app.
PC app won't send new bytes till it receives a message from the firmware.