cancel
Showing results for 
Search instead for 
Did you mean: 

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

MStra.3
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

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.

View solution in original post

4 REPLIES 4
Bob S
Principal

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.

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

JW

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

TDK
Guru

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".