Creating a fixed location for bootloader code

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

Creating a fixed location for bootloader code

1,141 Views
tminnich
Contributor I

I have a bootloader that works well and I would like my MCF51QE128 project (linker control file?) to formally place the function  (void)Boatload_Main(void) at a fixed location. While I am unlikely to move or modify the code I would prefer to have it explicitly tied to a given location.

 

regards Tom M.

Labels (1)
0 Kudos
3 Replies

299 Views
tminnich
Contributor I

I have found a bug in the bootloader and now must modify the code. The entry point of the code

 void BootloaderMain(void) must not change.  I have tried a few  linker control file directives OBJECT, ALIGN  and updates to the location counter, without the result I am looking for.

 

I suppose I could force the function into its own memory segment, but I'd like to use the tools they way they are intended ( with the least brute force).

 

regards Tom M

0 Kudos

299 Views
CrasyCat
Specialist III

Hello

 

In order to allocate a function at an absolute address you need to place it in a user defined section and specify where you want to allocate that code in the .lcf file.

 

That is the only way to achieve that with a function.

 

CrasyCat

0 Kudos

299 Views
J2MEJediMaster
Specialist I

Check out FAQ-27631. While it discusses how to locate constants at specific addresses in flash memory, the technique might be useful for what you are trying to do.

 

---Tom

0 Kudos