Search This Blog

Sunday, May 22, 2011

OpenOCD and NGX 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 from http://sourceforge.net/projects/libusb-win32/files/
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 from http://www.freddiechopin.info/index.php/en/download/category/4-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 which can be downloaded from http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite.
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


Open OCD 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

1 comments:

Anonymous said...

Seems to be ok, Not bad