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.

F021 bank erase LC4357, blank flash and ECC

Other Parts Discussed in Thread: TMS570LC4357

Hi,

I'm still pretty new to F021 / Hercules / ECC / MPU. This is a lot to read and understand. Could you please give me some hints for these questions:

On TMS570LS1227ZWT I did use Fapi_issueAsyncCommandWithAddress(Fapi_EraseBank, (uint32_t*)0x10000) with de-activates sectors 0,1,2,3. So I did erase sectors 4-15 in one rush.
With TMS570LC4357 this does not work (flash is not erased, Fapi_getFsmStatus is 0x11). Erasing sector by sector does work. Why?

When I erase the flash (e.g. with debugger), and check the memory with CCS View->Memory Browser, the shown content is not all 0xFF. There are some other values around. Is this because of ECC? Or what else?

Thank you for your patience. :)

Roger

  • Hi Roger,

    I can answer the 2nd question - the erased flash on the LC4357 does not read all 0xFFFFFFFF because the ECC is always enabled.  The ECC equation includes a number of address bits and at some addresses the combination of all '1's in the flash and ECC plus the address bits is viewed as a correctable error.  The corrected value is what you see in CCS and it's not 0xFFFFFFFF.     This is weird looking but it's the way the part is designed so just ignore it.

    This may be what is contributing to the Flash API problem you are having.  I'll need to loop in the expert on the flash API though.   What version of the flash API are you using?  - this may be important... 

    Thanks and Best Regards,
    Anthony

  • Hi Anthony,

    Thank you very much for your reply! The 'not FF' are clear now.

    I'm using F021 V2.01.00 and linked my project with F021_API_CortexR4_BE_L2FMC_V3D16.lib (correct?).

    Best Regards,

    Roger

  • Hi Roger,

    Regarding the first question, can you describe the steps prior to calling the Fapi_issueAsyncCommandWithAddress API?

    Looks from the status (0x11) that all the sectors are not enabled before issuing the Erase command.

    Best Regards,
    Siddharth

     

  • Hi Siddharth

    Yes this is correct, not all of the sectors are enabled. I wanted to enable just sectors 5-15 and the do a bank erase. My goal was to erase all activated sectors in one rush. (This worked on LS1227ZWT).


    Here the steps:

    Fapi_initializeFlashBanks(150U);
    
    StatusFlash = Fapi_setActiveFlashBank(Fapi_FlashBank0);
    if(StatusFlash == Fapi_Status_Success)
    {
      StatusFlash = Fapi_enableMainBankSectors(0xFFF0); // do not activate sectors 0..3
      while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
    }
    if(StatusFlash == Fapi_Status_Success)
    {
      StatusFlash = Fapi_issueAsyncCommandWithAddress(Fapi_EraseBank, (uint32_t*)0x10000);
      while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
    }
    // this is the place where status is 0x11 
    if(StatusFlash == Fapi_Status_Success)
    {
      Fapi_flushPipeline();
      if(AppOkFlag != 0xffffffff) // AppOkFlag is located in flash which has been erased
      {
        StatusFlash = Fapi_Error_Fail; /* AppOkFlag is not erased */
      }
    }

    As I did write, if I erase sector by sector, it works. So I do have a solution which works, I just wondered why I have the difference on LS1227 and LC4357.

    Best Regards,

    Roger

  • I've been trying to port the LS3137 bootloader to the LC4357 (because there is no bootloader example for the LC4357 - an issue I raised in a separate post and haven't received an answer yet ).  I had the same issue in this post, but based on your above reply the "Flash_Erase_Check" routine will always fail (which it is definitely doing).  So how do you erase check with ECC?

    Thanks,

    Dan

  • Dan,

    You will not be able to perform erase check om LC4357. The reason is that ECC is always enabled.

    Thanks and regards,

    Zhaohong