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.
Tool/software: Code Composer Studio
Hi team,
I have a problem while I want to overwrite memory in flash using FlashAPI.
1. Do I have to erase the whole sector if I want to overwrite FLASH data?
I have an issue when I try to overwrite data which is already placed in flash memory. I got an error. Fapi_getFsmStatus = 0x30 (decimal 48).
2. Is there any option to erase just 8 16-bit words from memory? Currently, I am using those functions.
// Erase Sector C // oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, (uint32 *)Bzero_SectorC_start); oReturnCheck = Fapi_doBlankCheck((uint32 *)Bzero_SectorC_start, Bzero_16KSector_u32length, &oFlashStatusWord);
I was trying to modify Fapi_doBlankCheck to just erase 8 words but function returns error.
3. Did the flash memory cells are protected from program if there is already programmed value other than 0xFFFF?
Thank you for your help,
Best,
Mateusz Stasiak
Hi Mateusz,
1. Yes, you have to erase the whole sector. FMSTAT (described in API guide) of 0x30 means you are trying to program a 0 to 1, which is not allowed for program operation.
2. An erase command works on entire sector. You can not erase a few locations of a given sector. Fapi_doBlankCheck() does not erase - It is used to read and verify that flash is erased (reads back all 1s). Fapi_issueAsyncCommandWithAddress() is the erase function.
3. Using a program command, you can only flip a 1 to 0 for a given flash bit. Program command does not flip 0 to 1.
Thanks and regards,
Vamsi