Content originally posted in LPCWare by neilt6 on Wed Jun 04 13:05:05 MST 2014
Quote: dztang
When the reinvoke_ISP is called, it will sample the VBUS pin, if it's high, it will go to USB ISP, otherwise, it will go to UART ISP mode.
So, only the GPIO clock needs to be turned on first before reinvoke_ISP is called.
I am puzzled why you got a reset. Inside USB ISP mode, the XTAL instead of IRC must be used, if there are any jumper setting, you need to connect to
the XTAL pin on P2.0 and P2.1 first.
That's why I asked you to verify if UART ISP works or not when reinvoke_ISP is called. If it does, connect the USB cable with the host, and also make
sure XTALs are installed.
Ok, I just tried calling ReinvokeISP with USB connected to the LPC-Link connector instead of the target connector (leaving VBUS disconnected), and the UART ISP mode indeed works. However, calling it while connected to the target connector simply resets. I checked the LPCXpresso11U68 schematic, and XTAL is connected. Also, the USB bootloader works if I hold down the ISP button and plug in/reset, so the wiring is correct.
Up until now I've been testing this in a project that (among other things) uses USB. To make matters more interesting, I tried moving the IAP code to a blank project that just calls ReinvokeISP after a 1 second timeout. Low and behold the call actually goes somewhere and the micro doesn't reset. It still doesn't work though, it just shows up as an unrecognized device after several seconds...