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.

TMS570LS1224: Problems writing to flash

Part Number: TMS570LS1224

Hello all,

I'm working on an bootloader for a TMS570LS1224. All works fine so far. I can successfully erase flash and verify an application and start it afterwards. But now I try to add a Magic (0x5A5A5A5A) at the beginning of the application flash after verify to mark the it as valid. Therefore I left 8 bytes unused (0xFF) right at the beginning of the application and try to write the Magic there after verify. But this write fails form time to time. I guess it could be something related to the ECC bit generation. As stated in the manual the ECC bits are generated for every 64 bit written to the flash. That's the reason I left 8 bits space for the 4 byte Magic. Is it allowed to overwrite a flash portion that was previous written with 0xFF?

Any help is appreciated.

Kind regards

Jens

  • Hello Jens,

    Is the magic word located in the same flash sector as your application? I assume it is at the same sector. In bootloader, the flash sectors used for application should be erased before programming. So the first 2 words for the magic words is erased too. Those 2 locations should be 0xFFFFFFFF before writing the magic words.

    The flash API can calculate and program the ECC too.

    Fapi_issueProgrammingCommand((uint32_t *)dst,

    (uint8_t *)src,

    (uint32_t) bytes,

    0,

    0,

    Fapi_AutoEccGeneration);