AnsweredAssumed Answered

linker file: copy defined section from ROM to RAM

Question asked by christophe74 on Mar 5, 2014
Latest reply on Mar 12, 2014 by christophe74

I'm trying to add a section that will include calibration data stored in data flash and loaded in RAM at startup.

The firmware can modify these data in RAM and erase/program the data flash block with updated values.

 

So I created these sections in the .lcf file:

GROUP :

    {

      .calibration_dataflash : {}

   . = ALIGN (0x4000);

      .fee1_dataflash : {}

   . = ALIGN (0x4000);

      .fee2_dataflash2 : {}

   . = ALIGN (0x4000);

      .history_dataflash : {}

    } > internal_dataflash

 

__CALIB_ROM_START = ADDR(.calibration_dataflash);

 

    GROUP :

    {

      .calibration LOAD(__CALIB_ROM_START):

      {

   . = ALIGN (0x4);
   *(.calibration_data)
   . = ALIGN (0x4);
   *(.calibration_crc)
   . = ALIGN (0x8);

      }

    } > calibration_ram

 

__CALIB_RAM_START = ADDR(.calibration);

__CALIB_RAM_END = ADDR(.calibration) + SIZEOF(.calibration);

 

In my header file I defined:

#pragma section  ".calibration"

#define __CALIBRATION __declspec(section ".calibration")

 

But at compilation I have the following error:

>Linker command file output section '.calibration' has a type or input which

>is incompatible with

>section '.calibration' in file

 

I searched in many files and discussions but I haven't found the solution. Any idea ?

 

Environment: CW 10.5 for MPC5604B

Outcomes