Search code examples
stm32

How can I see what my STM32 bootloader does


I'm working with a STM32 and a CC1310 and I have 2 issues, the same ones on both. I did not write the bootloader on either one, and I don't think I'll be able to get their code.

-How can I put a file that is bigger than my memory? I guess compression, but I don't know if there is already a built in option. (I'm a bit lost by the datasheet of the STM32, it' is probably written and hidden in plain sight)

-I want to know what is the file already inside my memory to know if an update is needed, or if the file is up-to-date. I was thinking of getting the name of the file, is it possible to get it back?

PS: As I did not write the bootloader, is it possible to get access to its code somehow?


Solution

  • The STM32 has a bootloader that is accessible by setting some combination of boot pins and maybe flash option bytes.

    The details for how to activate it depend on which part you are using and are can be found in Application Note 2606.

    The source code for this is closed. ST will not give it to you but they give you all the information you need to use it in that application note and the other ones that it references.

    This bootloader is not used in many applications. People are free to write their own bootloader and the best way to find out if they did that is to ask them. How that bootloader works is limited only by the functionality of the part. You can read back the binary program from the part as long as it has not been locked, but that will not tell you how it works. If you have a few spare years you could try to reverse engineer the binary but it won't be worth it.

    It is possible to implement a bootloader that decompresses a program, but this would normally only make sense if you have a lot more RAM than you do storage. This might be the case if your board has an external RAM. The built in bootloader cannot do this.

    Otherwise if the "file" you want to access is data and not the program that you want to run, then you are best to just access it a little bit at a time, but this is wouldn't be something that a bootloader would do but rather the application.

    It isn't really possible to help you any further than this with the information that you have provioded, you need to ask the people that you got the system from.