AnsweredAssumed Answered

KEA-64 suspends during internal EEPROM erasing

Question asked by Morty Hsueh on May 18, 2016

Hello,

 

I am working on a KEA64 and used Processor Expert to generate drivers of internal EEPROM (IFsh1: IntFLASH).

EEPROM read/write works great, but main loop and other interrupts are suspended during EEPROM erasing.

 

Firstly, I suspect the while loop which is used for erasing complete detection in EraseFlash function stalls all process, then I use "SetWait" method to avoid the while loop.

byte IFsh1_EraseSector(IFsh1_TAddress Addr) {   LDD_TError                 Result;     if (IFsh1_CmdPending) {     return ERR_BUSY;   }   IFsh1_CurrentCommand = IFsh1_CMD_ERASE_SECTOR;   IFsh1_CmdPending = TRUE;   Result = IntFlashLdd1_Erase(IntFlashLdd1_DevDataPtr, (LDD_FLASH_TAddress)Addr, 1U);   if (Result == ERR_OK) {     if (IFsh1_WaitForCommandDone) {  /*SetWait(False)to disable the wait loop as below. */       do {       } while (IFsh1_CmdPending);       Result = IFsh1_CmdResult;     }   } else {     IFsh1_CmdPending = FALSE;          /* Command parameter error */     if (Result == ERR_PARAM_ADDRESS) {       Result = ERR_RANGE;     }   }   return (byte)Result; }   

However, main loop and interrupts still suspend.

 

I've checked the reference manual of KEA64, but nothing had been mentioned.

Is the situation caused by innate hardware limitation of KEA64 or ARM cortex-M0+?

Please give me some advice.

 

Thanks,

Morty

 

May 23, Update:

Attached source code of a simple example. 

Original Attachment has been moved to: EEPROM_Eval.zip

Outcomes