Creating a fixed location for bootloader code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Creating a fixed location for bootloader code

1,810 次查看
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.

标签 (1)
0 项奖励
回复
3 回复数

968 次查看
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 项奖励
回复

968 次查看
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 项奖励
回复

968 次查看
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 项奖励
回复