Processor Expert and erasing flash

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Processor Expert and erasing flash

ソリューションへジャンプ
1,540件の閲覧回数
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,175件の閲覧回数
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,176件の閲覧回数
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 件の賞賛
返信