Updating the firmware of an Olimex AVR-ISP500 from Linux

Tags: , , , , , ,

I recently got an Olimex AVR-ISP500 and wanted to upgrade the firmware from my Ubuntu desktop (didn’t really fancy installing any drivers on the Windows machine). Here’s what I had to do:

First, make sure you have lrzsz available:

roshan@optimus $ sudo apt-get install lrzsz
[sudo] password for roshan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  minicom
The following NEW packages will be installed:
  lrzsz
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
Need to get 108kB of archives.
After this operation, 279kB of additional disk space will be used.
Get:1 http://mirror.switch.ch jaunty/universe lrzsz 0.12.21-4.1 [108kB]
Fetched 108kB in 0s (430kB/s)
Selecting previously deselected package lrzsz.
(Reading database ... 293796 files and directories currently installed.)
Unpacking lrzsz (from .../lrzsz_0.12.21-4.1_amd64.deb) ...
Processing triggers for man-db ...
Setting up lrzsz (0.12.21-4.1) ...
roshan@optimus $ 

The AVR-ISP500 starts in firmware-update mode if you have a jumper between pins 1 and 3 of the ICSP10 connector. Plug in the programmer and make sure the status LED continues flashing the sequence green, red, off.

Check /var/log/messages to see what device node is associated with the programmer. On my machine, it turns up as /dev/ttyACM0.

Download the latest firmware from the Olimex AVR-ISP500 page. Unzip the file, and you’ll find the firmware image avr-isp500.img

Run the sx command as shown, making sure to adjust the firmware image file and ports to suit your system. If all goes well, you’ll see the following:

roshan@optimus $ sx -X --16-bit-crc avr-isp500.img > /dev/ttyACM0 < /dev/ttyACM0
Sending avr-isp500.img, 97 blocks: Give your local XMODEM receive command now.
Bytes Sent:  12416   BPS:870                             

Transfer complete
roshan@optimus $ 

I found that it took a few tries to get the timing right, and that if you ran the command too soon it errored out:

roshan@optimus $ sx -X --16-bit-crc avr-isp500.img > /dev/ttyACM0 < /dev/ttyACM0
Sending avr-isp500.img, 97 blocks: Give your local XMODEM receive command now.
Xmodem sectors/kbytes sent:   0/ 0kRetry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Got 01 for sector ACK
Retry 0: Retry Count Exceeded

Transfer incomplete
roshan@optimus $ 

I just repeated the command every time it failed, until it finally "took".

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Comments are closed.