Skip to main content
sergey3
Associate II
January 19, 2006
Question

Address for new program

  • January 19, 2006
  • 3 replies
  • 959 views
Posted on January 19, 2006 at 03:42

Address for new program

This topic has been closed for replies.

3 replies

sergey3
sergey3Author
Associate II
January 12, 2006
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 II
January 13, 2006
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
sergey3Author
Associate II
January 19, 2006
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