#include "board.h"
/* This data must be global so it is not read from the stack */
#define IAP_ENTRY_LOCATION 0X1FFF1FF1
typedef void (*IAP_ENTRY_T)(unsigned int[5], unsigned int[4]);
void IAP_Entry(unsigned int cmd_param[5], unsigned int status_result[4])
{
((IAP_ENTRY_T) IAP_ENTRY_LOCATION)(cmd_param, status_result);
}
void ReinvokeISP(void)
{
uint32_t command[5], result[4];
SCB->VTOR = 0; //Resets vector table offset
LPC_SYSCTL->SYSAHBCLKCTRL |= 0x14440; //USB clock(0x04000), 32-bit timer(0x00400), GPIO clock(0x00040), and IO config clock(0x10000) must all be on
LPC_SYSCTL->SYSAHBCLKDIV = 1; //make sure AHB clock divider is 1:1
command[0] = 57; //Reinvoke ISP command
IAP_Entry(command, result);
}
/* Main Program */
int main()
{
ReinvokeISP();
}
|
Hi Dan, have you fixed your issue? I might have the same issue but I have not idea what is going on...