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.

DSP 6727 code checksum mismatch after bootloaded using SPI Slave

Hi, I have a problem with the code checksum mismatch.

16 bits unsigned code checksum is calculated  by summing the following sections in unsigned 16 bits. The sections are .text, .const, .cinit, .switch, .pinit. The checksum value is stored in a memory declared by #pragma DATA_SECTION.

The code checksum is calculated same every time if the .out file is loaded through emulator. However, .bin file converted from the same .out file loaded through SPI boot loader will flag the code checksum mismatch failure.

I do not know why. But the code is running absolutely fine.

Any thought?

Honghui Qi   

  • Hi Honghui,

    The code checksum is calculated same every time if the .out file is loaded through emulator. However, .bin file converted from the same .out file loaded through SPI boot loader will flag the code checksum mismatch failure.

    If you want to boot with some checksum verify (magic number) then please refer to the starterware bootloader project example code.

    C6748_StarterWare_1_20_04_01/bootloader/src/


    Please elaborate a bit on your problem/question.

  • Hi, Titusrathinaraj,

    I developed the software in CCSV5 environment through emulator. I wrote a function to calculate the 16 bits checksum by summing .text, .const, .cinit, .switch, .pinit sections. the address and length for each section can be found from the .map file

    unsigned short  checksumCal (unsigned short * ptr, int size)  // size in no. of bytes

    {

    int k;

    unsigned short cksum = 0;

    for(k = 0; k < (size >> 1); k+=1)

    cksum += ptr[k];

    return cksum;

    }

    const unsigned short CKSUM = 0x5B5E;

    #pragma DATA_SECTION (CKSUM, 'CodeCksumData")

    unsigned short codecksum;

    codecksum = checksumCal ((unsigned short*) 0x1000a400, (0x13840+0x2b3e));

    codecksum+=checksumCal ((unsigned short*) 0x10020780, (0xfb4+0x5c+0x8));

    the codecksum value is 0x5B5E

    This is what the codecksum value displayed in the watch window. I power cycled and load the .out file through the emulator and rerun the code. the same codecksum value is obtained and code checksum mismatch flag is cleared.

    Now convert the .out file into .bin by TI's boot utility using SPI slave method. After loading .bin using our bootloader into unit, the code checksum mismatch flag is set. Except this mismatch flag, all others look normal to me, so other parts of code are running normally.

    Also I have tried other ways to store the CKSUM value, but all failed.

    how to access the example code you mentioned in your reply?

    Thanks

    Honghui