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.

MSP430F5342: IAR Generated checksum is not matching with Software Generated (Code) checksum.

Part Number: MSP430F5342

Hi Team,

Problem Statement: IAR Generated checksum is not matching with Software Generated (Code) checksum.

We have used the IAR (v6.40) and enabled the checksum option in IDE to generate the checksum for designated address range ( 0x8000 to 0xFFFF) for the controller MSP430F5342 by using xlink linker file (.xcl) and verifying the same using the software code for the same flash range  (0x8000 to 0xFFFF). But the IAR Generated checksum ( __checksum) is not matching with code generated CRC by using slow_crc16()  and fast_crc16() functions.

Is there any specific reason to mismatch the checksum in both conditions,   

     1. Specific settings in workspace like optimization effecting checksum calculation. ?

         2. We need to exclude interrupt vector section from checksum calculation ?

   Any body have any idea on this , it will be great helpful to us.

         

  • Here with i am attaching the linker file:

    // ************************************************
    //
    // XLINK configuration file for MSP430F5342
    //
    // Copyright 1996-2016 IAR Systems AB.
    //
    // See the file 430/doc/licenses/IARSourceLicense.txt for detailed
    // license information.
    //
    // $Revision: $
    //
    // ************************************************

    // ---------------------------------------------------------
    // Description
    //

    //
    // Usage:
    //
    // xlink [file file ...] -f lnk430f5342.xcl
    //
    // -----------------------------------------------
    // Device summary
    //

    //
    // Core: MSP430Xv2
    //
    // Interrupt vectors: 64
    //
    // Peripheral units: 00100-00FFF
    //
    // Information memory (FLASH): 01800-019FF
    //
    // Read/write memory (RAM): 01C00-043FF
    //
    // Read-only memory (FLASH): 04400-0FFFF
    // 10000-243FF
    //


    // -----------------------------------------------
    // Segments
    //

    // -------------------------------------
    // Data read/write segments (RAM)
    //

    //
    // The following segments are available for both
    // the DATA16 and DATA20 segment groups.
    //
    // segment Usage
    // ------- --------------------------
    // DATA<nn>_Z Data initialized to zero
    // DATA<nn>_I Data initialized by copying from DATA<nn>_ID
    // DATA<nn>_N Data defined using __no_init
    // DATA<nn>_HEAP The heap used by 'malloc' and 'free'
    //
    // segment Usage
    // ------- --------------------------
    // CSTACK Runtime stack
    // TLS16_I Thread-local storage for main thread
    //


    // -------------------------------------
    // Program and data read-only segments (FLASH)
    //

    //
    // The following segments are available for both
    // the DATA16 and DATA20 segment groups.
    //
    // segment Usage
    // ------- --------------------------
    // DATA<nn>_C Constant data, including string literals
    // DATA<nn>_ID Initializers for DATA<nn>_I
    //
    // segment Usage
    // ------- --------------------------
    // INFO Information memory
    // INFOA Information memory, bank A
    // INFOB Information memory, bank B
    // INFOC Information memory, bank C
    // INFOD Information memory, bank D
    // CSTART Program startup code
    // CODE Program code
    // ISR_CODE Program code for interrupt service routines
    // DIFUNCT Dynamic initialization vector used by C++
    // CHECKSUM Checksum byte(s) generated by the -J option
    // INTVEC Interrupt vectors
    // RESET The reset vector
    // TLS16_ID Thread-local initializers for main thread
    //
    // Notes:
    //
    // * The segments CSTART, ISR_CODE, and DIFUNCT, as well as the segments in
    // the DATA16 and TLS16 segment groups must be placed in in the range
    // 0000-FFFD.
    //
    // * The INFOx and INFO segments overlap, this allows data either to be
    // placed in a specific bank or anywhere in the info memory.
    //
    // * The INTVEC and RESET segments overlap. This allows an application to
    // either use the reset vector provided by the runtime library, or
    // provide a reset function by defining an interrupt function associated
    // with the reset vector.
    //


    // ---------------------------------------------------------
    // Configuation
    //

    // -----------------------------------------------
    // Stack and heap sizes
    //

    // Uncomment for command line use
    //-D_STACK_SIZE=160
    //-D_DATA16_HEAP_SIZE=160
    //-D_DATA20_HEAP_SIZE=160


    // -----------------------------------------------
    // Define cpu
    //

    -cmsp430

    // Compensate for hardware bug in CPU
    -D?CPU30_OFFSET=2


    // -----------------------------------------------
    // Support for placing functions in read/write memory
    //

    -QCODE_I=CODE_ID


    // -----------------------------------------------
    // Support for thread local storage
    //

    -QTLS16_I=TLS16_ID


    // -----------------------------------------------
    // Hardware multiplier location
    //

    -D__iar_HWMUL=4C0


    // ---------------------------------------------------------
    // Placement directives
    //

    // -----------------------------------------------
    // Information memory
    //

    -Z(CONST)INFO=1800-19FF
    -Z(CONST)INFOA=1980-19FF
    -Z(CONST)INFOB=1900-197F
    -Z(CONST)INFOC=1880-18FF
    -Z(CONST)INFOD=1800-187F


    // -----------------------------------------------
    // RAM memory
    //

    -Z(DATA)DATA16_I,DATA16_Z,DATA16_N,TLS16_I=1C00-43FF
    -Z(DATA)DATA16_HEAP+_DATA16_HEAP_SIZE
    -Z(DATA)CODE_I
    -Z(DATA)DATA20_I,DATA20_Z,DATA20_N,DATA20_HEAP+_DATA20_HEAP_SIZE
    -Z(DATA)CSTACK+_STACK_SIZE#


    // -----------------------------------------------
    // Read-only memory
    //

    // -------------------------------------
    // Low memory 0-0FFFF
    //

    // ---------------------------
    // Constant data
    //

    //-Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT=4400-FF7F
    -Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT=4400-4683
    //-Z(CONST)DATA20_C,DATA20_ID,CODE_ID=4400-FF7F,10040-243FD
    -Z(CONST)DATA20_C,DATA20_ID,CODE_ID=4400-4683
    -Z(CONST)CHECKSUM=4684


    // -------------------------------------
    // All memory 0-FFFFF
    //

    // ---------------------------
    // Code
    //
    //Leaving the FF80 - FFFF for Interrupt vectors space.
    //-Z(CODE)CSTART,ISR_CODE,CODE16=4400-FF7F
    -Z(CODE)CSTART,ISR_CODE,CODE16=4400-4683
    //-P(CODE)CODE=4400-FF7F,10000-243FD
    -P(CODE)CODE=4400-4683


    // -------------------------------------
    // Interrupt vectors
    //
    -Z(CODE)INTVEC=FF80-FFFF
    -Z(CODE)RESET=FFFE-FFFF

  • Hi,

    For question about IAR IDE tool, I would suggest you to ask on IAR web since the tool is not provided by TI. If there is any issue about the MSP430 software checksum code, please feel free to let me know.

    But you could firstly go to the IAR Linker and Library Tools Reference Guide, which could be got from IAR help menu, for more detailed configuring guide of the checksum calculator tool.

**Attention** This is a public forum