cancel
Showing results for 
Search instead for 
Did you mean: 

Alternatives to Flash Memory for Bootloader Storage on STM32F103

suraj_sonawane02
Associate II

Hello,

I’m designing a custom bootloader for the STM32F103 series, and I’m looking for alternative memory regions to store the bootloader instead of using Flash memory.

The reason I don’t want to use Flash memory (starting at 0x08000000) is that I want to allocate the entire Flash space for the user's application code. This way, we avoid the need to modify the linker file each time we flash new application code using Cube IDE.

I’ve considered using SRAM, but since it’s volatile, I’m not sure if it’s a reliable solution for bootloader storage. Are there any other memory options or techniques I can explore to store and execute the bootloader reliably?

You can also suggest me a diff board / series than STM32F103.

Thanks in advance for your advice!

4 REPLIES 4
Andrew Neil
Evangelist III

@suraj_sonawane02 wrote:

I’ve considered using SRAM, but since it’s volatile, I’m not sure if it’s a reliable solution for bootloader storage.


Exactly: it's volatile, so the bootloader would have to be re-loaded after each power cycle!

For a custom bootloader, it has to be in the Flash.

But why does it have to be a custom bootloader - can't you use the built-in System bootloader?

https://www.st.com/resource/en/application_note/an2606-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

There isn't a good alternative. Even those MCU supporting external memory need you to bring up the pins and peripherals unique to your board implementation. 

Bite the bullet and modify the Linker and code to address the reality of the situation.

I'd recommend modifications to SystemInit() to use symbols to assign SCB->VTOR so it just follows the build settings without having to continually having to modify files.

Learn to use merge tools, or copy files. Create some templates so you can fix new projects more quickly/efficiently. Perhaps with code to report Hard Faults more effectively, etc

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

Thanks for the suggestion!

I’m designing a custom bootloader as a project to explore the bootloader part in more depth. That’s why I’m not using the built-in System bootloader for this.

Thanks for the advice! I’ll go ahead with modifying the linker script and look into automating SystemInit() with SCB->VTOR to avoid constant file changes. I’ll also explore using templates and merge tools to speed up future projects. Appreciate the recommendations!