Changes between Version 37 and Version 38 of jtag_instructions


Ignore:
Timestamp:
11/24/2020 07:55:23 PM (2 months ago)
Author:
Cale Collins
Comment:

Full cleanse of page.

Legend:

Unmodified
Added
Removed
Modified
  • jtag_instructions

    v37 v38  
    3939
    4040[=#linux-jtag]
    41 == Linux
    4241
    4342** Video:
     
    4645
    4746
    48 The Gateworks {{{jtag_usb}}} utility supports x86 32bit and 64bit Linux systems. Ubuntu is supported, however most x86 Linux distros should work as well.
    49  * ***Virtual Machines (VMs) are not recommended because of things such as timing issues of which many customers have also reported. They may work fine, as long as they allow access to USB devices (ie Virtualbox), but it is recommended to avoid them if possible.***
    50  * Please email support @ gateworks.com with any other questions
     47The Gateworks {{{jtag_usb}}} utility supports x86 32bit and 64bit Linux systems. Ubuntu is recommended, however most x86 Linux distros should work as well.
     48 * ***Virtual Machines should not be used because of potential timing issues which will cause the flash to fail.***
    5149
    5250The most recent version {{{jtag_usbv4}}} supports all Gateworks product families and can be downloaded [http://dev.gateworks.com/jtag/ here]
    5351
    54 The GW16042 JTAG dongle uses a FTDI FT2232C Dual USB-UART/FIFO chip and when enumerated on the USB bus will show as:
     52The Gateworks JTAG dongle uses a FTDI FT2232C Dual USB-UART/FIFO chip and when enumerated on the USB bus will show as:
    5553{{{#!bash
    5654lsusb | grep 0403:6010
     
    5856}}}
    5957
    60 With the Linux kernel {{{ftdi-sio}}} driver installed this will expose two USB serial devices:
     58When 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.
    6159{{{#!bash
    6260ls -l /dev/ttyUSB*
     
    6563}}}
    6664
    67 The first serial device (/dev/ttyUSB0) is used for JTAG and the second device (/dev/ttyUSB1) is connected to the target board's serial console UART. Note that you must remove the Linux ftdi_sio driver (which will remove both of the above serial devices) in order to use the jtag_usb application (see below).
    68 
    69 Note that because the jtag_usb works by loading a small application onto the target processor over JTAG which runs out of SDRAM. Therefore the jtag_usb application will configure SDRAM and occasionally you may need to update to the latest version in order to have support for new boards or memory configurations.
    70 
    71 
    72 References:
     65The 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 [http://dev.gateworks.com/jtag/jtag_usbv4 jtag_usbv4] application.
     66
     67The 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.
     68
    7369 * Latest Linux x86 jtag_usb download: http://dev.gateworks.com/jtag/
    7470
    7571
    7672=== Conflict with ftdi-sio driver
    77 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:
     73The {{{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.
     74
     75To remove the module (prior to programming):
     76
    7877{{{
    7978sudo rmmod ftdi_sio
    8079}}}
    8180
    82 You can determine if the ftdi_sio module is loaded with lsmod:
     81You can determine if the ftdi_sio module is loaded using lsmod:
    8382{{{
    8483lsmod | grep ftdi
     
    8685usbserial              42355  3 ftdi_sio
    8786}}}
    88  * Here the ftdi_sio IS loaded, and we must remove it to use jtag_usb
    89 
    90 If you want to re-load the ftdi_sio module you can either unplug and reconnect the Gateworks JTAG-USB Programmer on the USB bus (which triggers a hotplug event and loads the appropriate driver for the device) or manually load it with a 'sudo modprobe ftdi_sio'.
     87 * Here the ftdi_sio IS loaded, it must be removed to program.
     88
     89If 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}}}.
    9190
    9291
    9392=== Linux permissions on USB device
    94 If you encounter permission errors when running jtag_usb it is likely that you require root privileges to access the USB device via libusb:
     93Serial 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'. 
    9594{{{
    9695$ jtag_usbv4
     
    102101crw-rw-r-- 1 root root 189, 4 Apr  2 06:54 /dev/bus/usb/001/005
    103102}}}
    104  * the above shows that you must be root to read/write to /dev/bus/usb/0
    105 
    106 You can either use 'sudo jtag_usbv4' or 'sudo chmod 666' on the particular directory for the device however its likely that you want to install a udev rule to change the device permissions of this particular device every time its enumerated on the bus. You can do this by adding a udev rule that identifies the VendorID and ProductID of the Gateworks JTAG-USB Programmer and executes a chmod on it:
     103
     104Optionally, 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:
    107105
    108106{{{#!bash
     
    121119}}}
    122120
    123 The above udev configuration works for Ubuntu, however this configuration may vary on other Linux distro's that use something other than udev.
    124121
    125122[=#linux-jtag-flashing]
     
    127124Please 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.
    128125
    129 1. Connect the GW11008 JTAG-USB Programmer to the JTAG header on a Gateworks Single Board Computer using the attached ribbon cable.
    130 
    131 2. Power on the Gateworks Single Board Computer.
    132 
    133 3. Connect the JTAG-USB Programmer to a PC USB port using the supplied USB cable.
    134 
    135 4. If trying to use the JTAG programmer to flash a new .bin binary image to the board, make sure the FTDI module is not loaded:
    136 {{{
    137 sudo rmmod ftdi_sio ; # remove module from running kernel
    138 }}}
    139 
    140 5. Run the JTAG program (jtag_usbv4) with the syntax shown below to program a file to the board:
     1261. Connect the JTAG-USB Programmer to the JTAG header on a Gateworks Single Board Computer using the attached ribbon cable.
     127
     1282. Connect the JTAG-USB Programmer to a PC USB port using the supplied USB cable.
     129
     1303. Verify FTDI module is not loaded.
     131
     1324. Apply power to the Gateworks board.
     133
     1345. Run the JTAG program (jtag_usbv4) with the syntax shown below to program a .bin file to the boards flash:
    141135{{{
    142136./jtag_usbv4 –p <filename>
    143137}}}
    144138  * Optionally you can append 2>/dev/null to redirect error
    145   * Only flash .bin files using the jtag software. (or a .txt file for GSC programming)
     139  * Only flash .bin files using the jtag software. (or a .txt file for [wiki:/gsc#GSCUpdatesGSC programming])
    146140  * The switches –u <filename> –v <filename> are also available but are unnecessary to use when programming flash.
    147   * '''Note''' - For Laguna boards, please do not flash a squashfs file to the board. A proper JTAG binary (.bin file) must be created with instructions [wiki:OpenWrt/building#BuildingJTAGBinaryFile here]
    148   * If you encounter any errors see the [#Troubleshooting Troubleshooting] section below
     141  * If you encounter any errors see the [#Troubleshooting Troubleshooting] section below.
    149142
    150143jtag_usbv4 options:
     
    187180 * FAL: '''JTAG_ID_#00  FAL''' - failure to identify a supported JTAG TAP on the target device - likely you have not powered the target board
    188181 * If while programming a board it gets stuck an invalid image may have locked up the board or the board is not powered on. Please try powering on the board. 
    189  *  JTAG utility stuck at '''Core 0 DRAM 00%''' while programming a Laguna family board - A lockup may have occurred in which a detailed fix may be available.  Please contact Gateworks support at support@gateworks.com.
    190182 *  Flashing a invalid image. There are times when downloading files that the html version was downloaded rather than the file itself.  Check the file extension and file size to be sure you have the correct file.
    191183 *  While programming, if it gets stuck at "Load Debugger: fS3' or fS2, this may mean there are issues with the GSC.  Please re-flash the GSC firmware as demonstrated here: http://trac.gateworks.com/wiki/gsc#GSCUpdates
    192  * Error message: "libgcc_s.so.1 must be installed for pthread_cancel to work”. Try to install gcc-multilib.
     184 * Be sure to always use the latest version of {{{jtag_usbv4}}}, failure to do so can result in the inability to flash.
    193185
    194186
     
    279271[=#windows]
    280272== Windows
    281 **Gateworks no longer maintains the Windows JTAG software and thus it is not recommended.**
    282 
    283 Gateworks recommends using the provided [#Linux Linux] JTAG software as found [#Linux above].
     273
     274=== Programming
     275
     276**Gateworks does not offer JTAG programming software for Windows**
     277If you're limited to using a system which has Windows naively installed consider creating a 'live boot' (with persistance) USB with Ubuntu. 
     278
     279* https://ubuntu.com/tutorials/create-a-usb-stick-on-windows#1-overview
    284280
    285281[=#windows-terminal]
     
    290286To 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.
    291287
    292 Then, start a standard serial connection on that port.  Configure the terminal program for 115,200 baud, 8 data bits, 1
     288Configure the terminal program for 115,200 baud, 8 data bits, 1
    293289stop bit, no parity and no flow control.
    294290
     
    301297
    302298= General Troubleshooting
    303  1. Virtual Machines (VMs) are not recommended because of things such as timing issues of which many customers have also reported. They may work fine, as long as they allow access to USB devices (ie Virtualbox), but it is recommended to avoid them if possible.
     299 1. Do not use a Virtual Machine
    304300 1. If while programming a board it gets stuck an invalid image may have locked up the board or the board is not powered on. Please try powering on the board. 
    305  1. JTAG utility stuck at '''Core 0 DRAM 00%''' while programming a Laguna family board - A lockup may have occurred in which a detailed fix may be available.  Please contact Gateworks support at support@gateworks.com.
    306301 1. Flashing a invalid image. There are times when downloading files that the html version was downloaded rather than the file itself.  Check the file extension and file size to be sure you have the correct file.
    307302 1. While programming, if it gets stuck at "Load Debugger: fS3' or fS2, this may mean there are issues with the GSC.  Please re-flash the GSC firmware as demonstrated here: http://trac.gateworks.com/wiki/gsc#GSCUpdates