MPC55XX linker - how to set the location of executable code in the flash

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

MPC55XX linker - how to set the location of executable code in the flash

1,753 Views
aviad
Contributor I

hey,

I'm working on a MPC5553 with CodeWarrior 2.8.

I'm writing a boot loader, therefore i need some of

my code to run from different addresses in the flash.

i understood that the way to relocate code is through the LCF

I've tried to set different memory sections

when i compile, the map file looks ok.

but when i try to debug i can see that some functions

call to empty memory.

 

                                init                    : org = 0x00000008, len = 0x00001000

                                int_flash0      : org = 0x00001008, len = 0x00040000

                                int_flash1      : org = 0x00041008, len = 0x00120000

SECTIONS

{

                /* INIT data */

                .rcw  : { *(.rcw) } > flash_rcw

 

                GROUP :

                {

                                .init       : { *(.init) }

                                .init_vle (VLECODE) ALIGN(0x10): {

                                *(.init)

                                *(.init_vle)}

                }>init

                                /* ROM data */

                GROUP :

                {

                                .text       : {}

                                .text_vle (VLECODE) ALIGN(0x10): {

                                *(.text)

                                *(.text_vle)}

                                .flash_data : {}

                                .flash_data_vle (VLECODE) ALIGN(0x10): {}

                                .rodata  (CONST) : {

                                *(.rdata)

                                *(.rodata) }

                .ctors : {}

                .dtors : {}

/* Exception table IVPR register must align on a 16-bit boundary */

/*  RAM is from 0x4000_0000 to 0x4000_FFFF; IVPR upper 16-bits */

/*  must align to 0x4000_xxxx for internal SRAM */

/*     So "ALIGN(0x10000) has been removed from .xcptn for SRAM  */

                .xcptn                ALIGN(0x100) : {}

                .xcptn_vle  (VLECODE) ALIGN(0x100) : {}

                extabindex : {}

                extab      : {}

/* align __DATA_ROM to .data start */

                __DATA_ROM = (. + 7) & ~7;

                } > int_flash0

 

                GROUP :

                {

                                /* special_code data */

                                .special_code LOAD(ADDR(int_flash1)): {special_code.o }

                  }>int_flash1

Labels (1)
0 Kudos
Reply
2 Replies

873 Views
CrasyCat
Specialist III

Hello

Did you activate the generation of a ROM image for your application?

What did you specify as ROM image address for your bootloader?

The attached document provides some information on how to create and configure a ROM image.

There is a dedicated section around linker files with multiple flash memory areas.

I hope this helps.

CrasyCat

0 Kudos
Reply

873 Views
monalihaware
Contributor III

Hi Catherine,

i have seen your posts n i thought u could help me. I want to run my application from flash on a generic board using 8280(cw 8.8). I have always run debug version. Never tried this "ROM' version. Is this version required to dump out code in Flash. I am new to it. Can u help in this? Basically i want my application code to rum from flash.

0 Kudos
Reply