2024-10-10 04:07 AM
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!
2024-10-10 04:14 AM - edited 2024-10-10 04:30 AM
@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?
2024-10-10 04:33 AM
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
2024-10-10 05:31 AM
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.
2024-10-10 05:35 AM
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!