cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a custom bootloader that can read an external eeprom memory and write the hex file to the flash memory

rodrigoruiz1230
Associate

 Hi community, I´m using an STM32F411RE with which I plan to create a custom bootloader with specific functions located on sector 7 of flash memory. These functions will read the data stored in an external EEPROM that contains a .hex file, which should then be read and written to address sector 0 of the flash memory. Once this is completed, the new program will be executed. (Perhaps it may be better to switch up the sectors?)

In other words, the idea is to update the STM32 firmware whenever there is a new update by querying a webpage, which will then respond to the STM32 and send the .hex file to be stored in the external EEPROM. The STM32 will enter bootloader mode once all data has been sent, load the new firmware into the flash memory, and execute the new program. I’ve attached an image to reinforce the idea.

 

WhatsApp Image 2025-01-11 at 1.05.32 PM.jpeg

1 REPLY 1

Ok, and what's stopping you in doing this?

Perhaps break this down and implement the pieces, the read/write of the internal flash, the read/write of the EEPROM. Look at how you want to transfer the data, over serial, common protocols like X/Y-Modem, something with it's own flow control and error checking etc.

I'd probably use sector zero as the boot, as that's where the MCU expects to find the first code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..