0

I want to code OTA function in STM32F4 using HAL library. I already have a LTE module download upgrade binary file and forward to STM32F4 through UART. The problem is that I know I can receive binary file to RAM by using HAL_UART_Receive_DMA() and I know I can use HAL_FLASH_Program() to write data from RAM to internal flash. I do not really want to implement in this way since the RAM of STM32F4 is small. Is there any way can write directly from UART to internal flash?

Thanks

doushicai
  • 31
  • 4
  • What is the problem ? You can receive N bytes per N bytes and program every time to Flash. Can't you just setup N in order to fit in the RAM ? – Guillaume Petitjean Jul 23 '20 at 10:19
  • Hi Guillaume, my bin file is streaming to the STM32 through UART continuously until the entire bin file is transmitted. So, if I received first N bytes and stop UART to write flash, the following byte will lost during writing the flash. In other words, I cannot control the LTE module to download and forward the bin file to STM32 in separated packages. – doushicai Jul 23 '20 at 16:30
  • You don't need to stop the UART. Every time you have received N bytes (through DMA) launch a programing sequence to the Flash. In parallel the DMA will continue receiving from UART. – Guillaume Petitjean Jul 24 '20 at 09:59

0 Answers0