Crossworks and Olimex ARM-USB-OCD

I have made my own PCB with an NXP2138 microcontroller with a JTAG connector. I have problems writing anything to it using the ARM-USB-OCD connector from Crossworks v.1.7. When I try to connect I get the message “Cannot identify target. Check JTAG connections and that the target is powered.”. The JTAG settings in Crossworks are:

  • Fast memory access: Yes

  • Identify target: Yes

  • JTAG Clock Divider: 50

  • nTRST Open Drain: No

If I change “Identify target”-setting to “No”, I am able to connect. However when i try to download an “elf”-file, I get the following feedback:

Executing reset script FLASHReset()

Loading target script file C:\Program Files\Rowley Associates Limited\CrossWorks for ARM 1.7\targets\Philips_LPC210X\Philips_LPC210X_Target.js

Downloading “Loader_rpc.elf” to Olimex ARM-USB-OCD

Programming completed in 23 ms — 228,869 bytes/sec

Programming 5.1 kB of addresses 40000000 — 4000148f

Download complete

Verifying “Loader_rpc.elf” on Olimex ARM-USB-OCD

Verifying completed in 1.2 s — 4,290 bytes/sec

Verifying 5.1 kB of addresses 40000000 — 4000148f

Verify failed

Notice that the programming is successful, but “verify failed”.

I use the ARM-USB-OCD interface on two Olimex boards (H2138 & P2138) and it works with them. But I have also experienced to get the “Cannot identify target…” error there too. The ARM-USB-OCD/Crossworks combination may seem a bit unstable. Sometimes I have got around the problem by uploading a new program with the LPC2000 Flash utility.

Unfortunately I have not designed my own PCB with uart connection so the flash utility is out of the question in this case.

Are there any ways to get working code into the microcontroller?

It’s probably due to poor PCB design. Which JTAG interface are you using? The CrossConnect is very reliable, as is my own parallel port JTAG interface design.

Leon

leon_heller:
It’s probably due to poor PCB design. Which JTAG interface are you using? The CrossConnect is very reliable, as is my own parallel port JTAG interface design.

Leon

I use the Olimex ARM-USB-OCD interface.

leon_heller:
It’s probably due to poor PCB design. Which JTAG interface are you using? The CrossConnect is very reliable, as is my own parallel port JTAG interface design.

Leon

BTW

Could you please say something about what PCB design errors could possibly cause such problems.

Anders

Supply pins not decoupled.

Long JTAG tracks.

JTAG tracks running close to clock signals.

Poor ground and supply routing.

Etc.

Leon

You can also attempt to slow the JTAG clock down.

He’s already tried 1/50.

Leon

Hello Anders,

I suspect you’ve already considered this, but… you could rig up an external serial port level shifter and connect to UART1 and P0.14. Sparkfun sells the PGM-00714.

If the traces are not brought out, you can still attach magnet wire or fine wire-wrap wire if you have a magnifying glass and a fine soldering iron tip and some flux (and a steady hand). There would be some risk.

hsutherl:
Hello Anders,

I suspect you’ve already considered this, but… you could rig up an external serial port level shifter and connect to UART1 and P0.14. Sparkfun sells the PGM-00714.

If the traces are not brought out, you can still attach magnet wire or fine wire-wrap wire if you have a magnifying glass and a fine soldering iron tip and some flux (and a steady hand). There would be some risk.

I have the LPC Serial Port boot loader you are referring to (PGM-00714), but unfortunately the traces are not brought out. The uart1 TX & RX are however quite accessible as they are brought out to another IC with much wider pitch. The BSL (P0.14) is more difficult. It would have to be soldered to the mcu pin. I could try that if that is the only possible solution, as the other alternative is to ditch the pcb.

Thanks for the advice anyway.

Are there any other JTAG programming tools that may work? I looked at the OpenOCD, but it seems quite difficult to configure.

Anders

I’ve soldered wires to the leads of an LPC2106. A microscope helps.

Leon

I have sorted out what was wrong. It turned out to be a couple of design errors. The RESET-pin had to be pulled up to 3.3V for the JTAG-programmer to work properly.

There also was an issue that the microcontroller would not start executing code unless initiated in Crossworks (target reset or debug). The solution here was to pull up P0.14 (BSL).

Thanks for all replies.

Anders