??? 11/03/06 13:00 Read: times |
#127314 - timestamp, serial number, neutral 16 bit checksum Responding to: ???'s previous message |
I like to use a timestamp (__DATE__ and __TIME__ near the end of code memory) and two 'neutral' 16 bit checksums (one at 0x0ffe, the other at 0xfffe).
'neutral' in the sense of -Big_Endian_Checksum_Negative or -Little_Endian_Checksum_Negative of the srecord.sf.net package. (XOR could probably be used too) Using checksums which add up to zero allows me to check: sum(0x0000..0x0fff) = 0 (bootloader) sum(0x1000..0xffff) = 0 (application) sum(0x0000..0xffff) = 0 (bootloader and application) Also I can serialize the device by inserting a 4 byte serial number (+2 bytes special padding) into a reserved 6 byte field within the bootloader section (without spoiling the checksum). |