0
\$\begingroup\$

I am fiddling around with NXP LPC2368. Recently changed the PLL clock control registers, and as a result JTAG stopped working, so I am unable to program or erase the chip.

My question is, is there any way to erase the chip "manually", as in, non-programatically? Any way that dos not involve using JTAG.

Yes, I've searched the user manual, couldn't find the answer.

\$\endgroup\$
3
\$\begingroup\$
  1. THE OBVIOUS METHOD is to use the built in bootloader and [flashmagic] to erase it via the serial port. I'm guessing that you already considered and rejected this method, possibly because your board doesn't give you access to both the serial port pins and the boot control pin(s). The LPC2368 overview suggests the bootloader also works via USB. I didn't confirm.
  2. THE TIMING METHOD: (Part of) the reason you can't get control via JTAG is that the aforementioned system bootloader always1 runs after reset, no matter what the boot pin settings, and JTAG cannot get control until after that is finished. What you need (after a hardware reset) is for the JTAG controller to assert [TMS, I think] just after the system bootloader is finished, but before your code changes the problematic registers. If you keep trying to connect via JTAG, with random timing between that and your hardware reset button, you might fail 500 times and get lucky on the 501st.

Note 1: It has to run at least far enough to verify your "magic checksum"

Note 2: This would be better as a comment but I don't have rep points.

\$\endgroup\$
  • \$\begingroup\$ Yeah, the board is pretty restricted, no easy access to any UART except 3 (AFAIK flashmagic needs UART0?). \$\endgroup\$ – fh_spitfire Apr 16 '16 at 18:14
  • \$\begingroup\$ It is UART0 on the chips I've used. \$\endgroup\$ – h fsii Apr 17 '16 at 15:58
2
\$\begingroup\$

The LPC2368 has a ROM bootloader thats starts by pulling pin P2.10 LOW during and after reset (see UM10211 chapter 29.3). This mode allows you to connect your JTAG debugger to the chip.

\$\endgroup\$
  • \$\begingroup\$ Thanks, I missed that. Though, I tried pulling P2.10 LOW on power-up and reset but it still enters my user code (can confirm by observing GPIO states of my last loaded code still appearing).. I am kinda confused now. \$\endgroup\$ – fh_spitfire Apr 16 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.