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.

TMS320F28388D: FLASH Erase

Part Number: TMS320F28388D

Hi , 

I am using TMS320F28388D controller, currently i have a external watch dog of 10ms i am trying to erase a sector 7 , 8 and 9. i am aware that erasing each sector takes around 40 to 50ms .

I have taken the access to CPU1 for Flash access and not releasing the access until cpu1 completes its flash operation. is this ok ?

I am able to erase the sector 7 by refreshing the external watchdog using state machine logic and getting the feedback of the Flash api functions.

but sector 8 and 9 is getting erased in the same way how sector 7 is getting erased. do i need to release the flash access to CPU1 after every sector erase operation

thanks,

Nagesh

  • Nagesh,

    CPU needs to issue the sector-erase command for each sector.  Hence, you need to plan accordingly.  You can include a timeout for each sector as needed (based on the erase time spec provided in Datasheet).

    Thanks and regards,

    Vamsi

  • Hi vamsi, 

    Yes, i have issued the erase command for each sector induvidually.

    for erase verification i am using this below command, is this correct for the flash sectors?

    if(u32FlashSector == 0x0B8000 || u32FlashSector == 0x0BA000 || u32FlashSector == 0x0BC00A || u32FlashSector == 0x0BE00A)
    {
    eStatus = (Fapi_StatusType)Fapi_doBlankCheck(u32FlashSector,Sector16k_u32length,&oFlashStatusWord);
    }
    else
    {
    eStatus = (Fapi_StatusType)Fapi_doBlankCheck(u32FlashSector,Sector64k_u32length,&oFlashStatusWord);
    }

    thanks,

    Nagesh

  • Hi vamsi, 

    can you please let me know can we the FMSTAT (Fapi_getFsmStatus();) is always zero after issuing a erase command, but this function 

    //
    // Sector length in number of 32bits
    //
    #define Sector16KB_u32length 0x1000
    #define Sector64KB_u32length 0x4000

    Fapi_doBlankCheck(u32FlashSector,Sector16k_u32length,&oFlashStatusWord); returns Fapi_Error_Fail also i noticed that the flash memory is not erased like other sectors.

    where u32FlashSector holds the address 0xBA000.

    can you let me know when does such a situation occur. i have initially called.

    Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(UINT32 *)u32FlashSectorAddr);  -- called once as it return success.

    eStatus = (Fapi_StatusType)Fapi_checkFsmForReady(); -- return ready

    then calling the Fapi_doBlankCheck() untill it returns success which is not happening.

  • Hi Vamsi, 

    I tried with the example code flashapi_ex1_programming by replacing with 'Bzero_Sector6_start' to 'Bzero_Sector10_start' and tried to erase the data which was already written onto it, even that did not work in the example program does this mean the controller has a problem ?

    thanks,

    Nagesh

  • Nagesh,

    Is the application waiting in loop to check for FSM ready? Once the FSM is ready, you checked for FMSTAT and it is zero, but the blankcheck is failing - correct?

    This is happening only for one sector - Remaining sectors are getting erased fine.  Did I get that correct?

    How many Write/Erase cycles did you do on that sector on the failing unit up to now?

    Thanks and regards,

    Vamsi

  • Hi Vamsi. 

    Is the application waiting in loop to check for FSM ready? Once the FSM is ready, you checked for FMSTAT and it is zero, but the blankcheck is failing - correct?  -- Yes

    This is happening only for one sector - Remaining sectors are getting erased fine. i observed the same with SECTOR 10 also , but sector 7,8,9 are erasing. Not sure of others yet .

    How many Write/Erase cycles did you do on that sector on the failing unit up to now?

    i might have done something like 200 - 300 max.

    I am doubting if the unit is failed .

    thanks

    Nagesh

  • Nagesh,

    On the same unit, you were successfully able to erase the same sectors previously with the same SW - correct?

    Did you make any changes recently like updating any DCSM settings etc?

    Thanks and regards,

    Vamsi

  • Hi Vamsi, 

    Yes, now it seems to be working fine. 

    I have a doubt related to my implementation as mentioned above if i use the below statement for erasing the sector 8 which has length of 0x8000. where the length of Sector16k_u32length is 0x1000

    eStatus = (Fapi_StatusType)Fapi_doBlankCheck(u32FlashSector,Sector16k_u32length,&oFlashStatusWord);

    can i use only this for sector which has length of 0x8000, will it erase entire sector .

    thanks,

    Nagesh

  • Nagesh,

    I think you meant to ask this question for blank check and not for erase.  Erase command does not take the length as parameter.

    Regarding blank check: You have to use Sector16KB_u32length (which is 0x1000) for 16KB sectors and Sector64KB_u32length (0x4000) for 64KB sectors.  Not sure why you used Sector16KB_u32length for a 64KB sector (Sector 8). Please use Sector64KB_u32length for sector 8 since it is a 64KB sector.

    Note that blank check reads 32-bit words - Hence we provide 32-bit length instead of 16-bit length.  

    Thanks and regards,
    Vamsi

  • Hi Vamsi, 

    Thank you for the response, i was not able to find this info in the document i am using "TMS320F2838x Flash API Version 1.60.00.00" api document.

    I have one more observation , i have calculated the time it takes to erase a sector when its already erased by CCS. i did this for SECTOR 7, 8, 9

    Time for Erasing SECTOR 7 is 4.268 msec

    Time for Erasing SECTOR 8 is 4.268 msec

    Time for Erasing SECTOR 9 is 8.536 msec

    Since all the sectors are of same size i expect the time taken to be same even for sector 9, but i tried multiple times i always get same values and the erase time of sector 9 is always double than others.

    I am seeing though i do not have any loops where i need to refresh the external watch dog within 10ms, i feel the code gets stuck while erasing sector 9 when using the api, if i do not erase this sector in cpu1 it works fine.

    I verified the FMSTAT register its zero.

    can you suggest me some pointers where can i look at.

    thanks,

    Nagesh

  • Hi Nagesh,

    1) 32-bit length:

    32-bit length is mentioned in both the parameters and description segments of section 3.3.1 Fapi_doBlankCheck() in the flash API guide.  

    Names used in the SW header also clearly indicate the 32-bit length -> Sector16KB_u32length, Sector64KB_u32length.

    It is also mentioned in the FAQ that I shared with you previously.  

    2) Erase time:  Numbers you observed are way below the typical spec we gave in the Datasheet.  As long as the erase happens as per the spec, no need to worry.  Different bits (and hence sectors) behave differently.  Some bits may need more time to get erased.  That is not an issue.  

    Thanks and regards,
    Vamsi

  • Hi Vamsi, 

    Thank you for the clarification.

    I am basically try to load the Motorola S2 record format into the flash memory, the only thing i see in this flash is we can write max 128 bits at a time (16 bytes), but my s2 record is only 15 bytes so 1 byte will be left over.

    i noticed there is a tool serial flash loader, do we have the source code for this tool available so that i can compare how are the bytes handled here so that i can use the feed back mechanism to handle to refresh ext WD.

    thanks,

    Nagesh

  • Nagesh,

    Since the original issue is closed, I would suggest to open a new post for your new questions.  That helps us to understand the context easily when we look at the thread title when we track for the progress.  I am closing this post - please open a new post and we can assign to other experts as appropriate.

    Thanks and regards,
    Vamsi