Skip to main content
MStra.3
Associate III
October 7, 2021
Solved

Snowball's chance of using STM32407VET with FreeRTOS, LwIP and Webserver to update the firmware?

  • October 7, 2021
  • 4 replies
  • 1020 views

I am now ready to write to flash when receiving a file upload via my webserver. However, I read that when erasing or writing to flash, flash reads are blocked. I can see this causing problems.

The LwIP_IAP example which was written for the F407 must work, but it doesn't use FreeRTOS. I can see that it would be way easier to do with a 2 Bank part such as the F429 as I intend to split the flash in half so I can run from one section and upgrade the other.

I have seen suggestions to run from RAM but that doesn't seem very practical when you have LwIP, FreeRTOS and a webserver running to upload the firmware...

Any ideas?

This topic has been closed for replies.
Best answer by Bob S

That is basically it. On the F407 you have no choice. Any write/erase FLASH operation will stall the CPU if it tries to execute code from FLASH. So either structure your code to tolerate the stall (difficult w/RTOS) or move code into RAM (also difficult 'cause hard to know WHICH functions will be called). Using a dual bank part like the F429 would work as long as you are running from bank 1 and writing to bank 2.

4 replies

Bob S
Bob SBest answer
Super User
October 7, 2021

That is basically it. On the F407 you have no choice. Any write/erase FLASH operation will stall the CPU if it tries to execute code from FLASH. So either structure your code to tolerate the stall (difficult w/RTOS) or move code into RAM (also difficult 'cause hard to know WHICH functions will be called). Using a dual bank part like the F429 would work as long as you are running from bank 1 and writing to bank 2.

waclawek.jan
Super User
October 7, 2021

Or use external memory. Serial FLASH, megabits'a'cent.

JW

MStra.3
MStra.3Author
Associate III
October 7, 2021

I really like this solution but it will mean a board spin...

TDK
October 8, 2021

Why is it a problem if the flash blocks for a while? On any piece of hardware where I've updated the firmware, it's universally accepted that it will be nonresponsive for a period of time during the update (and that you shouldn't remove power).

"If you feel a post has answered your question, please click ""Accept as Solution""."