How to build a project that does not execute from address 0x00000000 in FLASH?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to build a project that does not execute from address 0x00000000 in FLASH?

1,384 Views
claus_schmidt
Contributor I
Hey
 
I'm using a P&E MultiLink debugger for my ColdFire project, debuggin my current project executing from address 0 in FLASH, as a normal project.
 
The thing is, that I have this Bootloader, that I would like place in the start of the FALSH.
I have tried to move the start address of the application (that the Bootloader in the end should load) in my linker file with out any luck.
  rom      (RX) : ORIGIN = 0x00007800,  LENGTH = 0x00018700
 
I would like to debug eaven though the start address is not 0.
What other changes do I have to make to my application project to make it execute.
 
 
 
Any guide lines?
Labels (1)
0 Kudos
1 Reply

334 Views
J2MEJediMaster
Specialist I
I assume the bootloader is supposed to start if the processor is reset? If that is the case, you really don't need to concern yourself with where the bootloader is in Flash. Instead, you'll insert the starting address of the bootloader code into the vector interrupt table to replace the orignal start-up code. Typically this means finding the vector table code (usually the file vector.c for Codewarrior), which looks something like this (HC12SX):
 
Code:
OSVECTAB = {    OSVECTF _dummyISR,                          /* 0xFF10:  Spurious Interrupt  */    OSVECTF 0xFFFF,                             /* 0xFF12   Reserved    */    OSVECTF 0xFFFF,                             /* 0xFF14   Reserved    */    OSVECTF 0xFFFF,                             /* 0xFF16   Reserved    */     .     .     .    OSVECTF _dummyISR,                          /* 0xFFF8:  Unimplemented instruction trap  */    OSVECTF _dummyISR,                          /* 0xFFFA:  COP failure reset               */    OSVECTF _dummyISR,                          /* 0xFFFC:  COP clock monitor fail reset    */    OSVECTF _Startup,                           /* 0xFFFE:  Reset   */};

 
Look at the last entry in this table. This is the reset interrupt vector, and it's pointing to a C function labeled Startup. Assuming the entry function for your bootloader is named StartBootLoad, you'd change that last entry to resemble:
 
Code:
    OSVECTF _StartBootLoad,                     /* 0xFFFE:  Reset   */};

 ---Tom
0 Kudos