Creating a fixed location for bootloader code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Creating a fixed location for bootloader code

1,799件の閲覧回数
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 返答(返信)

957件の閲覧回数
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 件の賞賛
返信

957件の閲覧回数
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 件の賞賛
返信

957件の閲覧回数
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 件の賞賛
返信