User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

avrdude

Thu Jul 21, 2016 5:19 am

I managed to screw this up.
I was trying to get spi conection to an AVR chip up and running and I was editing /etc/avrdude.conf
I made the horrible mistake of installing an update to cyberduck which I was using to manage downloads and uploads from the pi so I didn't have to use nano through the ssh terminal.
Unfortunately, the new version of cyberduck did something odd.
It downloaded avrdude.conf and opened it in my editor just fine, but it immediately tried to reupload it to the pi again and failed.
Cyberdunk properly locked up, so I closed it and reopened it. It downloaded avrdude.conf again, and like an idiot I refreshed the copy that was in my editor. It is now blank.
Whatever happened, cyberduck appears to have erased the contents of avrdude.conf entirely, not just on the pi but also the local copy v.v
I check the file on the pi using the ssh terminal and it is indeed now blank, or rather it was until I tried deleting it hopping it would be restored if I did a reinstall of avrdude.
I tried uninstalling and reinstalling avrdude but hat had no effect. So I tried deleting the avrdude.conf entirely and uninstalling and reinstalling avrdude, but that had no effect, so now I am kind of at a loss... How exactly do I restore the file?

And is there an alternative to cyberduck that works on Linux and windows systems and doesn't break every other version because this isn't he first time I've had trouble with it v.v
I have made my statement and I stand by it but I could be wrong.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: avrdude

Thu Jul 21, 2016 5:37 am

Lost Cause wrote:I managed to screw this up ... How exactly do I restore the file?
The teachable moment is, "never modify a file that you have not first backed up".

... the avrdude.conf file is a complicated file. I have two of them... the one in my /etc/avrdude.conf and the sample in my /usr/share/arduino/hardware/tools/avrdude.conf

Maybe you have a backup in your /usr/share directory too ?

Perhaps you did back it up, and you've forgetten that ?

What is your setup? Mine is a raspberry PI that I'm using to program the Atmel328p on the Gertboard. Gordon Drogon setup the avrdude stuff so that it would work with the Gertboard. ?

marcus

<sorry>
marcus
:ugeek:

User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

Re: avrdude

Thu Jul 21, 2016 5:54 am

I was still in the process of trying to get it to work with the avrs.
I had only got as far as checking spi worked with loopback and trying it out with an old spi lcd display from a phone.
I am actualy trying to use the atmega 328p chips to since I have 2 of them. I am hopeful to run them at 3.3v and make use of their adcs without the need for a logic level converter or a voltage divider between the connections to the pi.


Sadly it seems there is no second copy of avrdude here X.x
I still don't understand how reinstalling avrdude didn't restore the config file.

Is avrdude even needed? if I am not mistaking it is primarily to bitbang spi connections, but since the pi has spi connectors can it not opperate as a master or program an avr chip through true spi?
I have made my statement and I stand by it but I could be wrong.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: avrdude

Thu Jul 21, 2016 6:18 am

Lost Cause wrote: I am actualy trying to use the atmega 328p chips to since I have 2 of them. I am hopeful to run them at 3.3v and make use of their adcs without the need for a logic level converter or a voltage divider between the connections to the pi.
That works very well, actually. But, you need the 12Mhz resonator thing (3v3 won't work at 16Mhz) and you need a programmer. I'm using the Raspberry PI and the Gertboard to program my Atmel 328p chips... works great, thanks to Drogon !

marcus

edit: PS some of the avr programming thing is still a mystery to me... there is a 'programming the fuses' or 'burning the fuses' or 'setting the fuses' thing that basically setsup the 328p chip for SPI programming... does not use the arduino bootloader, nor usb. Without setting the fuses for SPI interface you can't even bit-bang it... that's what the avrdude program does , I think...

Gordon Drogon is one of the moderators on the #raspbian channel irc freenode. You might ask him there... sometimes he even responds here too...
Last edited by MarkHaysHarris777 on Thu Jul 21, 2016 6:22 am, edited 1 time in total.
marcus
:ugeek:

User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

Re: avrdude

Thu Jul 21, 2016 6:21 am

MarkHaysHarris777 wrote:
Lost Cause wrote: I am actualy trying to use the atmega 328p chips to since I have 2 of them. I am hopeful to run them at 3.3v and make use of their adcs without the need for a logic level converter or a voltage divider between the connections to the pi.
That works very well, actually. But, you need the 12Mhz resonator thing (3v3 won't work at 16Mhz) and you need a programmer. I'm using the Raspberry PI and the Gertboard to program my Atmel 328p chips... works great, thanks to Drogon !

marcus
I don't have a 12Mhz, but I have a pair of 8Mhz resonators.
I knew I woulkdn't be able to pul of 16Mhz as the datasheet says the voltage plays a big hand in determiniung how fast it can run.
I have made my statement and I stand by it but I could be wrong.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: avrdude

Thu Jul 21, 2016 6:30 am

To get your avrdude.conf file back, you're probably going to have to start over... from scratch.

marcus
marcus
:ugeek:

User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

Re: avrdude

Thu Jul 21, 2016 6:33 am

Hmmm.. Maybe
I still haven't flashed the SD card from my pi zero
Maybe I can set that up the same way I have this one, and copy the file that way?

Oh, since it seems you have been down the same road I'm going any tips or tutorials you can pioint me to that are particularly helpful?
I have made my statement and I stand by it but I could be wrong.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: avrdude

Thu Jul 21, 2016 7:33 am

Lost Cause wrote:Hmmm.. Maybe
I still haven't flashed the SD card from my pi zero
Maybe I can set that up the same way I have this one, and copy the file that way?

Oh, since it seems you have been down the same road I'm going any tips or tutorials you can pioint me to that are particularly helpful?
Well, I can point you to the stuff that gordon Drogon wrote for the raspberry PI and arduino IDE for the Gertboard... basically, what he did was to setup the aduino IDE on the PI to talk to the Gertboard 328p using SPI... avrdude... was used to setup the Atmel chip so that the IDE could talk to it via SPI vs using the arduino bootloader. You can find gordons stuff on his projects page... just search for gordonDrogon projects.

marcus
marcus
:ugeek:

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: avrdude

Thu Jul 21, 2016 7:36 am

Lost Cause wrote:I still don't understand how reinstalling avrdude didn't restore the config file.
apt-get assumes you want to keep any changes you have made to configuration files, even if you "remove" and "install" the corresponding package. However, "purge" and "install" will restore the package's default files.

If a package is more fundamental then purging it might not be the best idea. In that case you can get apt-get to prompt you about missing or edited configuration files with the horrifically complex command:

Code: Select all

sudo apt-get -o Dpkg::Options::=--force-confask install --reinstall avrdude

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: avrdude

Thu Jul 21, 2016 7:39 am

Gordon's pages are down at the moment...

marcus
marcus
:ugeek:

User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

Re: avrdude

Thu Jul 21, 2016 7:44 am

Yay!!!
Thank you jojopi.
That cleared the error and fixed the missing file ^.^
I knew there had to be a simpler way to recover the file.

And thanks MarkHaysHarris777 too.
I shall have a poke about and see what I can find of those.
MarkHaysHarris777 wrote:Gordon's pages are down at the moment...

marcus
Well spoot.
I'm no no hurry anyway.
I can wait ^.^
I have made my statement and I stand by it but I could be wrong.

User avatar
Lost Cause
Posts: 30
Joined: Sat Aug 02, 2014 2:44 pm
Location: Ireland

Re: avrdude

Thu Jul 21, 2016 2:51 pm

It's alive!
It's alive!!!!!
I have made my statement and I stand by it but I could be wrong.

Return to “Troubleshooting”