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.

TMS570LS3137:Flash Write Issue

Part Number: TMS570LS3137


Hello to everyone, I'm new to the TMS570 family. I am currently working with TMS570 to write data to flash memory and delete data from flash memory using F021 FlashAPI.

When I use the Fapi_issueProgrammingCommand() function, the data is written to flash memory, but the program stops and gets stuck in prefetchEntry. Also ERR led is enabled. When I erase data from flash memory everything is OK. 

for example;

1) I erased data from flash memory then again write data to flash memory using  Fapi_issueProgrammingCommand() function ERR led is enabled and the program stucks.

2) I just write data to flash memory then ERR led is enabled and the program stucks again.

According to what I read from the forum, in this case it was necessary to look at IFA with IFSR. I realized that IFA = 0x08000018 and IFSR = 0x00000409.

Does it mean there is an ECC error?? If yes how can I solve this problem??

thanks for your reply.

  • Hello,

    IFSR = 0x00000409 means you have ECC error. Did you enable the ECC calculation when programming data to flash? Is there flash read operation after the data is written to flash?

    Please check ESM status registers which error flash is set.

  • First of all, when I try to write data to flash memory with Fapi_issueProgrammingCommand () function, the program gets stuck in that line. If I want to read later, the program doesn't come to that line.

    If I read while there is no data in the sector, the data comes in correctly. But (as I mentioned in the previous post, the program writes the data to the flash even if it is stuck in the Fapi_issueProgrammingCommand () function), when I try to read the deletion of the flash sector I wrote the data in my next program compilation, the program gets stuck in the sector determination function before it comes to the Fapi_issueProgrammingCommand () function.

    I unchecked the Auto ECC Calculation setting from the Flash setting. But in the Linker file I have set the ECC region and wrote the Fapi_issueProgrammingCommand (....., ...., ......, ......., Fapi_AutoEccCalculation) parameter. Is not enough for auto ECC calculation?

    Another question I want to ask;

    All I said is that FlashAPI works while in the flash region. Do I have to copy FlashAPI to SRAM zone in TMS570? If yes, is it normal for me to do the reading and erasing without doing this?,

    thanks for reply..

  • Hello,

    huseyin koc said:

    I unchecked the Auto ECC Calculation setting from the Flash setting. But in the Linker file I have set the ECC region and wrote the Fapi_issueProgrammingCommand (....., ...., ......, ......., Fapi_AutoEccCalculation) parameter. Is not enough for auto ECC calculation?

    Can you explain more?

    TMS570LS3137 has 2 flash banks. If your code is in bank 0, and you want to erase bank 1 and write data to bank 1, you don't have to execute the code from SRAM. If you want to erase sectors in bank 0 and write data to sectors in bank 0, you have to copy the Flash API related code to SRAM and execute those code from SRAM.