panik
Member
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:
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:
Last edited by a moderator: