News:

SMF - Just Installed!

Main Menu

Flashing from Linux

Started by ToyKeeper, April 19, 2017, 04:37:34 AM

Previous topic - Next topic

ToyKeeper

Hi, just wondering if anyone has flashed an Atmegatron from Linux?

I figure I can do it with avrdude if I find the right options to specify the programmer and port, shouldn't be much different than when I flash attiny chips.  I haven't used a FTDI cable like this before though, so it might take me a bit to get it to communicate.

paulsoulsby

Ooh you're the first person to ask about Linux! Easy Uploader is written in Qt and I know that can create Linux executables.  I just don't have a Linux boot to install Qt onto to create the file. I'll look into it once I'm back from Superbooth.
Paul

ToyKeeper

After a little experimenting, I found the right options to use.  I had thought it needed a USB-specific device, since "arduino" is configured as a legacy serial device while "arduino-ft232r" seemed more appropriate for this TTL-232R cable, but here is what actually worked:

avrdude -c arduino -P /dev/ttyUSB0 -p m328p -Uflash:w:atmegatron_2.4/AtmegatronV2-4.hex:i

I also had to experiment a little to discover that the atmegatron actually needs to be connected to its normal power supply in order to flash.  On my other devices, the only power at flash time comes from the flashing cable itself.

No special drivers or anything are needed.  Just avrdude.  This was in debian/testing with "apt install avrdude".  I may also have other relevant stuff installed since I use other little Atmel chips regularly, but I don't think any of the other packages are relevant for merely swapping firmware on the atmegatron.

To install factory presets, avrdude has other options to read/write eeprom.  I'll figure that out later.  :)

paulsoulsby

Yes, the 5V rail from the FTDI to the Atmegatron is cut.  I didn't fancy the USB cable trying to power all those LEDs!!  It might draw too much current from the USB.

AVRDUDE command line looks correct.  That's all Easy Uploader is doing via a graphical interface.

The EEPROM read and writes is harder.  The Atmegatron uses the Arduino Optiboot bootloader. This has no implementation for those AVRDUDE EEPROM commands to save space.  So the way that Easy Uploader does it is to:

  • Read a copy of the flash and save to a temp .hex
  • Write a serial->Eeprom .hex application
  • Receive the Eeprom data via serial and write to Eeprom
  • Write the original software from the temp .hex file back into flash
So quite a process!! 
I will look into compiling Easy Uploader for Linux once I'm back from Superbooth.

QM

Hello Paul,

sorry for bumping an old topic, but is there any news on up/downloading the user presets via EEPROM on Linux?

while I still might be one of the very few Linux Atmegatron users, the avrdude command proved working very well indeed and I don't really have another operation system at hand right now...

any information would be greatly appreciated,
best
Matthias

paulsoulsby

Hi - I am really keen to get into using Linux, but I have zero knowledge about it and right now I don't have time (in the middle of developing new synth).  I don't have any Linux machines and even building one seems full of choices (which OS do you use BTW?), let alone working out how to use it!
If I give you the source code for the Easy Uploader, would you be happy to install and run it from Qt?  Qt is free and running it is as simple as opening the project and hitting the green play button. 
cheers, Paul