2020-01-10 05:02 AM
I am trying to get STM32 to set it self bootloader mode.
One processor that I am trying to do it with is stm32f070rb and the second is stm32f070x6.
I send command to each of them, and in their program I set RX Callback to handle this command.
here is example callback handle:
stm32f070rb jump_to_bootloader function:
stm32f070x6 jump_to_bootloader function:
very weird thig is that stm32f070rb processor usualy set it self to bootloader mode, but sometimes it doesn't. But on stm32f070x6 processor it doesn't work at all.
Any idia why doesn't it work?
2020-01-10 06:11 AM
Shouldn't be calling from interrupt/callback context, that is for sure.
Disabling the processor interrupts, also a bad plan. Identify where they get enabled again.
Some STM32 don't allow for this if a valid image is seen in User Flash.
2020-01-10 12:27 PM
why is that? I thought that disabling interupts is a must to jump to bootloader.
I did it with the use of https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/ tutorial and there the author says that you have to do it. I also got tip from one guy from the group that I have to "Clear pending interrupts". Gonna check it on monday and give you an update!
2020-01-10 02:26 PM
Here (in my post) is a much better and easier approach:
2020-01-10 03:00 PM
Would explain why that code keeps showing up...
Clearing or stopping interrupt that you are firing is one thing, arbitrarily disabling on the whole processor needs undoing at some point.
Identify where they get enabled again.
2020-01-11 12:58 AM
why would I want to do that?
If I set processor to bootloader, uptade the program that is on it, and reset manualy the procesor doesn't interupts start again?