AnsweredAssumed Answered

How to force constants in a specific section (MPC5668G with CW10.5)

Question asked by Hugo Bouchard on Apr 22, 2016
Latest reply on Apr 25, 2016 by Hugo Bouchard

Hi,

I'm trying to create a section at a specific address in which I want to put the software version of the application so it can be read back by the bootloader. Here is what I did in the linker script (full version of script as attached file):

 

MEMORY

{

    resetvector:           org = 0x00000000,   len = 0x00000008

 

    system_cfg:            org = 0x00003000,   len = 0x00000010

    internal_flash:        org = 0x00003010,   len = 0x000FCFF0

(...)

}

 

(...)

 

.__software_version (CONST) LOAD(ADDR(.__software_version)) : {} > system_cfg

 

In my code, I have declared the software version constant as follow:

 

#pragma push

#pragma section R ".__software_version" ".__software_version"

__declspec (section ".__software_version") const uint32_t ESM_ku32NESSoftwareVersion = 0x12345678;

#pragma pop

 

In the linker setting, I put ROM Image Address and RAM Buffer Address of ROM Image at 0x00003000. It compiles with the following linker warnings:

 

"Overlap of the ROM image address of .init section with executable address of .init section."

"Overlap of the ROM image address of .text section with executable address of .text section."

 

When I look at the .sx file, I see the block at address 0x00003000 but the content is not what I expected. I should see the software version (0x12345678):

S31900003000480000697C6000A6646302007C6001247FE802A6AA

 

What am I doing wrong? Can anyone help me please?

 

Hugo

Original Attachment has been moved to: intflash.lcf.zip

Outcomes