AnsweredAssumed Answered

FLASH COMPONENT CAN NOT MAKE UPDATES

Question asked by Marceli Firlej on Oct 8, 2017
Latest reply on Oct 10, 2017 by Marceli Firlej

Hi,

I am using CW10.7 and trying selected flash memory update in with the new parameters, however it is not allowing me second and another time after first downloading the code. I am using MKL25Z64VHL4 chip.

 

I am trying to erase or write into user sector FC00 to able erase 1024 bytes but the unit stil staying in ERR_BUSY instead of Flash Idle because DeviceDataPrv->CurrentOperationStatus = 24.

Is this problem to access to memory address?

 

#define SETTINGS_FLASH_ADDR 0xFC00  /* Reserve memory for settings flash memory location the data will be written to */
#define ERASE_FLASH_SIZE    0X0400 // minimum size section to ERASE
// Save Data
void SaveData(void)
{
Error = FLASH1_Erase(DeviceDataPtr, SETTINGS_FLASH_ADDR, ERASE_FLASH_SIZE);
do // CHECK OPERATION STATUS
 {
     FLASH1_Main(MyFLASH_Ptr);
     OpStatus = FLASH1_GetOperationStatus(MyFLASH_Ptr);
 } while (!((OpStatus == LDD_FLASH_IDLE) | (OpStatus == LDD_FLASH_FAILED)));

  DataWrittenFlg = FALSE;

 if (OpStatus == LDD_FLASH_FAILED)
 { /* Check if the operation has successfully ended */
  /* Error state solution */
     UError = ERR_ERASE_FLASH_FAILED;
 }
 DisplayError();
......
}
Thank you for assistance.
Regards,
Marceli

Outcomes