I am trying invoke USB ISP mode, to allow reprogramming from USB. My IAP call always returns the "Reinvoke configuration error" (kStatus_IAP_ReinvokeISPConfig). I am using the "lpcxpresso51u68_flashiap" sample code from the SDK, running on the demo board. I have converted the sample to use the newer fsl_iap.c driver instead of the deprecated deprecated fsl_flashiap.c driver. The Flash write, erase, and read work, but the "IAP_ReinvokeISP(2, &status)" always return with the configuration error. The code I added was:
PRINTF("\r\nIAP_ReinvokeISP\r\n");
IAP_ReinvokeISP(2, &status);
if (status != kStatus_IAP_Success) {
PRINTF("\r\nReinvoke ISP failed. Status = %lu:%lu\r\n", status / 100, status %100);
if (status == kStatus_IAP_ReinvokeISPConfig) {
PRINTF("Failure Code = Reinvoke configuration error\r\n");
}
}
Running this project gives me the following messages:
==========================================
IAP example
Writing flash sector 1
Erasing flash sector 1
Erasing page 1 in flash sector 1
IAP_Unique ID workaround:
ID[0] = 0x1701704a
ID[1] = 0xaaf2cc48
ID[2] = 0x597a1b00
ID[3] = 0xf5001b80
IAP_ReinvokeISP
Reinvoke ISP failed. Status = 102:28
Failure Code = Reinvoke configuration error
End of IAP Flash Example
Can anyone point me in the right direction on what to try next?
I have attached the project files.