tags:

views:

245

answers:

2

This tutorial for programming these starts with programming the Ravens and Jackdaw with a Windows box. Can I do those initial steps with avrdude on a Linux or OS X machine instead? If so, how? Is there any risk of bricking the hardware if I just try?

I have a USB JTAG ICE MKii clone, which is supposed to work for this.

I'm totally new to AVR, but very experienced with C/C++ programming on Linux or OS X, up to and including kernel programming... so any hint at all would be appreciated, I can read man pages, but only if I know what I'm looking for.

A: 

You can always try. Maybe try virtualbox so you can run windows in linux or mac.

Evert
Marked correct for the try... but see my actual answer below.
Andrew McGregor
A: 

Actually, I should have come back to this long since and posted my solution.

Yes, you can do this.

avrdude supports everything necessary, but there's a trick: the Raven won't successfully flash if you don't erase both processors first. So, first step, erase the device.

Then (this example is for the Jackdaw usb stick, but the same steps work for each processor in the Ravens too):

avr-objcopy -O ihex -j .eeprom ravenusbstick.elf ravenusbstick-eeprom.hex
avr-objcopy -v -O ihex -R .eeprom -R .fuse ravenusbstick.elf ravenusbstick.hex
sudo avrdude -u -p usb1287 -c jtagmkII -v -P usb -Uefuse:w:0xFF:m -Uhfuse:w:0x99:m -Ulfuse:w:0xE2:m -Ueeprom:w:ravenusbstick-eeprom.hex -Uravenusbstick.hex

If this gives an error, remove the line with the error from the hex file and try again. Obviously, use the right processor type and fuse settings.

Andrew McGregor