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.

RM44L920: Boot issue with Flash ecc enable

Part Number: RM44L920
Other Parts Discussed in Thread: UNIFLASH

Hi  there,

 I have a API and bootloader program in MCU. When flash ecc is disable in both API and bootloader program. I can succeed in upgrading my API program with bootloader. But after Flash ecc is enable in API program but disable in bootloader program, it seems like that the API upgrade always fail. I have disable flash ecc before erase API flash and follow the recommended program flow to program API flash. I wonder if there is something wrong with ECC.  As you can see, API program upgrade works when Flash ECC is disable but have problem after flash ecc enable.  I used

        status = Fapi_issueProgrammingCommand((uint32_t *)dst,
                                              (uint8_t *)src,
                                              (uint8_t)bytes,
                                              0,
                                              0,
                                              Fapi_AutoEccGeneration);

to program my  API flash.

I wonder if you can give me some suggestion?

many thanks,

Catherine 

  • Hello Catherine,

    Before the application is programmed, the flash sectors for application are erased. If you do blank check after erase operation, you will get ECC error if ECC check is enabled. If you don't read the flash content (erased sectors) during programming, you won't get ECC error.

  • Hi QJ,

    Thanks you so much for your quick reply.

    I disable Flash ECC feature with function _coreDisableFlashEcc_() before I erased flash and program, so the boot loader work well. The Flash ECC error happened in the moment that software restart MCU after boot loader program has upgraded application program.   I tried to find out why flash ecc error occur after supplication program has been upgraded.

    Today, I debug my code and I found that after I erased flash with function Fapi_MainBlockErase(), the  ECC value isn't  all '1s' in corresponding flash space. They are some '0x7F' in some space.  I wonder if it is correct?

    What can I do if I want to check if the ECC value is correct for the new flash download data? I want to export the ECC values located in space started in address 0xF0400000 with uniflash app, but it seems like it can't do it. 

    It is an urgent issue for our project, as there isn't any technical support for RM44 we can call. I wonder if you are so kind and can provide your email or your colleague's email to me.

    many thanks,

     

  • Hello Catherine,

    F021 flash erase API erase both main flash and ECC space. After erase operation, the content of ECC space should be 0xFF rather than 0x7F.

    If flash ECC is enabled, reading flash will trigger the ECC error if the ECC is not programmed correctly. 

    You can save the ECC values using CCS:

    1. make sure the target is connected 

    2. Open memory browser

    3. click save memory buffer 

    4. For file type, use TI Data so you can view the data in text editor

    5. start address: ECC address corresponding to your main flash

  • Hi QJ,

    I really appreciate your helping.

    So, it isn't correct if we have 0x7F in ECC space after erasing flash.

    I wonder how this happen? I followed the 6.2 recommended erase flows in F021 FLASH API Ver 2.01.01 to erase flash. The difference is I call Fapi_issueAsyncCommand() to issue  Fapi_ClearStatus command to flash state machine after function call Fapi_enableMainBankSectors() and before function call Fapi_issueAsyncCommandWithAddress().  If this operation will lead to this result?

    As to the ECC data save, as I can't use CCS during or after bootloader upgrade I prefer to use uniflash API.  Can we do that with uniflash?

    thanks again.

    Best Regards

    Catherine

     

     

  • Hi QJ,

    I have moved Fapi_issueAsyncCommand() from my code and did a test, and now I have all '1s' in ECC space after erasing flash.

    Unfortunately, My program still stuck after upgrade and software reset. 

    Since it caused by flash err error, I want to read out ECC data after upgrade but I just have no idea how to do it as uniflash can't do it. I wonder if there is any flash api function can help to check if ECC data is correct? Or maybe you can give my a hint from your side.

    Thanks, 

    Catherine

  • I invited you as friend

  • Let us discuss the issue through email. I will close this thread.