I have played with LPC845 and LPC804 related to the reinvokeISP issue.
With the following code, I can enter ISP mode with LPC845, tested with LPC845-BRK board OK.
-------------------
void start_isp() {
// IAP iap_entry = (IAP)IAP_ENTRY;
__disable_irq();
// Set clock to internal osc
LPC_SYSCON->MAINCLKSEL = MAINCLKSEL_VAL0;
LPC_SYSCON->MAINCLKUEN = MAINCLKUEN_UPDATE; // Update clock source
LPC_SYSCON->MAINCLKUEN = MAINCLKUEN_DISABLE; // Toggle update register once
LPC_SYSCON->MAINCLKUEN = MAINCLKUEN_UPDATE;
// Wait until the clock is updated
while (!(LPC_SYSCON->MAINCLKUEN & MAINCLKUEN_UPDATE));
// Set system AHB clock
LPC_SYSCON->SYSAHBCLKDIV = 1; // Divide by 1 == SYSAHBCLKDIV_DIV1;
// Enabled IOCON clock for I/O related peripherals
LPC_SYSCON->SYSAHBCLKCTRL[0] |= IOCON;
cmd[0] = IAP_CMD_REINVOKE_ISP;
cmd[1] = 1; // select USART_ISP mode
//iap_entry(cmd,stat);
IAP_Call(cmd,stat);
// shouldn't return
}
-----------------
After the above code was executed in the LPC845, I can use FlashMagic to read signature. That proves the chip is in the ISP mode.
However, the above code does not work with LPC804. I tested with OM40001 dev kit.
Can NXP support engineer to confirm that the LPC804 does or does not support reinvoke ISP command?
Thanks.