cancel
Showing results for 
Search instead for 
Did you mean: 

Run the STM32 System bootloader from application?

gordon239955_st
Associate II
Posted on September 03, 2014 at 17:26

I've been trying to run the system bootloader from my application on an STM32F205.  I think that should b feasible, but at present the system firmware behaves badly.  Probably I'm doing something wrong, but I can't presently see what.

I can read the bootloader version OK (0x33 == V3.3) and I can see what appear to be vectors at 0x1FFF,0000 (AN2606 says 0x1FF0,0000 but I believe it's wrong).

I can pick up the second vector (reset point from 0x1FFF0004 0x1FFF3DE5) and call it as a function.

The code at that address [0x1FFF3DE5] begins executing, but after a few instructions breaks with a UsageFault_StateError.

Can anyone give an insight into what I'm missing?

Also, if anyone is familiar with this, I'm presuming I need to set up the GPIO pins as per AN2606 so the bootloader chooses the appropriate port, e.g., by setting ''don't use this'' ports to outputs and the port to use to an input(s).

Thanks.

3 REPLIES 3
gordon239955_st
Associate II
Posted on September 04, 2014 at 10:22

Oh, right!  I definitely have both of those enabled.

So my best bet is to reset the hardware as best I can, then set up the specific IO, then call the bootloader.

The assembler clip appears very helpful. I think that's doing the vital bits of the hardware reset, I'll need to add by port configs somewhere within that.

Thanks Clive.

gordon239955_st
Associate II
Posted on September 04, 2014 at 10:41

I've just followed and read the second link, which I hadn't originally as I was already aware of the address differences.  That's another very useful code clip.   My tool-set's built-in start-up code zeros RAM, and I've rather become used to that, so overlooked the option of magic numbers in RAM.