Difference between revisions of "Sync Box Firmware Upgrade using dfu-programmer"

From MCEWiki
 
(12 intermediate revisions by one other user not shown)
Line 1: Line 1:
This describes how to upgrade [[Sync Box Firmware]] using the free dfu-programmer on linux.  This only applies to the microprocessor; often it is also necessary to upgrade the CPLD.
+
{{Related|Sync Box Firmware}}
 
+
This describes how to upgrade [[Sync Box Firmware]] using the free <tt>dfu-programmer</tt> on linux.  This only applies to the microprocessor; often it is also necessary to upgrade the CPLD.
The https://dfu-programmer.github.io/ software can be installed in Ubuntu like this:
+
__TOC__
 +
== Installation ==
 +
The dfu-programmer software can be installed in Ubuntu like this:
 
  sudo apt-get install dfu-programmer
 
  sudo apt-get install dfu-programmer
  
Make sure your version supports the sync box device:
+
Make sure your version supports the sync box device (<tt>at89c5131</tt>):
 
   
 
   
  act@wilson:~$ dfu-programmer --version
+
  $ dfu-programmer --version
 
  dfu-programmer 0.6.1
 
  dfu-programmer 0.6.1
  act@wilson:~$ dfu-programmer --targets
+
  $ dfu-programmer --targets
 
  targets:
 
  targets:
 
     at89c51snd1c      at89c51snd2c      at89c5130          '''at89c5131'''
 
     at89c51snd1c      at89c51snd2c      at89c5130          '''at89c5131'''
Line 14: Line 16:
 
     ...
 
     ...
  
Connect the sync box to the computer over USB.  From [http://www.phas.ubc.ca/~mce/mcedocs/hardware/tech_description/SyncBox_UserGuide_S589_502.pdf  the manual]: "To reprogram BLJB or to get the bootloader to restart so that you can download new code, the
+
== Programming ==
PSEN and RESET switches must be held down while the USB connector is inserted. Reset is
+
See [[Sync Box firmware#Enabling reprogramming over USB|the procedure on the Sync Box firmware page]] for instructions on how to get the bootloader to enter reprogramming mode.  This will cause it to present itself as a USB device to your computer. When the device is properly detected, it will show up in <tt>lsusb</tt> as something like:
then released followed by PSEN. "
+
$ lsusb
 +
Bus 002 Device 049: ID 03eb:2ffd Atmel Corp. at89c5130/c5131 DFU bootloader
  
When the device is properly detected it will show up in <tt>lsusb</tt> as something like:
+
In some versions of dfu-programmer, you must specify the USB bus and device address (2 and 49, respectively, in this example) along with the part name.  In others, you must not specify that information.  So the address will either look like "at89c5131" or "at89c5131:2,49". The latter syntax is assumed below.
  act@wilson:~$ lsusb
 
Bus 002 Device 049: ID 03eb:2ffd Atmel Corp. at89c5130/c5131 DFU bootloader
 
  
 
To prove things are working, dump the contents of the device into a file:
 
To prove things are working, dump the contents of the device into a file:
  
  act@wilson:~$ sudo dfu-programmer at89c5131:2,49 dump > part_dump.bin
+
  $ sudo dfu-programmer at89c5131:''<USB_BUS>'',''<USB_DEVNUM>'' dump > part_dump.bin
 +
 
 +
where ''<USB_BUS>'' is the bus number from <tt>lsusb</tt> and ''<USB_DEVNUM>'' is the device number from <tt>lsusb</tt>. For the example <tt>lsusb</tt> output above, this would give us:
  
Note that we read the address '''2,49''' from the lsusb output. The contents of part_dump.bin can then be inspected with <tt>hexdump -C</tt> to confirm it's the sync box code and not some other nonsense.
+
$ sudo dfu-programmer at89c5131:2,49 dump > ./part_dump.bin
 +
 
 +
The contents of part_dump.bin can then be inspected with <tt>hexdump -C ./part_dump.bin</tt> to confirm it's the sync box code and not some other nonsense. (It's also good to keep a copy of the previous program; if the new program doesn't work, you can always revert.)
  
 
Then to program the device the syntax is:
 
Then to program the device the syntax is:
  act@wilson:~$ sudo dfu-programmer at89c5131:2,49 flash sync_box_v22_26sept2014.hex
+
  $ sudo dfu-programmer at89c5131:''<USB_BUS>'',''<USB_DEVNUM>'' flash ./sync_box_v22_26sept2014.hex
 +
 
 +
== External links ==
 +
* [https://dfu-programmer.github.io/ dfu-programmer on github]
  
 
[[Category:Sync Box Firmware]]
 
[[Category:Sync Box Firmware]]

Latest revision as of 08:46, 4 May 2017

This describes how to upgrade Sync Box Firmware using the free dfu-programmer on linux. This only applies to the microprocessor; often it is also necessary to upgrade the CPLD.

Installation

The dfu-programmer software can be installed in Ubuntu like this:

sudo apt-get install dfu-programmer

Make sure your version supports the sync box device (at89c5131):

$ dfu-programmer --version
dfu-programmer 0.6.1
$ dfu-programmer --targets
targets:
   at89c51snd1c       at89c51snd2c       at89c5130          at89c5131
   at89c5132          at90usb1287        at90usb1286        at90usb1287-4k
   ...

Programming

See the procedure on the Sync Box firmware page for instructions on how to get the bootloader to enter reprogramming mode. This will cause it to present itself as a USB device to your computer. When the device is properly detected, it will show up in lsusb as something like:

$ lsusb
Bus 002 Device 049: ID 03eb:2ffd Atmel Corp. at89c5130/c5131 DFU bootloader

In some versions of dfu-programmer, you must specify the USB bus and device address (2 and 49, respectively, in this example) along with the part name. In others, you must not specify that information. So the address will either look like "at89c5131" or "at89c5131:2,49". The latter syntax is assumed below.

To prove things are working, dump the contents of the device into a file:

$ sudo dfu-programmer at89c5131:<USB_BUS>,<USB_DEVNUM> dump > part_dump.bin

where <USB_BUS> is the bus number from lsusb and <USB_DEVNUM> is the device number from lsusb. For the example lsusb output above, this would give us:

$ sudo dfu-programmer at89c5131:2,49 dump > ./part_dump.bin

The contents of part_dump.bin can then be inspected with hexdump -C ./part_dump.bin to confirm it's the sync box code and not some other nonsense. (It's also good to keep a copy of the previous program; if the new program doesn't work, you can always revert.)

Then to program the device the syntax is:

$ sudo dfu-programmer at89c5131:<USB_BUS>,<USB_DEVNUM> flash ./sync_box_v22_26sept2014.hex

External links