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.

CCS/TMS570LC4357: Issue in Programming Flash using Code composer studio and F021 flash library

Part Number: TMS570LC4357

Tool/software: Code Composer Studio

Hi,

We are loading our application code on TMS570LC4357 using code composer studio for debugging the code. But when debugger mode is entered, we see that some flash locations are not erased properly i.e., the erased flash location show all random data as shown below:

We undersand that ECC is enabled by default for TMS570LC4357, but not sure how to disable or any configuraiton required in code composer studio. We haev a requiremenet to calculate the CRC of the loaded application which expectes to have unused flash locations, but due to the random data in flash CRC always fails.

We also used F021 flash libray for erasing and programming the flash through application could, but saw behaviour as mentioend above.

lease let us knwo if we are missing any configuration when using code composer studio and and required functions to call to erase FLASH properly when using F021 library.

  • Hello Srihari,

    This is caused by the wrong ECC value. When the flash is erased, its ECC space is also erased to 0xFFFFFFFF which is not correct for blank flash.

    Please use linker to generate ECC:

  • hi Wang,

    Thank you for the reply. We have gone through the wiki link and used the required


    ECC {
    algoL2R5F021 : address_mask = 0xfffffff8 /* Address Bits 31:3 */
    hamming_mask = R4 /* Use R4/R5 build in Mask */
    parity_mask = 0x0c /* Set which ECC bits are Even and Odd parity */
    mirroring = F021 /* RM57Lx and TMS570LCx are build in F021 */
    }

    MEMORY
    {
    /* ROM */
    VECTORS (X) : origin=0x00200020 length=0x00000020 vfill = 0xffffffff
    FLASH_API (RX) : origin=0x00200040 length=0x000014C0
    FLASH1 (RX) : origin=0x00200040 + 0x000014C0 length=0x00200000 - 0x40 vfill = 0xffffffff
    EEPROM (RW) : origin=0xF0200000 length=0x00020000

    /* RAM */
    STACKS (RW) : origin=0x08000000 length=0x00001C00
    RAM (RW) : origin=0x08001C00 length=0x00040000
    RAM_API (RW) : origin=0x08041C00 length=0x00008000
    SHAREDRAM (RW) : origin=0x08049C00 length=0x00001000

    EXTRAM (RW) : origin=0x64000000 length=0x100000

    /* Bank 0 ECC */
    ECC_VEC (R) : origin=(0xf0400000 + (start(VECTORS) >> 3))
    length=(size(VECTORS) >> 3)
    ECC={algorithm=algoL2R5F021, input_range=VECTORS}

    /* Bank 1 ECC */
    ECC_FLA1 (R) : origin=(0xf0400000 + (start(FLASH1) >> 3))
    length=(size(FLASH1) >> 3)
    ECC={algorithm=algoL2R5F021, input_range=FLASH1 }

    /* Bank 7 ECC */
    ECC_FLA7 (R) : origin=0xF0100000
    length=(size(EEPROM) >> 3)
    ECC={algorithm=algoL2R5F021, input_range=EEPROM }
    }

    But when tried to program the build, we were getting error as shown below:

    we also we disabled Auto ECC generation in the Flash settings before we program

    Please let us know if any furhter configuaitons are required.

  • FLASH1 (RX) : origin=0x00200040 + 0x000014C0 length=0x00200000 - 0x40 vfill = 0xffffffff

    The length of FLASH! is not correct. It should be:

     length=0x00200000 - 0x40 - 0x14c0