WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: avrdude  (Read 7286 times)

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
avrdude
« on: December 17, 2013, 05:32:17 PM »
Hi,

First and foremost - Great work on this excellent distro.

I'm not exactly an expert at anything so have been mudling through to try and build an embedded home automation system.

I started off with PiCorePlayer which is great, just a few too many tweaks tho so I decided to go back to basics - im a bit of a control freak.

Anyhow, I have got python and various 3rd party modules up and running and have got a good stable platform with my cloud-based control system linked to a python "node" on PCL and finally directing instruction to an atmega328p to read sensors, control RF, etc etc.

Now, I really would like to be able to update the MCU firmware "over the air" so to speak and for this I would like to use avrdude as a standalone package.

Now I have tried manually installing it, which after loading libusb-compat seems to allow it to run ok.

However I am getting the following error:
Code: (shell) [Select]
$ avrdude -C /etc/avrdude.conf -p atmega328p -P /dev/ttyAMA0 -c arduino -b 57600 -D -U flash:w:aiopi.hex:i
avrdude: error at line 610 of /etc/avrdude.conf: pin must be in the range 1-255

Would anyone be able to point me in the right direction or do me a massive favour and make a TCZ for me?

I don't need hand holding but some kind of guidance would be great.

TIA

Luke

update: I'm on 5.1.rc3 btw. Helps to give you all the right info :)
« Last Edit: December 17, 2013, 05:43:30 PM by zoomzoomluke »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: avrdude
« Reply #1 on: December 17, 2013, 08:00:49 PM »
Hi zoomzoomluke
The first thing I would do is see what's on line 610 in  /etc/avrdude.conf

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #2 on: December 17, 2013, 11:04:05 PM »
Yes, share avrdude.conf with us
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #3 on: December 18, 2013, 12:38:16 AM »
BTW, a friend of mine is using a modified avrdude on Raspberry with SPI interface, code is here:

https://github.com/kcuzner/avrdude

You can see what he did here (in Hungarian, but you can understand it using an online translator, or contact author):

http://forum.xham.org/index.php?topic=183.0
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #4 on: December 18, 2013, 02:02:58 AM »
Yes, share avrdude.conf with us


The avrdude.conf is extracted from the deb file here:

http://project-downloads.drogon.net/gertboard/avrdude_5.10-4_armel.deb
from this project: https://projects.drogon.net/raspberry-pi/gertboard/arduino-ide-installation-isp/

It doesnt appear as though line 610 has an relation to the reported error:

Code: [Select]
606: programmer
607:   id    = "gpio";
608:   desc  = "Use sysfs interface to bitbang GPIO lines";
609:   type  = gpio;
610:   reset = 8;
611:   sck   = 11;
612:   mosi  = 10;
613:   miso  = 9; 
614:  ;

I will take a look at the code posted...

I really was hoping to avoid building from source as i wanted to keep tcl as clean as possible and don't have a build environment set up on my mac yet.

Maybe i'm over complicating things?
« Last Edit: December 18, 2013, 05:14:22 AM by zoomzoomluke »

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #5 on: December 18, 2013, 04:04:14 AM »
Turns out I don't need the SPI modified version....

So trying to install the vanilla armel version...

http://packages.debian.org/squeeze/avrdude

and i get more cryptic errors:

Code: [Select]
avrdude: error at /etc/avrdude.conf:696: must specify page_size for paged memory

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #6 on: December 18, 2013, 05:13:58 AM »
right, a bit of progress :)

avrdude depends on libc6 also, which again is not in the repo atm ;)

so i extracted libc6 from libc6_2.11.3-4_armel.deb and dumped the output to /

well, avrdude now works... but with a bit of a negative side effect

Code: [Select]
tc@aiopi-core:~$ avrdude -C /etc/avrdude.conf -p atmega328p -P /dev/ttyAMA0 -c arduino -b 57600 -D -U flash:w:aiopi.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file "aiopi.hex"
avrdude: can't open input file aiopi.hex: No such file or directory
avrdude: write to file 'aiopi.hex' failed

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

tc@aiopi-core:~$ ls
Segmentation fault

obviously i really screwed up somewhere

if someone could really kindly package libc6 it would be really really appreciated since it's got so many files i wouldn't know where to start with regards to making a custom package.

Luke

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #7 on: December 18, 2013, 05:22:43 AM »

avrdude depends on libc6 also, which again is not in the repo atm ;)


It is not in the repo, it is part of the system. There is

Code: [Select]
/lib/libc.so.6
In fact running an alien binary you may expect enything and no guarranty it works du missing or different dependencies, locations, etc. Better to have application compiled in the native target os.

It compiles just fine in piCore, I can add a version to repo for testing if you are interested.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #8 on: December 18, 2013, 05:37:31 AM »
see told you i don't know what i'm doing!

that would explain why no complaint of missing lib when running avrdude

if you wouldnt mind adding a native ver of avrdude to repo that would be amazing :)  not sure i got the skills to compile and package it myself especially as i dont have a cross compiler set up and am not in a position to install make on my target image.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #9 on: December 18, 2013, 05:47:17 AM »
Will add to the repo both native 6.0.1 and the SPI fork
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #10 on: December 18, 2013, 06:32:12 AM »
Will add to the repo both native 6.0.1 and the SPI fork

Thank you :)

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #11 on: December 19, 2013, 06:39:37 AM »
avrdude 6.0.1 added to repo. Don't forget to copy /usr/local/etc/avrdude.conf.sample to /usr/local/etc/avrdude and edit according to your wish, and of cource add to your backup.

Let us know the result.

It is the original version, the RPi SPI version will come.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline zoomzoomluke

  • WikiUser
  • *
  • Posts: 7
Re: avrdude
« Reply #12 on: December 20, 2013, 01:46:17 PM »
Let us know the result.

Working perfect, thank you!

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #13 on: December 20, 2013, 03:37:35 PM »
Thanks for the feedback!
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7179
    • My Community Forum
Re: avrdude
« Reply #14 on: December 21, 2013, 12:52:27 AM »
avrdude-spi.tcz added to repo. It is a fork of with Raspberry Pi SPI support.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."