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.

TMDX570LC43HDK: 01252018I6

Part Number: TMDX570LC43HDK

Hello,

I'm trying to erase and programming the flash and the first instruction that I use is Fapi_initializeFlashBanks(150) and the instruction return me the error Fapi_Error_OtpChecksumMismatch and I don't know why this error appears.

Could you please help me with that?

Regards,

Bea

  • Hello Beatriz,

    Please make sure that the correct flash API library is used in your project:

    F021_API_CortexR4_BE_L2FMC_V3D16.lib  --> for TMS570LC43x device

    F021_API_CortexR4_BE_V3D16.lib     ---> for TMS570LSx devices

  • Hello QJ Wang,

    I've removed all of the libraries included in F021 less F021_API_CortexR4_BE_l2FMC_V3D16.lib and the OTP error has disappeared, thanks for your reply. But when I programming the flash the values are no correct. 

    My code is:

    unsigned char Data[16] = {'A', 'B', 'C' , 'D', 'A', 'B' ,'C', 'D', 'A' ,'B', 'C', 'D' ,'A', 'B', 'C','D'};

    for erase the flash:

    Fapi_disableAutoEccCalculation();
    Fapi_initializeFlashBanks(150);

    Fapi_setActiveFlashBank(Fapi_FlashBank1);
    Fapi_enableMainBankSectors(0xFFFF);
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while( FAPI_GET_FSM_STATUS!= Fapi_Status_Success );

    if(FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmReady)
    {
    Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32_t *)0x00220000);
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);
    }

    and for program:

    Fapi_initializeFlashBanks(150);

    Fapi_disableAutoEccCalculation();
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while( FAPI_GET_FSM_STATUS!= Fapi_Status_Success );

    Fapi_setActiveFlashBank(Fapi_FlashBank1);
    Fapi_enableMainBankSectors(0xFFFF);
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while( FAPI_GET_FSM_STATUS!= Fapi_Status_Success );

    if(FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmReady)
    {
    return_chcek = Fapi_issueProgrammingCommand((uint32_t *)BANK1_START_ADDR,(uint8_t*)Data,16,0,0,Fapi_DataOnly);
    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );
    while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);
    }

    and the result in the flash is:

    0x00220000    0x41420344  0x67424344  0x40424344   0x41424344

    only the last position is correct, could you help me?

    Regards,

    Bea

  • Hello again,

    I've discovered my mistake. I've included in the code a function "coreCleanInvalidateDC()" provided by another user of this forum and I've enabled the ECC calculation with the function "Fapi_enableAutoEccCalculation" and in the function to programming I've changed the Data_only by Fapi_AutoEccGeneration, and now its works!!

    Thanks for your help!