Changes between Version 37 and Version 38 of jtag_instructions
- Timestamp:
- 11/24/2020 07:55:23 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
jtag_instructions
v37 v38 39 39 40 40 [=#linux-jtag] 41 == Linux42 41 43 42 ** Video: … … 46 45 47 46 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 47 The 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.*** 51 49 52 50 The most recent version {{{jtag_usbv4}}} supports all Gateworks product families and can be downloaded [http://dev.gateworks.com/jtag/ here] 53 51 54 The G W16042JTAG dongle uses a FTDI FT2232C Dual USB-UART/FIFO chip and when enumerated on the USB bus will show as:52 The Gateworks JTAG dongle uses a FTDI FT2232C Dual USB-UART/FIFO chip and when enumerated on the USB bus will show as: 55 53 {{{#!bash 56 54 lsusb | grep 0403:6010 … … 58 56 }}} 59 57 60 W ith the Linux kernel {{{ftdi-sio}}} driver installed this will expose two USB serial devices:58 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. 61 59 {{{#!bash 62 60 ls -l /dev/ttyUSB* … … 65 63 }}} 66 64 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: 65 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 [http://dev.gateworks.com/jtag/jtag_usbv4 jtag_usbv4] application. 66 67 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. 68 73 69 * Latest Linux x86 jtag_usb download: http://dev.gateworks.com/jtag/ 74 70 75 71 76 72 === 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: 73 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. 74 75 To remove the module (prior to programming): 76 78 77 {{{ 79 78 sudo rmmod ftdi_sio 80 79 }}} 81 80 82 You can determine if the ftdi_sio module is loaded withlsmod:81 You can determine if the ftdi_sio module is loaded using lsmod: 83 82 {{{ 84 83 lsmod | grep ftdi … … 86 85 usbserial 42355 3 ftdi_sio 87 86 }}} 88 * Here the ftdi_sio IS loaded, and we must remove it to use jtag_usb89 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 89 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}}}. 91 90 92 91 93 92 === 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: 93 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'. 95 94 {{{ 96 95 $ jtag_usbv4 … … 102 101 crw-rw-r-- 1 root root 189, 4 Apr 2 06:54 /dev/bus/usb/001/005 103 102 }}} 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 104 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: 107 105 108 106 {{{#!bash … … 121 119 }}} 122 120 123 The above udev configuration works for Ubuntu, however this configuration may vary on other Linux distro's that use something other than udev.124 121 125 122 [=#linux-jtag-flashing] … … 127 124 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. 128 125 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: 126 1. Connect the JTAG-USB Programmer to the JTAG header on a Gateworks Single Board Computer using the attached ribbon cable. 127 128 2. Connect the JTAG-USB Programmer to a PC USB port using the supplied USB cable. 129 130 3. Verify FTDI module is not loaded. 131 132 4. Apply power to the Gateworks board. 133 134 5. Run the JTAG program (jtag_usbv4) with the syntax shown below to program a .bin file to the boards flash: 141 135 {{{ 142 136 ./jtag_usbv4 –p <filename> 143 137 }}} 144 138 * 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]) 146 140 * 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. 149 142 150 143 jtag_usbv4 options: … … 187 180 * FAL: '''JTAG_ID_#00 FAL''' - failure to identify a supported JTAG TAP on the target device - likely you have not powered the target board 188 181 * 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.190 182 * 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. 191 183 * 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. 193 185 194 186 … … 279 271 [=#windows] 280 272 == 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** 277 If 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 284 280 285 281 [=#windows-terminal] … … 290 286 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. 291 287 292 Then, start a standard serial connection on that port.Configure the terminal program for 115,200 baud, 8 data bits, 1288 Configure the terminal program for 115,200 baud, 8 data bits, 1 293 289 stop bit, no parity and no flow control. 294 290 … … 301 297 302 298 = 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 304 300 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.306 301 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. 307 302 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