This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Multiple checksums when using linker

Other Parts Discussed in Thread: MSP430G2553

I've implemented a BSL based on the SLAA600a code and application note. I'm currently trying to have the linker add the checksum for the code to the output file (currently the .d43 file). I'm using the lnk_msp430G2553_UART_1KB_App.xcl file. I've uncommented the following lines from the checksum calculation example at the bottom of the file:

-J2,crc16,,__APP16_Checksum_Code_s,APP16_Checksum,2,#0xFFFF=(CODE)_App_Start-_App_End

-g__APP16_Checksum_Code_s

What I'm trying to do is calculate the checksum starting at _App_Start and ending at _App_End and place the result in _App_Checksum. That looks like what the command should do. However, When I check the link map what I see is the following:

***************************************** *

* CHECKSUMS *

* *****************************************

Symbol Checksum Memory Start End Initial value

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

__APP16_Checksum_Code_s 0x2b20 CODE C003 - C007 0x84cf (#0xffff)

CODE C00A - F7FF

__checksum 0x31ba CODE C000 - C001 0x0000 (#0x0000)

CODE C003 - C007

CODE C00A - F7FF

It appears that two checksums are being performed, the first on C003 to C007 and stored in C000 and the second on C00A to F7FF. CHECKSUM is located at C008 - C009. I don't understand where the address for CHECKSUM was defined, or how I can rearrange things to get the result I'm looking for. Any suggestions would be appreciated. Thanks.

Lee Thalblum

  • Hi Lee,

    You could use the CRCGen application. Since CCS doesn't have a CRC generator, I decided to remove this functionality from IAR and just use an external application for both IDEs.

    But, going back to your case, I just tried enabling these options in the linker file and I got this (which is expected):

    __APP16_Checksum_Code_s 0xe17c CODE C003 - FBFF 0x84cf (#0xffff)

    First of all, you need to enable the following option in the linker file:

    -H3FFF

    Second, your map file shows that you have a second checksum which is not enabled by this linker file, so I assume that you are enabling that in the project options.

    Check and disable the checksum in Options->Linker->Checksum

    Regards,

    Luis R

  • Hi Luis,

    I've followed your suggestions and now get a single checksum value in the right location. However, this still does not match the checksum generated by the BSL CRC algorithm (crc16MakeBitwise() ). The CRC starting value seems correct, and the memory space covered by the crc is the same. Any ideas? Thanks.

    Lee

  • Hi Lee,

    Try comparing the value with CRCGen. The examples were tested using this application and not IAR. However, I believe that IAR should generate the same results. 

    In my previous email I said that you should use -H3FFF and this is filling the whole memory with 0x3FFF (instead of the blank state of 0xFFFF). Are you taking that in consideration?

    Here are some steps I followed to test the CRC in IAR. I hope you find them useful.

    Debugging MSPBoot CRC.docx

    Regards,

    Luis R

  • I'm closing the thread but feel free to reply if you have any further comments/questions.

    LR

**Attention** This is a public forum