2020-08-29 07:24 AM
Hi there !
I use uart with DMA for receive data from (right now) pc and STM32F051 discovery board, everythingh work bettere if i send all data, but if i send less data stop the work . Let me explain i need the send 180 bytes from pc to discovery board , i know i can have two interrupt one for HC (half comunication)e the other for TC(total comunications) but if i send 4 byte i diden't receive any interrupt, but the problem is the pointer of the counter don't start from 0 to put the data inside the buffer (configurarte in circular mode) but start from the 5 position. Some one have any idea how i can fix this problem ?
Thank you soo much
Sergio
2020-08-29 07:46 AM
HAL_UART_Receive_DMA requires a fixed length to receive. If yours is variable, you can abort the transfer and restart it. Or if you're in circular mode, just treat the buffer as a FIFO and pop/process bytes as they come in.
2020-08-29 07:55 AM
Thanks for your fast replace , my data have all the same size , i send 4 byte just for simulate if there is one rx error and how i can fixed