content/prologix.rst

changeset 109
96e9f64b86ed
parent 56
3d0bed1a79c8
child 115
6b6e13653348
equal deleted inserted replaced
108:08c0c0d695e8 109:96e9f64b86ed
23 because it was really cheap, and very useful for hobbyist like me). 23 because it was really cheap, and very useful for hobbyist like me).
24 24
25 25
26 Upgrading the buggy firmware 26 Upgrading the buggy firmware
27 ============================ 27 ============================
28 28
29 My controller had the version 5.2 of the firmware, which really is 29 My controller had the version 5.2 of the firmware, which really is
30 buggy. For example if a device on the GPIB bus is continuously sending 30 buggy. For example if a device on the GPIB bus is continuously sending
31 data and the controller is in "auto" mode (in which it automatically 31 data and the controller is in "auto" mode (in which it automatically
32 perform a reading of the available data), then it was impossible to 32 perform a reading of the available data), then it was impossible to
33 send it commands anymore. 33 send it commands anymore.
39 However, the `directory serving all the firmwares`_ for their products 39 However, the `directory serving all the firmwares`_ for their products
40 still have the firmwares for this device. The latest published version 40 still have the firmwares for this device. The latest published version
41 is the `4.2-6.95`_ (in fact, it's the version 6.95 of the firware for 41 is the `4.2-6.95`_ (in fact, it's the version 6.95 of the firware for
42 the version 4.2 of the USB-GPIB controller). 42 the version 4.2 of the USB-GPIB controller).
43 43
44 The content of this archive is:: 44 The content of this archive is:
45 45
46 unzip -l ~/Downloads/gpib-usb-4.2-6.95.zip 46 .. code-block:: bash
47
48 unzip -l ~/Downloads/gpib-usb-4.2-6.95.zip
47 Archive: /home/david/Downloads/gpib-usb-4.2-6.95.zip 49 Archive: /home/david/Downloads/gpib-usb-4.2-6.95.zip
48 Length Date Time Name 50 Length Date Time Name
49 --------- ---------- ----- ---- 51 --------- ---------- ----- ----
50 244837 2007-07-08 23:57 avrdude.conf 52 244837 2007-07-08 23:57 avrdude.conf
51 186880 2007-07-08 23:57 avrdude.exe 53 186880 2007-07-08 23:57 avrdude.exe
67 69
68 Now, the question is: how is the AVR programmed? There are dozens of 70 Now, the question is: how is the AVR programmed? There are dozens of
69 'backends' available on avrdude. 71 'backends' available on avrdude.
70 72
71 Doing a ``string`` on the main exe in the archive, PxUpdate.exe, 73 Doing a ``string`` on the main exe in the archive, PxUpdate.exe,
72 shows a few interesting things, especially this:: 74 shows a few interesting things, especially this:
75
76 .. code-block:: bash
73 77
74 strings PxUpdate.exe | grep -i avr 78 strings PxUpdate.exe | grep -i avr
75 avrdude.exe -p %s -P \\.\COM%d -c avr109 -u -e -U flash:w:%s 79 avrdude.exe -p %s -P \\.\COM%d -c avr109 -u -e -U flash:w:%s
76 AVRBOOT 80 AVRBOOT
77 81
82
78 So we know the command line used by this firmware update tool, and we 83 So we know the command line used by this firmware update tool, and we
79 known it uses the AVR's bootloader as decribed in the AVR109_ 84 known it uses the AVR's bootloader as decribed in the AVR109_
80 application note. 85 application note.
81 86
82 But any attempt to read the content of the flash using:: 87 But any attempt to read the content of the flash using:
88
89 .. code-block:: bash
83 90
84 avrdude -p m164p -c avr109 -U flash:r:flash.hex:i 91 avrdude -p m164p -c avr109 -U flash:r:flash.hex:i
85 92
86 fails stating the avr does not respond:: 93 fails stating the avr does not respond:
94
95 .. code-block:: bash
87 96
88 avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:r:flash2.hex:i 97 avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:r:flash2.hex:i
89 98
90 avrdude: Version 6.1, compiled on Sep 11 2014 at 20:00:34 99 avrdude: Version 6.1, compiled on Sep 11 2014 at 20:00:34
91 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ 100 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
129 Description : Atmel AppNote AVR109 Boot Loader 138 Description : Atmel AppNote AVR109 Boot Loader
130 139
131 Connecting to programmer: .avrdude: ser_recv(): programmer is not responding 140 Connecting to programmer: .avrdude: ser_recv(): programmer is not responding
132 avrdude: butterfly_recv(): programmer is not responding 141 avrdude: butterfly_recv(): programmer is not responding
133 142
134 143
135 So there is something else required to put the device under firmware 144 So there is something else required to put the device under firmware
136 upgrade state. I was wondering if there is an undocumented controller 145 upgrade state. I was wondering if there is an undocumented controller
137 command (anything starting with ``++`` is interpreted as a controller 146 command (anything starting with ``++`` is interpreted as a controller
138 command), so I searched for the ``++`` string in ``PxUpdate.exe``:: 147 command), so I searched for the ``++`` string in ``PxUpdate.exe``:
148
149 .. code-block:: bash
139 150
140 strings PxUpdate.exe | grep ++ 151 strings PxUpdate.exe | grep ++
141 Microsoft Visual C++ Runtime Library 152 Microsoft Visual C++ Runtime Library
142 ++rst 153 ++rst
143 154
144 No magic undocumented command, but a reset of the controller is 155 No magic undocumented command, but a reset of the controller is
145 performed by this tool. Let's try this:: 156 performed by this tool. Let's try this:
146 157
147 stty -F /dev/ttyUSB0 speed 115200 cs8 -cstopb -parenb 158 .. code-block:: bash
159
160 stty -F /dev/ttyUSB0 speed 115200 cs8 -cstopb -parenb
148 echo -en '++rst\r' > /dev/ttyUSB0; avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:r:flash2.hex:i 161 echo -en '++rst\r' > /dev/ttyUSB0; avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:r:flash2.hex:i
149 avrdude: Version 6.1, compiled on Sep 11 2014 at 20:00:34 162 avrdude: Version 6.1, compiled on Sep 11 2014 at 20:00:34
150 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ 163 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
151 Copyright (c) 2007-2014 Joerg Wunsch 164 Copyright (c) 2007-2014 Joerg Wunsch
152 165
161 PAGEL : PD7 174 PAGEL : PD7
162 BS2 : PA0 175 BS2 : PA0
163 RESET disposition : dedicated 176 RESET disposition : dedicated
164 RETRY pulse : SCK 177 RETRY pulse : SCK
165 serial program mode : yes 178 serial program mode : yes
166 179
167 parallel program mode : yes 180 parallel program mode : yes
168 Timeout : 200 181 Timeout : 200
169 StabDelay : 100 182 StabDelay : 100
170 CmdexeDelay : 25 183 CmdexeDelay : 25
171 SyncLoops : 32 184 SyncLoops : 32
211 224
212 avrdude: writing output file "flash2.hex" 225 avrdude: writing output file "flash2.hex"
213 226
214 avrdude done. Thank you. 227 avrdude done. Thank you.
215 228
216 Much better! 229 **Much better!**
217 230
218 Now I can upgrade the firmware:: 231 Now I can upgrade the firmware:
232
233 .. code-block:: bash
219 234
220 echo -en '++rst\r' > /dev/ttyUSB0; avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:w:m164.hex 235 echo -en '++rst\r' > /dev/ttyUSB0; avrdude -P /dev/ttyUSB0 -p m164p -c avr109 -v -v -U flash:w:m164.hex
221 236
222 Et voilĂ ! The Prologix GPIB-USB interface is upgraded to the latest 237 Et voilĂ ! The Prologix GPIB-USB interface is upgraded to the latest
223 available software. From what I've seen so far, it seems more stable 238 available software. From what I've seen so far, it seems more stable
224 (at least I can read data from my HP5442A and HP3456A in "fast" mode 239 (at least I can read data from my HP5442A and HP3456A in "fast" mode
225 without loosing my GPIB controller.) 240 without loosing my GPIB controller.)
226 241

mercurial