I would like to have two applications in my STM32 flash, one is basically a boot and the other the 'main' application. I have figured out how to load each of them into different areas of flash, and after taking a memory dump everything looks like it is in the right place.
So when I do a reset it loads the boot, all the boot does at the moment is jump to the application. Debugging the boot, this all appears to work correctly. However the problems arrives after i've made the jump to the application, it just executes one instruction (assembly) and then jumps back to the boot. It should stay in the application indefinitely.
My question is then, where should I 'jump' to in the app?
It seems that there are a few potential spots, such as the interrupt vectors, the reset handler, the main function of the app. Actually I've tried all of those with no success.
Hopefully that makes sense, i'll update the question if not.
thanks for your help! Richard
Make sure you jump to an address where the LSB is 1. See this site for an explanation: https://www.embedded.com/introduction-to-arm-thumb/
You might want to search for the IAP (In-application programmer) it allows you to bootload code from the RS232 psort on the stm32. I started using and since it provides the source code, it is very simple to modify it for your purposes. basically after a reset you can code the IAP to bootload either from say address 0x08002000 or address 0x08003000. then all you have to do is set a flag in your application code then say restart and the new application will then run I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With