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?
Any one answered?
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!
-----------------------------------------------------------------------------------------------------------------------
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
Hi,
it no help g