| Version 41 (modified by , 5 years ago) ( diff ) |
|---|
The Gateworks GW16099 JTAG Adapter is used for flashing firmware to Gateworks Boards as well as serial console access.
This device is used to access Gateworks devices for debugging and developing purposes.
Gateworks provides a software utility application supporting x86 Linux. While JTAG programming is not supported for Windows operating systems you can use the JTAG dongle as a serial console.
References:
The latest Gateworks JTAG Utilities are found here
The header can be identified by looking at the connectors finding word JTAG silkscreened nearby on the PCB.
Stand alone programmer for Ventana / Newport / Venice / Laguna:
GW11033 JTAG Kit, which includes the GW16099
Videos:
The Gateworks jtag_usb utility supports x86 32bit and 64bit Linux systems. Ubuntu is recommended, however most x86 Linux distros should work.
Virtual Machines should not be used due to potential timing issues which will cause the flash to fail.
The most recent version jtag_usbv4 supports all Gateworks product families and can be downloaded here
The Gateworks JTAG dongle uses a FTDI FT2232C Dual USB-UART/FIFO chip and when enumerated on the USB bus will show as:
lsusb | grep 0403:6010 Bus 001 Device 007: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
When connected the module ftdi-sio will expose two USB serial devices, this can be verified using dmesg -w or tail -f /var/log/syslog when the programmer is connected to the workstation.
ls -l /dev/ttyUSB* crw-rw---- 1 root dialout 188, 0 Apr 2 07:04 /dev/ttyUSB0 crw-rw---- 1 root dialout 188, 1 Apr 2 07:04 /dev/ttyUSB1
The first serial device (/dev/ttyUSB0) is used for JTAG, the second device (/dev/ttyUSB1) is for the serial console UART. You must remove the ftdi_sio module in order to use the jtag_usbv4 application.
The jtag_usb works by loading a small application onto the target processor which runs out of the SDRAM. Therefore you may need to update to the latest version in order to have support for new boards or memory configurations.
The jtag_usb application requires that the Linux ftdi_sio kernel module not be loaded to run. You can temporarily unload it, then reload it (ie by hotplugging the jtag dongle) when done if you require it.
To remove the module (prior to programming):
sudo rmmod ftdi_sio
You can determine if the ftdi_sio module is loaded using lsmod:
lsmod | grep ftdi ftdi_sio 39858 1 usbserial 42355 3 ftdi_sio
If you want to re-load the ftdi_sio module you can unplug and reconnect the Gateworks JTAG-USB Programmer on the USB bus (which triggers a hotplug event and reloads the module), or manually load it with sudo modprobe ftdi_sio.
Serial devices are part of the 'dialout' group therefore require root permissions. The following errors can be resolved by issuing the jtag_usbv4 command as 'root'.
$ jtag_usbv4 libusb couldn't open USB device /dev/bus/usb/001/005: Permission denied. libusb requires write access to USB device nodes. libusb couldn't open USB device /dev/bus/usb/001/005: Permission denied. libusb requires write access to USB device nodes. $ ls -l /dev/bus/usb/001/005 crw-rw-r-- 1 root root 189, 4 Apr 2 06:54 /dev/bus/usb/001/005
Optionally, to create rule to change the device permissions every time it's enumerated on the bus can be done by adding a udev rule which identifies the VendorID and ProductID of the Gateworks JTAG-USB Programmer and executes a chmod on it:
cat << EOF > 51-gateworks-jtag-ftdi.rules # GW16060 Dongle SUBSYSTEM=="usb",ATTR{idVendor}=="0403",ATTR{idProduct}=="6010",MODE="0666",GROUP="users" # GW16061 Gang adapter SUBSYSTEM=="usb",ATTR{idVendor}=="0403",ATTR{idProduct}=="6011",MODE="0666",GROUP="users" EOF sudo mv 51-gateworks-jtag-ftdi.rules /etc/udev/rules.d sudo chmod 655 /etc/udev/rules.d/51-gateworks-jtag-ftdi.rules # cause rules to be re-read and processed (or reboot) sudo udevadm control --reload-rules sudo service udev restart sudo udevadm trigger
Please see above for the download link to the latest jtag_usb executable. Note that an update may be required for new board models or memory configurations.
./jtag_usbv4 –p <filename>
jtag_usbv4 options:
| Option | Operation | Notes |
|---|---|---|
| -p | Program Flash device using specified filename | |
| -v | Verify Flash device using specified filename | |
| -u | Upload Flash device using specified filename | Ventana & Newport not supported |
| -m | Program GSC Firmware using specified filename | |
| -x | Verify GSC Firmware using specified filename |
programming a firmware image:
./jtag_usbv4 -p laguna_nor_1408.bin Gateworks JTAG Programmer v4.0 r327 Copyright (C) 2004-2014, Gateworks Corporation, All Rights Reserved Built 08:28:20, Oct 29 2014 Using USB Port Channel # S01 -------------------------------------------------------------------------------- USB Open Rev r0 JTAG_ID #00 CNS JTAG_ID #01 CNS JTAG_ID #02 MSP Core 0 DRAM OK Load Debugger OK Flash Size 16 Flash Erase OK Flash Prog OK
jtag_usbv4, failure to do so can result in the inability to flash.
In order to create a jtagable image for Newport and Ventana products, you need to use the mkimage_jtag script to create a binary file containing flash instructions and content used by the jtag_usbv4 application. You can download the latest version of the script here:
wget http://dev.gateworks.com/jtag/mkimage_jtag chmod +x mkimage_jtag
The usage varies, depending on what you want to program, how, and where. For example, you can create images that only update the boot firmware without touching the rest of flash. In general you provide binary files and details on where to place them and what to erase.
Notes:
jtag_usbv4 to set the eMMC register that specifies the hardware to boot from
-s option invokes the 'scripted' mode which allows you to specify multiple objects
-e option invokes the 'scripted' mode but also instructs jtag_usbv4 to erase the entire part
Examples:
./mkimage_jtag --emmc -e --partconf=user firmware-newport.img@user:erase_all:0-16M > firmware-newport.bin
./mkimage_jtag SPL u-boot.img > uboot.bin
./mkimage_jtag openwrt-ventana-rootfs.ubi > image.bin
./mkimage_jtag SPL u-boot.img openwrt-ventana-rootfs.ubi > image.bin
mkimage_jtag -e SPL@0 u-boot.img@14M env@16M > image.bin
mkimage_jtag -e SPL@0 u-boot.img@14M > image.bin
Once these steps are complete and the bin file has been generated, follow the other instructions on this page to flash this .bin file to the board. Linux instructions for programming are here #linux-jtag-flashing
Troubleshooting:
mkimage_jtag script does not have any file extensions such as txt and be sure is has executable permissions.
Establishing a serial console in Linux instructional video
The JTAG connector on all Gateworks Families includes a serial port.
You may use the device with your favorite linux terminal program (Screen, etc...) at 115,200 baud, 8 data bits, 1 stop bit, no parity and no flow control
Gateworks suggests using the program screen to access the serial console.
Example: open /dev/ttyUSB1 (Note that the device may vary on your system if you had /dev/ttyUSB devices prior to plugging the JTAG adapter into your USB bus)
screen /dev/ttyUSB1 115200,cs8
Troubleshooting:
ls -l /dev/ttyUSB*
sudo apt-get remove --purge modem-manager
Gateworks does not offer JTAG programming software for Windows If you're limited to using a system which has Windows naively installed consider creating a 'live boot' (with persistance) USB with Ubuntu.
You can use a terminal program for windows such as Putty / Hyperterminal to connect to the Gateworks board serially over the JTAG / or serial port as long as the FTDI Virtual COM port drivers are installed on your system:
To see if you have the proper drivers installed simply connect the Gateworks JTAG dongle to your Windows PC and look in the 'Device Manager' application under 'COM Ports' to see if a new serial device was added.
Configure the terminal program for 115,200 baud, 8 data bits, 1 stop bit, no parity and no flow control.
Power the board, and wait for text to output. Hitting the 'Enter' key may also bring up a prompt.
Please see these excellent howto's for various terminal program on Windows:
If still have difficulties, please contact Gateworks support at support@gateworks.com
Please see out JTAG hardware page here: JTAG Hardware PAGE
u-boot
Download all attachments as: .zip