Content originally posted in LPCWare by rals01 on Sun Oct 07 22:45:01 MST 2012 Hello,
I'm trying to reinvoke the LPC1227 ISP from user code as part of a firmware upgrade scheme. We use LPC21Isp as programming tool. We can successfully program the flash when the ISP entry code is executed before the FreeRTOS scheduler is started. However, if the ISP entry code is invoked from a FreeRTOS task, the ISP is entered, but programming stops approximately halfway through the first sector with a hardfault exception. I know other people have had issues with MSP setup and stack corruption, but I can't seem to figure out what I am doing wrong.
Enter ISP before FreeRTOS scheduler is started (ok) <code> int main(void){ //... ISP_enter(); //will never reach this point vTaskStartScheduler(); return 1;
} </code>
Enter ISP from task (fails with hardfault) <code> void vApplicationTask(void *pvParameters) { ISP_enter();