AnsweredAssumed Answered

Newbie question on memory access and exceptions on HCS12X

Question asked by bob holder on May 14, 2011
Latest reply on May 15, 2011 by bob holder

Hi Folks,

  I am new to the HCS12x and have a question regarding memory access and exceptions. If this is FAQ my apology upfront.



CodeWarrior 5.1, target is mc9s12xdt512 and FCS.


My question:

What happens to a memory write to a variable in a C program that is const and placed in onboard flash (READ_ONLY) segment C000? Does the program continue running or will it raise an exception and halt?


When I run the program on the target hardware it seems to run ok. But when I run it under the Full Chip Simulator (FCS) the simulator halts the program at the write call with error message "Protected at XXXX".


On x86 Windows/Linux a bad write like this would cause global protection fault/segmentation fault and core dump.

Will the physical mc9s12xdt512 allow/ignore this bad write but the simulator will stop and alert me?


thank you