Processor Expert and erasing flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Processor Expert and erasing flash

Jump to solution
988 Views
phlp
Contributor III

Hi all,

 

I'm using Processor Expert with  CW 10.4 on a MCF51QU32VFM (coldfire+).  I'm trying to write data to the internal flash. I've inserted a flash component using Processor Expert and defined a 1KB flash space at 0x200000 (where the DFlash starts). I copied the functions from the demo projects packaged with CW to erase, read and write to the flash. The following events methods have been defined in Events.c:

void FLASH1_OnOperationComplete(LDD_TUserData *UserDataPtr)

{

  uint8_t *OpStatus = (LDD_TUserData*) UserDataPtr;

  *OpStatus = TRUE;

}

 

void FLASH1_OnError(LDD_TUserData *UserDataPtr)

{

}

 

In my main function I first try to erase the 1KB of flash by calling the following function:

bool EraseFlash(LDD_TDeviceData *DeviceData, LDD_FLASH_TAddress FromAddress, LDD_FLASH_TDataSize Size, uint8_t* OpStatus)

{

  LDD_TError Error;

  int i = 0;

  *OpStatus = FALSE;

  Error = FLASH1_Erase(DeviceData, FromAddress, Size);

  if (Error) {

    return FALSE;

  }

  while(*OpStatus != TRUE);  

  return TRUE;

}

 

When FLASH1_Erase(..) is called in the above function, the FLASH1_OnError(..) event is triggered although  FLASH1_Erase(..) returns with no error. FLASH1_OnOperationComplete(.. ) is never triggered, so EraseFlash(..) is stuck in an infinite loop at while(*OpStatus != TRUE).

 

Any help will be appreciated.

 

Thanks

Philip

Labels (1)
0 Kudos
1 Solution
623 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Philip.

can you please try the same with CW10.6?

https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&tid=CWH

if the problem persists in CW10.6, please upload your testing demo code. We will check it here. thansk!

Best Regards,

ZhangJun

View solution in original post

0 Kudos
1 Reply
624 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Philip.

can you please try the same with CW10.6?

https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&tid=CWH

if the problem persists in CW10.6, please upload your testing demo code. We will check it here. thansk!

Best Regards,

ZhangJun

0 Kudos