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.

TMS570LC4357: Data-abort during Fapi_initializeFlashBanks

Part Number: TMS570LC4357

I did not see anything like this specific issue in the E2E. 

I am trying to use the Flash API (2.01) to use for user-configuration storage in flash, which only partially works. On boot-up, I am enable to erase the flash, and write in the default values; however, during run-time, if I attempt to erase the flash and program new values, I get a data-abort. The abort consistently occurs after the second-erase and within the Fapi_initializeFlashBanks prior to programming.

My code adheres to the flowcharts shown in F021 API Vers2_01 spnu501h.pdf, and I also tried adding in a Fapi_enableAutoEccCalculation, but that had no effect. All of my Fapi calls return Fapi_Status_Success and the initial flash writes appear to be good data, but I could not find the associated ECC values for a flash-write to 0x00200000(Flash1). I am also calling Fapi_issueProgrammingCommand with 8 bytes of data at a time (tried 16) with an argument of Fapi_AutoEccGeneration.

I suspect this is an ECC issue, but I don't know how to confirm that -- is there a status register that indicates a flash-ECC error occurred?

Also do you have sample Flash-API code that fits/integrates within the HalCoGen-generated code?

Thanks,
Jim

  • Hi Jim,

    The ECC of data at 0x200000 is located at 0xF0440000. 

    On boot-up, you can erase/program the flash using the F021 flash APIs. Does it mean you erase/program the flash in _c_int00_()? 

    I erase/program the flash twice in main(), no issue


    status = Fapi_BlockErase(1, 0x0200000, 0x1000);
    status = Fapi_BlockProgram(1, 0x200000, (unsigned int)&Success, 64);
    status = Fapi_BlockErase(1, 0x0200000, 0x1000);
    status = Fapi_BlockProgram(1, 0x200000, (unsigned int)&Success, 64);

  • QJ,

    I should have been clearer -- I am erasing/programming flash (without error) after the call to main from c_int00. Then later on (also in the background-task) the same calls fail.

    Can you send me your source to Fapi_BlockErase and Fapi_BlockProgram? My functions probably originated with either LS3137 or C2000 sample code, so the arguments are different. I can then try exactly what you wrote above.

    Thanks,

    Jim

  • Thanks for your help; this was my bug.

    Jim