AnsweredAssumed Answered

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

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


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:




    resetvector:           org = 0x00000000,   len = 0x00000008


    system_cfg:            org = 0x00003000,   len = 0x00000010

    internal_flash:        org = 0x00003010,   len = 0x000FCFF0







    .__software_version (CONST) : {}

} > 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;

#pragma pop


In the linker setting, I put ROM Image Address and RAM Buffer Address of ROM Image at 0x00003010 but the code won't boot. It get stuck in __init_data function. I've also tried to put 0x00003000 but it doesn't even reach the __start function and I get warnings at compilation on ROM image address overlapping other sections.


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