Hi there,
I am trying to use the reinvoke functionaliry of the IAP set on my LPC1768 but it always results in an Hard Fault error (see attached picture). To use the reinvoke feature I do the following as suggested in the manual:
__disable_irq();
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
LPC_SC->PLL0CON = 0;
LPC_SC->PLL0FEED = 0xAA;
LPC_SC->PLL0FEED = 0x55;
LPC_SC->CLKSRCSEL = 0;
unsigned int cmd[5], res[5];
cmd[0] = 57;
__set_MSP(*((uint32_t *) 0x1FFF0000));
iap_entry(cmd, res);
Are there any mandatory steps before trying to use this, e.g. regarding the timing? As I cannot debug the functions inside the boot rom memory area (0x1FFF 0000 - 0x1FFF 1FFF) I do not see how to progress here.
Any help is appreciated, thanks in advance
Solved! Go to Solution.
I managed to get it to work. Quoting the manual:
It maps boot vectors, sets PCLK = CCLK / 4, configures UART0 pins Rx and Tx, resets TIMER1 and resets the U0FDR (see Section 14.4.12).
In my point of view, that does not include that TIMER1 has to be enabled, however this solves it:
LPC_SC->PCONP |= CLKPWR_PCONP_PCTIM1;
Perhaps this is also useful for somebody else.
I managed to get it to work. Quoting the manual:
It maps boot vectors, sets PCLK = CCLK / 4, configures UART0 pins Rx and Tx, resets TIMER1 and resets the U0FDR (see Section 14.4.12).
In my point of view, that does not include that TIMER1 has to be enabled, however this solves it:
LPC_SC->PCONP |= CLKPWR_PCONP_PCTIM1;
Perhaps this is also useful for somebody else.