AnsweredAssumed Answered

HCS12x Linker Command Automatic Checksum Generation

Question asked by Zegeye Alemu on Aug 29, 2016
Latest reply on Aug 30, 2016 by Radek Sestak

Hi All,

 

I was using the Automatic Checksum Generation and realized that there could be a bug with this functionality.

My objective was to generate a checksum, CCITT method, for the whole program flash memory.

Interestingly, it seems that the linker is not generating the correcting checksum value for a section of memory if the addressing scheme is other than Local addressing.

So long as the range of memory the checksum is calculated is the same why is the calculation differing.

 

Please find below part of the linker command file entries with different addressing modes for the same block of memory.

 

The same block of memory is used as an input and the results differ.

 

The following two entries generated different checksum values:

---------------------------------------------------------------------------

// The local addressing generates a correct checksum value  -  THIS CALCULATES CORRECT VALUE

CHECKSUM
     CHECKSUM_ENTRY
        METHOD_CRC_CCITT
        OF READ_ONLY 0xC000 TO 0xFEF7 
        INTO READ_ONLY 0xFEFC SIZE 2
        UNDEFINED 0xff
     END
END

---------------------------------------------------------------------------

The following Global Addressing generates a different checksum value that is identical to a Local addressing input address.

// Input - Global Addressing          -     THIS DOES NOT GENEATE CORRECT VALUE

CHECKSUM  
     CHECKSUM_ENTRY
        METHOD_CRC_CCITT
        OF READ_ONLY 0x7FC000'G TO 0x7FFEF7'G
        INTO READ_ONLY 0xFEFC SIZE 2
        UNDEFINED 0xff
     END
END

 

 

// Input - Logical Addressing      - THIS DOES NOT GENERATE CORRECT VALUE

CHECKSUM
     CHECKSUM_ENTRY
        METHOD_CRC_CCITT
        OF READ_ONLY 0xFF8000 TO 0xFFBEF7
        INTO READ_ONLY 0xFEFC SIZE 2
        UNDEFINED 0xff
     END
END

---------------------------------------------------------------------------

 

Thank you in advance for your help.

 

Best regards,

Ziggy

Outcomes