Skip to main content
haye
Associate III
December 12, 2016
Question

Bootloader problem

  • December 12, 2016
  • 1 reply
  • 801 views
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

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    December 12, 2016
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    haye
    hayeAuthor
    Associate III
    December 13, 2016
    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.