cancel
Showing results for 
Search instead for 
Did you mean: 

Bootloader problem

haye
Associate II
Posted on December 12, 2016 at 15:45

Hello everyone,

I am trying to developp a bootloader but I got some issues, My application is working well.

With my bootloader I read an usb key and program the content of the hex file into the flash (this step work).

The entry point of the application is the adress 0x0800BA00.

When my application is writed in flash, I set the vector register (SCB->VTOR = (uint32_t)0x0800BA00)

Then I tried to jump to the app :

JumpAddress = *(__IO uint32_t*) (0X0800BA04);

JumpToApplication = (pFunction) JumpAddress;                   

__set_MSP(*(__IO uint32_t*) 0X0800BA00);

 JumpToApplication();

Unfortunately this doesn't work.

Idon't know if I've forget some steps or what could be wrong ? Do you have any ideas ?

Thank you !

Dorian

3 REPLIES 3
Posted on December 12, 2016 at 16:55

Can you step into and through the code in a debugger and see where it goes? That 'it doesn't work' doesn't convey much information about what does happen, and why.

The code needs to be built (linked) to use the address you choose.

What STM32 part are you using? The make hundreds, and they can be quite different.

Please review threads describing near identical symptoms.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 13, 2016 at 10:22

Hi Clive !

Thank you for your answer.

i have write some thread on the subject but couldn't find an answer to my issue.

If I go into the code through the debugger stopping at the jump instruction I got this assembly code

BLX R3 (R15 <= 803C76CH)

R15 is the Program counter and normally my jump should go to the adress I specified. I don't understand well why this wrong adress (803C76C) is taken.

My application linker is writted to start at the address i specified (0800BA00).

I am using a STM32F205VE.

Thank you for your time.

Posted on December 15, 2016 at 11:29

Well !

After investigation, I'm able to boot on a simple blink application.

But as soon as I enable the IT the app crash (but work without the bootloader).

Probably the IT vector table isn't well readress.

Do you have any idea of the origin of the problem ?

Thank you !