Samuel Jacob's Weblog

Just another technical blog

OpenOCD and NGX USB ARM JTAG

with one comment

NGX’s USB ARM JTAG

NGX’s USB ARM JTAG

This post describes the steps needed to make NGX’s USB ARM JTAG to work with OpenOCD in windows 7. This JTAG is compatible with colink JTAG and works with IAR Workbench and Keil uVision. To use with these IDEs there is a well defined methods/plug-ins available in the product page and in internet. However to use this JTAG with OpenOCD there is scarce resource in the internet.

OpenOCD can be used to low level debugging, source level debugging (through GDB) and can be used for flashing. OpenOCD exposes a command line interface which can be accessed through telnet. It also provides remote GDB server which also can be reached through TCP connection.

Steps needed for Windows:

  1. Plug-In the JTAG to a available USB connector
  2. Download libusb-win32
  3. Extract libusb-win32 to a folder and run “inf-wizard.exe”
  4. Select “USB Serial Converter A” and install driver
  5. Download and install OpenOCD
  6. Attach the JTAG probe to your target ARM board and poweron the target board
  7. Create a openocd configurations file (see at the end)
  8. Run openocd.exe –f
  9. Run putty or telnet and connect to port localhost:4444

After this the target board will respond to JTAG commands which can be issued through the telnet session.

For GDB debugging, you need a cross compiled GDB(arm-none-eabi-gdb).
After launching arm-none-eabi-gdb.exe run target remote localhost:3333 to start remote debugging.
You can execute low level JTAG commands from GDB by using monitor command.

Flashing can be done using the following commands:

reset
halt
sleep 200
wait_halt
flash probe 0
flash info 0
flash write_image erase unlock
sleep 200
reset run

OpenOCD configuration file:

# openocd configurations
telnet_port 4444

# gdb configuration
gdb_port 3333

# cpu configuration
source [find target/lpc1768.cfg]

# interface configuration
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "NGX JTAG"
ft2232_layout "oocdlink"
ft2232_latency 2

Written by samueldotj

May 22nd, 2011 at 6:04 am

Posted in C,Compiler,Debugger