Release pandAVR


panik

Member
Joined
Sep 21, 2008
Messages
187
Age
53
Location
Netherlands
There are some topics about Arduino and AVR programming the gp2x-forum (search and you will find) [edit: I didn't]. In a Debian extend or Debian-on-SD, getting things running is easy. Simply sudo apt-get install whatever-you-need and there you go. Works perfectly! (Arduino as well).


However, I also wanted to be able to compile and upload AVR programs on the Pandora to an AVR microcontroller in the standard factory default Pandora/Angstrom distro.


In the Angstrom repository, only avrdude is available. To create a fully workable AVR-development environment in Angstrom, we need at least avr-gcc, avr-libc and binutils-avr. So I compiled those from source on the Pandora in Angstrom and created a PND-file. Avrdude comes directly from the Angstrom repo, I didn't compile that one myself. Also 'make' is provided.


The first time you start up the pnd, it'll ask your admin-password. Avrdude wants its configfile in /etc/avrdude.conf. A symlink to the conf-file on the .pnd will be created in /etc. I'll look into fixing that (not sure how yet). It then starts a terminal, from where you can directly call avr-gcc (or a Makefile), avrdude and whatever you need from the AVR-tools.


I ran out of space on my Angstrom-SD card, so I used gcc-core, instead of the 'full' gcc. No programming in C++, only C is supported. No assembly either. Sorry about that. Maybe later. Avra should be easy to include if I (or someone) can get it to compile.


To test, plug your AVR-programmer in the USB-hub. Copy 'share/doc/avr-libc-1.7.1/examples' to one of the SD-cards. Navigate to one of the examples and type 'make'. After that, use avrdude to copy the generated hex-file to your microcontroller. I use: 'avrdude -c usbtiny -p atmega32 -P /dev/ttyUSB0 -v -U flash:w:myapp.hex'. Adjust the programmer(-c), part(-p) and hex-file(-U) to your specific needs (You probably know what to do). I have to use sudo to be able to use /tty/USB0, but that should be easy to fix. That is, I fixed it once on my main computer but can't remember how. I tested on a freshly flashed HF5 Pandora. (Some silly mistakes were made in examples/stdio/lcd.c. Look for hd44780_wait_ready() and supply a boolean as an argument. There are a couple of them.)


The PND is pretty big (114 MB), but that's how it is.


Major disclaimer: I'm an idiot. I know nothing. I can hardly believe this actually works the way it does. :)


TODO (don't know when, maybe never):


- read avrdude.conf from the appdata directory


- provide (some) documentation


- use 'full' gcc (not gcc-core)


- include avra (gdb-avr? simulavr? avarice? requests?)


Get the 41 MB tarred/gzipped PND file here. Edit: Use avrtools by urjaman


All your feedback is very welcome.


Picture of my test setup:

pandora_atmega32_800x600.jpg
 
Last edited by a moderator:
Just out of curiosity, how did you manage to not support assembly? Doesn't the compiler depend on as to assemble its output?
 
Point taken :)


'avr-as' is indeed available. As I said, I'm an idiot. I know nothing.


I'll prove it even further: avrtools by urjaman


I could have saved myself the trouble, about 100 MB, embarrassment and have the tools 8 months ago.


:blink:
 
Last edited by a moderator:
Point taken :)


'avr-as' is indeed available. As I said, I'm an idiot. I know nothing.


I'll prove it even further: avrtools by urjaman


I could have saved myself the trouble, about 100 MB, embarrassment and have the tools 8 months ago.


:blink:
I'm really sorry about that. That should've been listed on the wiki software projects list. I think maybe it wasn't because back when it was released, the list's mandate didn't include PNDs for developers yet.
 
Last edited by a moderator:
I'm really sorry about that. That should've been listed on the wiki software projects list. I think maybe it wasn't because back when it was released, the list's mandate didn't include PNDs for developers yet.
Don't be sorry. I should have searched better. Also, I learned a lot.


Thanks for adding urjaman's avrtools to the wiki! (assuming you did that)


:)
 
Back
Top