Am using an mc9s12xdt256, with CodeWarrior IDE 5.9.0
I have created 'bootstrap' code that resides in $E000 to $FFFF, and am placing application
code in $4004 to $D70F, and a secondary interrupt vector table in $D710 - $D7FF. The
bootstrap checks the CRC of the application area, and compares it with a PRM-calculated
checksum at $4000, and only jumps to the app if it is correct.
The PRM file segment definitions look like:
/* non-banked FLASH */
ROM_APP_CRC = READ_ONLY 0x4000 TO 0x4001;
ROM_APP_ENTRY = READ_ONLY 0x4002 TO 0x4003;
ROM_4000 = READ_ONLY 0x4004 TO 0xD70F FILL 0x3F;
ROM_VEC_TAB = READ_ONLY 0xD710 TO 0xD7FF FILL 0x3F;
a) If I use a single checksum entry calculation, from $4004 to $D70F, everything
works fine, and I jump to the app....
b) if I use a single checksum entry calculation anywhere beyond $D70F, it fails.
c) I tried using a two-entry checksum calculation in the PRM file, but - irrespective
of the endpoint of the 2nd stages calculation - it always fails.
Have attached a sample of one of my efforts.
CHECKSUM
CHECKSUM_ENTRY
METHOD_CRC16 INIT 0xFFFF POLY 0x1021
OF READ_ONLY 0x4004 TO 0xD70F
OF READ_ONLY 0xD710 TO 0xD7F9
INTO READ_ONLY 0x4000 SIZE 2
UNDEFINED 0x3F
END
END
It seems as if the automatically calculated checksum loses its
continuity at the segment change from ROM_4000 to ROM_VEC_TAB.
Is this an accurate asdsessment, and is there possible a workaround
for it?
I'd be very grateful for any assistance in this matter.
Seb