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.

TMS570LS0714: flash erase cause FEE issue

Part Number: TMS570LS0714
Other Parts Discussed in Thread: HALCOGEN

Hi Team,

My customer face an issue when they are using FEE operation before flash erase one bank, if add flash erase function as below(band 0), and do fee write operation, there will cause watchdog reset, if they remove the flash erase function, then everything is ok without reset. is there any relationship between flash erase operation and fee operation ?

status = Fapi_BlockErase(Bank,Flash_Start_Address,Size_In_Bytes);  // if remove this function , then everything is ok.

  • Hello Strong,

    In your case, how long will take watchdog to reset? What could happen is: Fapi_BlockErase is taking longer so watchdog kicked in. To confirm this: can you try to disable watchdog and then measure the cycles in Fapi_BlockErase function?

    best regards,

    David Zhou

  • Hi David,

    Thanks for your reply.

    how long will take watchdog to reset?  ----- 300ms

    What could happen is: Fapi_BlockErase is taking longer so watchdog kicked in.

     -----  Fapi_BlockErase is run for once in the initiation function before while loop as below.  there would not have watchdog reset when using Fapi_BlockErase.

             the watchdog reset occur when call fee operation function. this function run in while loop in the main function.

    while(1)

    {

    IOO_LVPHV_EN; // 测试代码

    WatchDog_Feed(); // 喂狗

    App_UDSDTCRecord_OBC(); //  fee operation

    IOO_LVPHV_NEN; // 测试代码

    }

  • Hello Strong,

    It takes up to 4 seconds to erase a sector or a bank. Once the DWD is enabled, it cannot be disabled except by system reset or power on reset. Customer should change the watchdog reaction (reset --> interrupt only) before calling the API to erase the flash.

  • Hi QJ,

    customer do the watchdog service as below,  you mean calling Fapi_BlockErase will take about 4 seconds? 

    do

    {

    vimDisableInterrupt(15U); /* 禁止APP中断,此传参值根据APP开启的中断号决定,在sys_vim.h文件中可以看到*/

    status = Fapi_BlockErase(Bank,Flash_Start_Address,Size_In_Bytes);

    vimEnableInterrupt(15U,SYS_FIQ); /* 使能APP中断,此传参值根据APP开启的中断号决定,在sys_vim.h文件中可以看到*/

    WatchDog_Feed(); // 喂狗

    }while(((++t_Cnt) < 10U) && ( 0U != status));

     

     

  • Hi QJ,

    Actually the watchdog issue occur during the while(1) function, not when call Fapi_BlockErase, my understanding is that there also have flash erasing when call the below function in while loop:

    App_UDSDTCRecord_OBC(); //  fee operation

    but what can't explain is that if they remove Fapi_BlockErase(Bank,Flash_Start_Address,Size_In_Bytes) function which erasing bank0 and run before while(1), there will have no this watchdog reset issue.

  • Hi QJ,

    Update more of customer's test:

    1. customer initialize watchdog after Fapi_BlockErase function, still have the issue.

    2. Remove this function below, then will not have watchdog reset. this can approve only the FEE operation will cause the watchdog reset.

       App_UDSDTCRecord_OBC(); //  fee operation

  • Strong,

    Since watchdog timeout is 300ms, so any interrupt masked operation which takes 300ms will trigger watchdog. How long does it take App_UDSDTCRecord_OBC() to complete? Can you try to profile it? Can you also add a variable j here to see if the watch dog failed for the very 1st time or it is in the middle ?

    int j=0;

    while(1)

    {

    IOO_LVPHV_EN; // 测试代码

    WatchDog_Feed(); // 喂狗

    App_UDSDTCRecord_OBC(); //  fee operation

    j++;

    IOO_LVPHV_NEN; // 测试代码

    }

    printf("%d\n",j);

    Also would it be possible to attached a CCS project which demos the issue? We don't need the complete project so you can remove a lot of user application related code but just keep watch dog & Flash API & FEE.

    best regards,

    David Zhou

  • Hi David,

    Thanks for your support, I post the code attached, and I will send the password by email. it is a full project and can reproduce the issue.

    Stronghttps://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/8561.Project_5F00_Test3.7z

  • Hello Strong,

    The FEE is emulated EEPROM which is bank7. The FEE driver is generated through the HALCOGen. But customer uses the last sector of the program flash. I suggest customer to use BANK7 and FEE drivers.

  • Hi QJ,

    sorry I not understand " customer uses the last sector of the program flash", I see ti_fee_cfg.c file that configure FEE bank to bank7. and check with customer, they use Halcogen to configure bank7.

    const Fee_VirtualSectorConfigType Fee_VirtualSectorConfiguration[TI_FEE_NUMBER_OF_VIRTUAL_SECTORS] =

    {

    /* Virtual Sector 1 */

    {

    /* Virtual sector number */ 1U,

    /* Bank */ 7U,

    /* Start Sector */ (Fapi_FlashSectorType)0U,

    /* End Sector */ (Fapi_FlashSectorType)7U

    },

    /* Virtual Sector 2 */

    {

    /* Virtual sector number */ 2U,

    /* Bank */ 7U,

    /* Start Sector */ (Fapi_FlashSectorType)8U,

    /* End Sector */ (Fapi_FlashSectorType)15U

    }

    };

  • closed through email and conf call