LPC812 programming via SWD

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

LPC812 programming via SWD

1,400 次查看
lunke029
Contributor I

LPC812   programming via  SWD, Now all  Command is run ok,but only  "Copy RAM  to Flash"   is not OK, it return CMD_SUCCESS, but no any data wirte to flash,why?

  JF]H3VPI9)UYX0~EXY90@VP.png

0 项奖励
回复
4 回复数

1,151 次查看
lunke029
Contributor I

Any  one answered?

0 项奖励
回复

1,151 次查看
soledad
NXP Employee
NXP Employee

Hi,

Please check the below threads,

LPC812 IAP Copy Command not Affecting Destination 

LPC 822 ISP Write to RAM echoes correctly, but OK response never received! 

Have a great day,
Sol

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

0 项奖励
回复

1,151 次查看
lunke029
Contributor I

HI:

    Thank you for your answer , These do not help me .

     The following is the code :  

//=================================================================

     uint8_t LPC8xx_Sector_Write(uint32_t FlashAddr, uint8_t *dat,uint32_t Size)
{
 uint32_t SectorN;
 rtv=swd_write_block(CopyRamAddr,dat,Size);
 if (rtv>0) return 1;
 SectorN=FlashAddr>>10;
 cmddat[0]=50;cmddat[1]=SectorN;cmddat[2]=SectorN;
 Flash_cmd(cmddat,3);
 rtv=LPC_FLASH_Busy();
 if (rtv>0) return 1; 
 cmddat[0]=51;
 cmddat[1]=FlashAddr;
 cmddat[2]=CopyRamAddr,;
 cmddat[3]=Size;
 cmddat[4]=12000;
 Flash_cmd(cmddat,5);
 rtv=LPC_FLASH_Busy();
 if (rtv>0) return 2; 
 return rtv;
}

//=====================================================================

1. Of course  ,first erase sector,  read this  sector   flash   is all 0xff.  flash have  data  before.

2.  then  Sector_Write,  Confirm return CMD_SUCCESS,  if  I use  error  flash address,  return  DST_ADDR_ERROR,  if I use error Size it return COUNT_ERROR, I think   this  "uint8_t LPC8xx_Sector_Write(uint32_t FlashAddr, uint8_t *dat,uint32_t Size)"   code  no error.  I don't know  it is return CMD_SUCCESS,  Why no data is written ?

3.   All data are also verified by Jlink tool

0 项奖励
回复

1,151 次查看
lunke029
Contributor I

Hi, 

   it no help g

0 项奖励
回复