Showing results for 
Search instead for 
Did you mean: 

Receive large size text file through UART Interrupt



 I need to receive approximately 300kb size text file through UART interrupt mode in Nucleo H7 board. But only 65535 bytes are received. i used HAL_UART_Receive_IT for this.

Pavel A.
Evangelist III

This is because the size argument of HAL_UART_Receive_IT is 16-bit

Receiving 300 KB of data in one HAL_UART_Receive_IT call is unusual. This is why no one else noticed this limitation ))



Is there any other methods to send the text files completely using UART interrupt

You can use XMODEM (or YMODEM or ZMODEM) protocols to break the file into smaller manageable chunks.  ST has example ymodem code (a very minimal implementation) in some of their app notes.  Search for "ymodem" to find them.  Or any of the open source versions.

If you can't do that you best bet is to use circular DMA to continuously receive data and then poll the receive buffer to pull out data as it comes in. @Tilen MAJERLE has code for this on his github site


What is sending this text file? What are you doing with this text file? Are you saving it all to RAM or to external memory?