On LPC1549Xpresso board, I ran a quick test on Reinvoke ISP on both UART and USB and didn't see any
problems though. I also tried my IAP code running in either RAM or flash, both work. A quick test you can do
is to make your application bare minimum, e.g.
(1) Only use 12Mhz IRC as MAINCLK.
(2) Enable RAM1 and RAM2, IOCON, SWM, GPIO 0/1/2 clocks in SYSAHBCLKCTRL register.
(3) Disable all interrupts.
(4) Call IAP to read part ID, and then reinvoke ISP with either USB(2) or UART(1)
If you invoke USB ISP, make sure USB is connected to the PC, on reinvoke, USB ISP should
be enumerated as Mass Storage device.
Then, try UART ISP, type "?", "Synchronized" should appear.
uint32_t ReadIdentification(void) {
IAP.cmd = IAP_READ_PART_ID;
IAP_Call (&IAP.cmd, &IAP.stat);
if (IAP.stat) return (0);
return (IAP.res[0]);
}
int ReinvokeISP (uint32_t isp_num ) {
IAP.cmd = IAP_REINVOKE_ISP; // Reinvoke ISP
IAP.par[0] = isp_num; // ISP number, 1=UART ISP, 2=USB ISP, 3=CAN ISP
IAP_Call (&IAP.cmd, &IAP.stat); // Call IAP Command
if (IAP.stat) return (IAP.stat); // Command Failed
return (0); // Finished without Errors
}
In the beginning of main, do something like:
LPC_SYSCON->SYSAHBCLKCTRL0 |= (EN0_RAM1 | EN0_RAM2 | EN0_IOCON | EN0_SWM);
LPC_SYSCON->SYSAHBCLKCTRL0 |= (EN0_EE | EN0_GPIO0 | EN0_GPIO1 | EN0_GPIO2);
i = ReadIdentification();
if ((i & 0x00001500) != 0x00001500) {
while (1);
}
ReinvokeISP (UART_ISP);