2019-04-08 03:43 AM
Hi all,
Is the source code of the bootloader (that is used to perform application programming over serial interface) available to download?
The AN2606 says that "The bootloader is stored in the internal boot ROM memory (system memory) of STM32 devices. It is programmed by ST during production."
Best Regards,
abaldur
Solved! Go to Solution.
2019-04-08 07:58 AM
OpenBLT (linked above) is rather robust and well-known, it supports firmware uploading over the CAN bus (one of several supported interfaces). It has its own command line tools in the "Host" directory for working with the bootloader ("Target" directory).
2019-04-08 03:51 AM
No, but if you are curious you should be able to read it from the system memory and disassemble/decompile it.
2019-04-08 06:24 AM
Thx for the reply.
Well, I'm sure that is possible, but that really seems like a lot of work.
I would have hoped it was freely available to be read, modified and recompiled if necessary.
/ abaldur
2019-04-08 06:50 AM
You cannot modify the built-in botloader in any case, because it is in write-once memory. But you can find examples of bootloaders on github and modify as you want, This goes into the user's flash memory of the MCU.
-- pa
2019-04-08 07:10 AM
I see. Do you know of any popular bootloader projects out there or do the majority stick to the build-in variant?
/ abaldur
2019-04-08 07:20 AM
The build-it variant is very simple, no encryption, no signature validation, it is generally used for the first-time flashing. If you want a robust bootloader you should use a custom one, I think.
There are many free bootloader projects in Github that you can use as a base:
https://github.com/akospasztor/stm32-bootloader
2019-04-08 07:31 AM
Thx for the links. Looks interesting.
In my case, I have a CAN bus with many nodes where quite often all the nodes needs to be updated (as we do a lot of development). Do you know of any bootloaders that are specifically suitable for this? It's quite tricky to make a robust update system for this. Many things can happen during the update process, for instance a node fails at some random place and you have to recover with a lot of uncertainty.
Would love to use already tested command-line tools for this if they already exist.
/ abaldur
2019-04-08 07:58 AM
OpenBLT (linked above) is rather robust and well-known, it supports firmware uploading over the CAN bus (one of several supported interfaces). It has its own command line tools in the "Host" directory for working with the bootloader ("Target" directory).
2019-04-08 08:11 AM
Great, sounds pretty much like the tool that I'm looking for.
Do you know how well it deals with updating a "fleet" of devices that shares the same bus, like on a CAN bus? I guess its my job to broadcast a command to all the nodes to make them enter bootloader mode, but is the rest taken care of by the bootloader? I mean the logic necessary to update one board at a time and so forth.
/ abaldur
2019-04-08 08:23 AM
No idea, I have never used it. Please check its FAQ and wiki pages, maybe you'll find the information you are interested in. Even if MicroBoot and BootCommander (their GUI and CLI flashing tools) don't support what you want you may be able to write a custom tool using their LibOpenBLT library.