AnsweredAssumed Answered

KL05 and FSTAT bus error

Question asked by Ardoster on Jan 23, 2015
Latest reply on Jan 26, 2015 by Ardoster

Hi

 

Using a KL05, I'm having problems with a bus error generated when reading the FSTAT register after launching a erase command operation. The exact operations I'm doing are the following:

 

while(FTFA_PDD_GetCmdCompleteFlag(FTFA) != FTFA_FSTAT_CCIF_MASK);     /* just to be sure peripheral is ready */

 

FTFA_PDD_SetFCCOBCommand(FTFA, FLASH_CMD_ERASE_SECTOR);

FTFA_PDD_SetFCCOBAddress(FTFA, addr);

FTFA_PDD_LaunchCommand(FTFA)

 

/* verification to know when the operation has been completed */

while(FTFA_PDD_GetCmdCompleteFlag(FTFA) != FTFA_FSTAT_CCIF_MASK);     /* THIS IS WHERE THE BUS ERROR IS GENERATED */

 

When the bus error is generated, I observe the flag RDCOLERR in FTFA_FSTAT register has been enabled. I can't understand why this is happening. Even more weird: when I execute step by step this operation, no error is generated. I have tried to add a delay before the sencond FSTAT verification but it is useless.

 

Do you have any idea about what could be happening? All help will be appreciated.

 

Thanks in advance

 

Eduardo

 

UPDATE: I'm not using Processor Expert code.

Outcomes