Help - Search - Members - Calendar
Full Version: Microcontroller programming
MandrivaUsers.org > Advanced Topics > Command Line, Kernel and Programming
neddie
Has anyone tried programming AVR microcontrollers with Mandriva?
When I look in rpm.pbone.net, I see packages called avr-gcc for other distros (Fedora, RedHat):
QUOTE
Name : avr-gcc
Version : 4.1.2
Summary : Cross Compiling GNU GCC targeted at avr
Description : This is a Cross Compiling version of GNU GCC, which can be used to
compile for the avr platform, instead of for the
native i386 platform.
But this package doesn't seem to be available for Mandriva.

All I can find for Mandriva is one called sdcc which doesn't seem to do quite the same thing. Any idea why avr-gcc isn't packaged for Mandriva?
Might it be worth trying a Fedora/RedHat rpm with Mandriva or would I have to compile it from source?
scarecrow
To my poor knowledge avr-gcc is embedded in the kontrollerlab IDE.
Is the latter available for Mandriva? Personally, I do not know and cannot check ATM...
neddie
Hey, that's cool, thanks for the link! 2thumbsup.gif
Unfortunately I can't find that for Mandriva either (only Suse or Fedora) so the same problem applies - try an rpm built for another system or try to build from source, which is better?
It's also not at all obvious from the website whether the kontrollerlab includes avr-gcc or not - it says it uses it, but I can't find anything obvious in the package contents or in the source tar. unsure.gif
Steve Scrimpshire
Here's something you might find useful:

http://mr337.thecoderblogs.com/archives/7
neddie
Thanks Steve, great link! 2thumbsup.gif

At first I thought these things sit on top of the gcc suite, so I could skip the binutils and gcc steps (I've already got them installed via rpm). Then I would just need to compile avr-libc and avrdude and I thought I'd be set. kontrollerlab is already compiled ok and runs.

Alas, I can't compile avr-lib because it needs an avr-compatible compiler (ie, avr-gcc). So it seems I do indeed need to compile both binutils and gcc in their avr forms. Sigh.

I had a quick look in Debian to see what's there and they're all in the repositories, gcc-avr, binutils-avr and avrdude. No kontrollerlab but perhaps for starters I'll try doing it from Debian just to see whether it works or not.
neddie
Update:
I tried again with Mandriva, and I got kontrollerlab and binutils compiled ok, but the compile of gcc for avr borked and I couldn't figure out what the problem was, so that stumped me for the rest of the chain.

Then I tried it in Debian and it all seems to work fine - I installed avr-gcc, avr-binutils, avr-libc and avrdude. I got as far as compiling the C into a .hex file, which seemed to work ok - obviously I won't know for sure until I've uploaded some recompiled code into the chip. But certainly a boatload easier using precompiled packages!

Fun stuff! 2thumbsup.gif
neddie
Update: (in case anyone's interested)
Using Debian everything works perfectly, I can use avrdude to read from and write to the memory of the chip, using KHexEdit to edit the binary files. This is via a (homemade) parallel port cable to an attiny2313.
Plus I can use avr-gcc and the other bits to make a .hex file from the C source (actually just call 'make') and use avrdude to write that generated .hex file to the chip.

So I can do it with Debian, it's just a shame these packages aren't available in Mandriva!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.