This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bootloader implementation on cortex-m3

Note: This was originally posted on 21st February 2012 at http://forums.arm.com

Hey, I'm working on a project on a Atmel's SAM3S4C, and I started to create a seperate bootloader for it.
The bootloader is a seperate project in IAR.
I'm sucessfully flushing the application code into the internal flash, however, when I try to jump to the application from the bootloader, using the Vector interrupt table re-allocation, the code just won't start.

The bootloader is placed at 0x00400000 - 0x00401FFF
and it's vector table is at 0x00400000.
The application is located at 0x00402000 - 0x0043FFFF
and it's vector table is at 0x00402000

This is the code for jumping to the application from the bootloader is:


Code:
int * address = ( int * ) 0x00402004; //pointer to reset handler of application
__set_MSP ( * ( int * ) 0x00402000 ); //set the stack pointer to that of the application

* ( int * ) 0xE000ED08 = 0x00402000; // VTOR: set the vector table to that of the app

( ( void ( * ) () ) ( *address ) ) (); // pointer recast as function pointer and the dereferenced/called

    while ( 1 )[/size]
        { }; //you application was never executed




can anyone help me with this ?
0