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.

RM57L843: OTP (One Time Programmable Memory) handling with F021 FLASH API

Part Number: RM57L843
Other Parts Discussed in Thread: UNIFLASH

Dear TI,

I'm curious about the usage of OTP memories with the F021 FLASH API. How can I Read/Wrtie these memory parts? I know that if I write them, then I wont be able to erase again. I haven't tried it yet, since I couldn't even read these memory parts runtime. Can you please provide me some example codes how to read the OTP memory parts? As I tried to read it with F021 FLASH API I got ESM error Group 2 Channel 3

Also as I try to check these OTP memory parts with UniFlash tool some OTP memorys are readable, some other are not. For example TI OTP Bank 2 0xF008_2000 only shows "????" with UniFlash tool. 

But with F021 FLASH API I was not able to read any OTP memory. 

Please can you give me some documentation about OTP memories of the Hercules RM57Lx or some way to read about these memory parts to be able to understand this better. Also some code examples would be really good about it, if you have any.

Regards,

Aron

  • Hi Aron,

    There is a bug in the gel file for RM57L8x device.

    In current gel file:

    GEL_MapAdd(0xF0080000, 0, 0x00001000, 1, 0); /* Bank0 TI OTP */
    GEL_MapAddStr(0xF00C0000, 0, 0x00000200, "R|AS2", 0); /* Bank0 TI OTP ECC */

    The corrected gel file should be:

    GEL_MapAdd(0xF0080000, 0, 0x00002000, 1, 0); /* Bank0 TI OTP */
    GEL_MapAddStr(0xF00C0000, 0, 0x00000400, "R|AS2", 0); /* Bank0 TI OTP ECC */

    GEL_MapAdd(0xF0082000, 0, 0x00002000, 1, 0); /* Bank1 TI OTP */
    GEL_MapAddStr(0xF00C0400, 0, 0x00000400, "R|AS2", 0); /* Bank1 TI OTP ECC */

  • I will check it, but in the code I was not able to read either the Bank7 OTP memory parts. Is there any bug at that part also?

    Why is it possible to generate ECC with reading the memory? Am I using something wrong?  This code generated ECC error when I tried to read 

    Customer OTP-ECC, EEPROM Bank 0xF004_1C00 or TI OTP-ECC, EEPROM Bank 0xF00C_1C00

    static int initEeprom (void)
    {
    if (Fapi_initializeFlashBanks(150) != Fapi_Status_Success) {
    DBG("Unable to initialize EEPROM support!");
    return -1;
    }
    if (Fapi_setActiveFlashBank(Fapi_FlashBank7) != Fapi_Status_Success) {
    DBG("Unable to activate flash bank!");
    return -1;
    }
    while (FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady);
    if (Fapi_enableEepromBankSectors(0xffffffff, 0x00000000) != Fapi_Status_Success) {
    DBG("Unable to enable sectors!");
    return -1;
    }
    while (FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady);
    return 0;
    }

    int eepromRead (uint32_t *address, uint8_t *rData, uint32_t size)
    {
    Fapi_FlashStatusWordType f021_State;

    initEeprom();
    f021_State.au32StatusWord[3] = 0; // prepare function answer
    while (FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady);
    if (Fapi_doBlankCheck(address, 2, &f021_State) == Fapi_Status_Success) {
    DBG("Memory blank");
    return -1;
    }
    while (FAPI_CHECK_FSM_READY_BUSY != Fapi_Status_FsmReady);
    if (Fapi_doMarginReadByByte((uint8_t*)address, rData, size, Fapi_NormalRead) != Fapi_Status_Success) {
    return -2;
    } else {
    return 0;
    }
    }

  • The EEPROM OTP is included in the gel file. But the size is not correct.

    Change:

    GEL_MapAdd(0xF000E000, 0, 0x00001000, 1, 0); /* Customer OTP, EEPROM */
    GEL_MapAddStr(0xF0041C00, 0, 0x00000400, "R|AS2", 0); /* Customer OTP, EEPROM ECC */

    To:

    GEL_MapAdd(0xF000E000, 0, 0x00002000, 1, 0); /* Customer OTP, EEPROM */
    GEL_MapAddStr(0xF0041C00, 0, 0x00000400, "R|AS2", 0); /* Customer OTP, EEPROM ECC */

  • Thank you

    And where is this gel file? I tried to search it but couldn't really find. Also tried to search the function, but nothing. 

  • It is located at C:\ti\ccs1100\ccs\ccs_base\emulation\gel

    You can open it from CCS: CCS debug --> tools -->gels