Processor Expert and erasing flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Processor Expert and erasing flash

跳至解决方案
1,538 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,173 次查看
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 项奖励
回复
1 回复
1,174 次查看
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 项奖励
回复