AnsweredAssumed Answered

fixed ROM addressing

Question asked by Robert Maier on Dec 5, 2017
Latest reply on Dec 7, 2017 by ZhangJennie

Hello,

 

I am trying to store several calibration values/tables into ROM at fixed addresses. I am using CodeWarrior on a 9S12P MCU. Right now, I am capable of defined addressing for individual constants as follows:

 

#pragma CONST_SEG PAGE_0C

volatile const UINT16 CalParameterA @ 0xC9000 = 1458;

#pragma CODE_SEG DEFAULT

 

This works just as I intend. However, with a bunch of constants, I want to add another definition where the location is sequentially located right behind the previous declaration. Some definition like:

 

#pragma CONST_SEG PAGE_0C

volatile const UINT16 CalParameterA @ 0xC9000 = 1458;

volatile const UINT16 CalParameterB = 6533;

volatile const UINT16 CalParameterC = 12;

#pragma CODE_SEG DEFAULT

Where the addressing would be:

CalParameterA      0xC9000

CalParameterB      0xC9002

CalParameterC      0xC9004

How can I best achieve this?

Outcomes