cancel
Showing results for 
Search instead for 
Did you mean: 

Address for new program

sergey3
Associate II
Posted on January 19, 2006 at 03:42

Address for new program

3 REPLIES 3
sergey3
Associate II
Posted on January 12, 2006 at 14:02

How can I define empty function to specify address for new program ? I have written a simple bootloader (IAP).

my ''main.c'' file:

void main(void)

{

...

IO_Init(); //General initialization

...

while(1) Loop();

}

// and function Loop() :

#pragma section (Loop)

void Loop(void)

{

//Nothing at first reset

}

Can I write in the linker file something like this ? :

+seg .Loop -b 0x1000

Is it right?

luca239955_st
Associate III
Posted on January 13, 2006 at 05:22

Hi,

yes, the general idea of redirecting compiler output to a specific section and then place this section at the address you want in the linker is correct.

Regards,

Luca (Cosmic)

sergey3
Associate II
Posted on January 19, 2006 at 03:42

Hi Luca!

Can I do just something like this (if I want to put function ''LOOP'' at beginning of sector2(0x1000 to 0xE000) ?:

(Metrowerks Codewarrior, HIWARE compiler,

st72f561)

My linker.prm file:

NAMES END

SECTIONS

..

MY_ROM2 = READ_ONLY 0x1000 TO 0xDFFF; // sector 2

..

END

PLACEMENT

..

LOOP INTO MY_ROM2;

..

END

Regards,

Sergey