verify PFlash_Program()

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

verify PFlash_Program()

769 次查看
tafengchung
Contributor II

How can i verify flash program?

I use this PFlash_Program() function to program s12xep100

But, I can't see any change in memory windows.

标记 (1)
0 项奖励
回复
2 回复数

639 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi tafeng,

when you launch debugger, click "Hotsync" button in P&E connection manager for each target connection.

The Hotsync button in the Connection Assistant allows the user to connect to an already running target. thus you can check the debugger memory window, if your flash is successful programmed.

pastedImage_1.png


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

639 次查看
tafengchung
Contributor II

1) flash_program()

2) flash_Verfy

/******************************************************************************/
#pragma CODE_SEG RAM_CODE

unsigned char PFlash_Program(unsigned long address, unsigned short *ptr)
{
  unsigned char i;
  while((FSTAT & FSTAT_CCIF_MASK) == 0);  //wait if command in progress
   FSTAT = 0x30;       //clear ACCERR and PVIOL
  FCCOBIX = 0x00;
  FCCOB = 0x0600 | ((address & 0x007F0000)>>16);
  FCCOBIX = 0x01;
  FCCOB = (address & 0x0000FFFF);
  for(i=2; i<6; i++)  
  {
    FCCOBIX = i;
    FCCOB = 0xAA;
  }
 
  FSTAT = 0x80;       //launch command
  while((FSTAT & FSTAT_CCIF_MASK) == 0);  //wait for done
 
  if((FSTAT & (FSTAT_ACCERR_MASK | FSTAT_FPVIOL_MASK)) != 0)
    return FlashProgramError;
  else
    return noErr;
}
#pragma CODE_SEG DEFAULT   

/******************************************************************************/

uint8_t FLASH_Read_Byte(uint8_t * Address)
{

    return (*Address);
}

0 项奖励
回复