OpenOCD JTAG Flash Rescue

Today i ran into a very strange problem. I was testing FreeRTOS and the flash image i tested running ok on the board until i went to debug and found it had broken the JTAG chain with this error on connection:

Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc

With no way of flashing with JTAG i eventually resorted to serial port flash of a known good image and this worked out fine.

I have not investigated the faulty code yet but I’m thinking a startup code/memory mapping problem. Obviously any pointers to why would be appreciated.

However my questions is: Is it possible to rescue the board with JTAG alone and if so how is this achieved when it is in the above error state?

There are some chips that can be made inaccessible to JTAG. Those chips are all LPC2xxx parts, as after reset, some piece of code gets executed anyway, and this can turn JTAG off. The only solution is to erase the chip via internal bootloader. All “typical” chips can always be controlled with JTAG (if no JTAG-disabling-security is enabled).

4/3!!

Thanks, that is the exact issue :smiley:

I still cannot find the exact reason in the code for it disabling JTAG but with help from [keil docs i can at least debug the code.](Documentation – Arm Developer)

It’s been mentioned a couple of times on the LPC2000 forum.

Leon