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.

TMS320F280040C-Q1: TMS320F280040C: Flash API usage for OTP programming

Part Number: TMS320F280040C-Q1
Other Parts Discussed in Thread: UNIFLASH

Hello,

I'm working on TMS320F28004x OTP programming. I have the following questions:

1. Since care must be taken while programming this area, I would like to double check the correct sequence  that must be performed. I 'm using the following code:

_________________________________________________________________________

    InitSysPll(INT_OSC2,IMULT_16,FMULT_0,PLLCLK_BY_2);

    EALLOW;

  err_code = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 80);

    if (err_code != Fapi_Status_Success)
    {
        return (err_code);
    }

    err_code = Fapi_setActiveFlashBank(Fapi_FlashBank0);

  start_addr = 0x78008;

 // data_buff initialization

...

  err_code = Fapi_issueProgrammingCommand((uint32 *) start_addr, data_buff, 8, 0, 0, Fapi_AutoEccGeneration);

_________________________________________________________________________

However, the OTP ECC has not programmed correctly. The flash API is "F021 Flash API v1.55". Do I missed something?

Is "Fapi_AutoEccGeneration" the recommended mode for programming the OTP area? Or do I program OTP & OTP ECC separately? If so, how to do it?

2. Once programmed the OTP area, I'm not able to ignore ECC errors, which triggers NMI. I tried to write the ECC_ENABLE register to 0xB and perfom a system reset via JTAG but the issue still persist.

Uniflash tool is able to reprogram the device even if the OTP ECC is wrong.

How can be avoided NMI due to ECC error?

Best Regards,

Luca Zanuttini

  • 3. I'm also trying to program Z1OTP_GPREG3 at address 0x7801C. Since 8 16-bit words should be programmed at the same time for DCSM OTP programming (128-bit aligned), I call the Fapi_issueProgrammingCommand starting with address 0x78008. However, the return code is 507 (Fapi_Error_InvalidAddress). If I try to provide only 4 words, it fails with error code 509 (Fapi_Error_AsyncIncorrectDataBufferLength) instead. I'm still using Fapi_AutoEccGeneration.

    How can I program Z1OTP_GPREG3 bytes?

  • Hi Luca,

    128-bit aligned address is required for 128-bit segments that don't have link-pointers or other reserved locations.  

    1)

    To program Z1OTP_GPREG1 and Z1OTP_GPREG2, you can call program function by providing the start address of 0x7800C with a length of 4 for Fapi_AutoEccGeneration.

    start_addr = 0x7800C;

    Fapi_issueProgrammingCommand((uint32 *) start_addr, data_buff, 4, 0, 0, Fapi_AutoEccGeneration);

    2)

    To program Z1OTP_GPREG3 and Z1OTP_BOOTCTRL, you can call program function by providing the start address of 0x7801C with a length of 4 for Fapi_AutoEccGeneration.

    start_addr = 0x7801C;

    Fapi_issueProgrammingCommand((uint32 *) start_addr, data_buff, 4, 0, 0, Fapi_AutoEccGeneration);

    Please try this and let us know how it goes.

    Note: I will be out of office from today evening, our team will help you if you need further help.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thank you for your hint! OTP programming aligned at 64-bit solved my issue. I have still problems to disable ECC errors via JTAG, but I will create a new thread if I need more info.

    Best Regards,

    Luca Zanuttini