Hi Ranjith,
I use the lpcopen code and test it on my LPCXpresso 824 MAX board, I didn't reproduce your problem.
Code link is:
https://www.nxp.com/support/developer-resources/software-development-tools/developer-resources-/lpco...
I use flashiap project, and the main code is like this:
int main(void)
{
int i;
uint8_t ret_code;
uint32_t part_id;
uint32_t unique_id[4];
unsigned int j,k;
SystemCoreClockUpdate();
Board_Init();
Board_LED_Set(0, false);
SysTick_Config(SystemCoreClock / TICKRATE_HZ);
for (i = 0; i < ARRAY_ELEMENTS; i++) {
src_iap_array_data[i] = 0x11223340 + i;
}
part_id = Chip_IAP_ReadPID();
Print_Val("Part ID is: 0x", part_id);
Chip_IAP_ReadUID(unique_id);
DEBUGSTR("Unique Part ID is:\r\n");
for (i=0; i<4; i++) {
Print_Val("0x", unique_id[i]);
}
__disable_irq();
ret_code = Chip_IAP_PreSectorForReadWrite(IAP_LAST_SECTOR, IAP_LAST_SECTOR);
if (ret_code != IAP_CMD_SUCCESS) {
Print_Val("Command failed to execute, return code is: ", ret_code);
}
ret_code = Chip_IAP_EraseSector(IAP_LAST_SECTOR, IAP_LAST_SECTOR);
if (ret_code != IAP_CMD_SUCCESS) {
Print_Val("Command failed to execute, return code is: ", ret_code);
}
ret_code = Chip_IAP_PreSectorForReadWrite(IAP_LAST_SECTOR, IAP_LAST_SECTOR);
if (ret_code != IAP_CMD_SUCCESS) {
Print_Val("Command failed to execute, return code is: ", ret_code);
}
ret_code = Chip_IAP_CopyRamToFlash(START_ADDR_LAST_SECTOR, src_iap_array_data, IAP_NUM_BYTES_TO_WRITE);
if (ret_code != IAP_CMD_SUCCESS) {
Print_Val("Command failed to execute, return code is: ", ret_code);
}
__enable_irq();
Chip_FMC_ComputeSignatureBlocks(START_ADDR_LAST_SECTOR, (SECTOR_SIZE / 16));
while (Chip_FMC_IsSignatureBusy()) {}
Print_Val("Generated signature for the last sector is: 0x", Chip_FMC_GetSignature(0));
for(j=0;j<200;j++) for(k=0;k<65535;k++);
DEBUGSTR("Enter UART ISP mode\r\n");
Chip_IAP_ReinvokeISP();
while (1) {
}
}
After I enter ISP mode, I wait for about 30 minutes, then my code still in the ISP mode, I still can use the flashmagic to readout the device signature, the code didn't reset.
So, you also can use the official code and test it on your side.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------