AnsweredAssumed Answered

HCS12 - How to make a read only absolute variable non initialized ?

Question asked by David Simpson on Jan 30, 2012
Latest reply on Jan 31, 2012 by David Simpson



I have a read only register defined

volatile const unsigned short pitcnt0 @0x034a;


 When I define the register as above, the linker creates an entry in hex file for that address, which is causing issues.


From the map file:

.abs_section_34a                        R      0x34A      0x34B   .absSeg148


This generates data in the hex  and abs, which I don't want.


A register not defined at const works ok:


volatile unsigned short pitld1 @0x034c;

The map file shows it as non initialized:

.abs_section_34c                   2   N/I      0x34C      0x34D   .absSeg149

I would like to define read only registers as const, to have the compile complain if I try to write to them. Any Ideas?