I have been using the ULINK, uVision3 and the MCB2130 board for a couple months now with no problem. Now I got my first prototype hardware using an LPC2131 and I am not able get the JTAG to work. I get the "JTAG Communication failure" error message. I magically got one to work about 3 times in the past week (3 out of 100). I really can't explain that. I have tried 4 different boards, all the same. I put the long wait state at the beginning of main. I have tried changing the jumper in the ULINK and all the other suggestions from the Keil knowledgebase. I have been able to use the Philips utility to load my code in thru UART0, works fine. The LPC2131 boots up and runs great. In my code I spit out lots of messages to the serial port(to hyperTerminal) so I have verified that the processor is running and doing what it is supposed to do (I have verified I2C, SPI, ADC, UART0, GPIO are all working properly). Watchdog is disabled. Low/Idle power mode is not used and disabled and I am not using the RTC. Everything points to my hardware right!! I know. The one big difference between my hardware and the MCB is clock freq. My board uses a 12.288MHz crystal. I have made the changes to the PLL registers and target freq. I believe all the settings are correct. I use the same interface circuit as the MCB, with 10K pull-ups and pull-downs, with a good clean 3.3V supply. I think I have verified most of the obvious dumb stuff (famous last words), i.e. shorted/open traces, power, gnd,...etc. The only idea I am left with is my layout is too long or noisy? Has anyone else experienced this? I am pretty tight on board space so I don't have room for the big dual row 20-pin header. The ULINK connects to a small dongle board, then a small 14-pin cable takes the signals down to my board. The header on my board is about 1.5 inches away from the LPC2131. Most of the lines are a straight shot, except for the TMS line which runs around and goes under the 12.88MHz crystal and driver. (Yes, I will fix that on the next board spin). Could this less-than-ideal-layout be the problem?????? Should I add buffers to the lines on my dongle board??? Please help. Any input would be greatly appreciated. Thanks, Dave Butler
ULINK does not have high requirements on the communication lines. So there should be no problem with your lines. Did you actually enable the JTAG interface (pulldown resistor J9/R27). What about the pullup/pulldown resistors? Reinhard
You're not alone. Exactly the same happens to my PCBs using the LPC2119. The pins P1.26-31 works fine in GPIO mode as input or output but in JTAG mode they don't. There is always a Low at TDO and RTCK, nothing is happen at this 2 pins in JTAG mode. I changed the crystal to 12MHz on 1 of 3 Eval Boards (CAN bus timing) and it doesn't matter. I'm currently without any idea and need also a solution.
Thanks for the response. I assume you mean the J9 jumper on the MCB? Yes, the JTAG on the MCB works fine, no problem, every time. The problem I am having is on my prototype board only. I basically copied the JTAG interface from the MCB. I have a 10k pull-up on TRST,TDI,TMS,TDO and a 10k pull-down on TCK and ERTCK. When I scope the lines and hit debug, I see signal on TRST and TCK, but nothing ever comes back on ERTCK.
This is indeed a very frustrating position to be in. My development was making great progress until I got proto hardware and now have no JTAG. I hope we can figure something out. I still have a lot of routines and algorithms to work out in my design and not much time to get it done. I am still going to try and move the dongle JTAG connecter so it is right next to the processor on the next board spin. Good Luck Dave Butler
We cannot see why ULINK cannot work with your hardware boards. We did not make any special on the MCB21xx boards and we have several customers that are using ULINK with own hardware. Philips LPC2000 is actually not very critical with JTAG debugging, but JTAG can be disabled by a wired user program. Take a look to: http://www.keil.com/support/docs/2993.htm http://www.keil.com/support/docs/2935.htm Reinhard
I have figured out that the JTAG interface is disabled if pin P0.31 is pulled low after a reset. This is not documented in Philips manual. The problem can easily be duplicated with MCB2130. If pin P0.31 is pulled low with 20Kohm resistor after a reset, JTAG interface does not work. Please check your design for pin P0.31 It needs to be high, othervise the JTAG interface is disabled for some of LPC21xx devices. Franc
Thank you Franc, but I use the LPC2119 witout P0.31. So I've problems pulling this pin to anything. But may be just configuring it as output and write a H-level works. @Reinhard The two links helped few weeks ago getting the JTAG running at the MCB2100. The ULINK works well and the problem happens also with erased flash. Günter
P0.31 has an internal pull-up. The problem only exists when you have an external load on this pin. Does the your user hardware still not work? Do you have the option to connect with the serial Philips loader tool? Reinhard
@Reinhard There is no pin available for P0.31. So I'm sure a haven't pulled it low. The hole hardware works as expected and can be loaded with the Philips Flash tool. Than I wrote a small test program to handle the JTAG pins P0.26-31 as GPIO. In this mode I can read when inputs and write when outputs. All resistors are correct. I think it's a internal problem from the LPC. The crazy thing is, that JTAG works for few minutes at one of ten boards?!? Günter
Sounds like a CLOCK problem. Is the XTAL stable on the boards?
Hello, Thanks for the suggestion Franc. On my board(LPC2131), P0.31 has a 1k pull up to 3.3V and I have verified that it does not go low after a reset. I am using it as a reset line for a peripheral chip and currently just keep it high all the time. In regards to the XTAL, I am using an external 12.288MHz crystal with a buffer circuit. The output of the buffer has a 100 ohm resistor and drives XTAL1 thru a 100pF cap (as recommended in the manual). The signal looks very clean. XTAL2 is left unconnected. I am starting to suspect a timing issue somewhere in software/firmware. Just a gut feeling?? I will post anything if I find it. Thanks for the suggestions, Dave
I don't think that the software is responsable. I've tested it with erased flash and the JTAG won't work. And I tested it with power off and on to avoid storage things inside the LPC. It looks like the fault happens before the firmware starts running. Comparing the voltage levels at all pins be asserting reset between Keil MCB2100 and the new PCB may be bring light in the darkness. Günter
Günter Thanks, that is a good idea. I will let you know what I find. Dave
All, Problem is fixed. JTAG works on my proto hardware. The JTAG (P1.36-26) pins were configured for GPIO instead of debug. In the PINSEL2 register I had to set bit #2. That did it. All is well now, but I still do not understand why the JTAG worked on the MCB eval board?? I was not setting PINSEL2 bit 2 in my code. Does the LPC2138 not need to have this bit set, where the LPC2131 does? Thanks for your help and suggestions. Dave Butler
Nice to hear. But my JTAG don't work without firmware. So the problem is not really solved, but I'm working on it. Günter