Skip to main content
Topic: Linux on an 8-bit AVR (Read 6402 times) previous topic - next topic

Linux on an 8-bit AVR

http://dmitry.co/index.php?p=./04.Thoug ... 0on%208bit
  (sorry, no link, new user)

Ubuntu linux booting on an 8-bit AVR. Took me a while in terms of software. Hardware is interesting too, for example if you've ever wanted 16 MB (yes, MEGA bytes) of ram usable for your AVR, read this. The included code can help you interface a 16MB cheap SDRAM stick to an AVR and use it, for example

Re: Linux on an 8-bit AVR

Reply #1
I editted your post to include the link.

.... :X

Re: Linux on an 8-bit AVR

Reply #2
Thank you very much. Greatly apprciated

Re: Linux on an 8-bit AVR

Reply #3
Hey dmitrygr ,

This is plain awesome :) Thanks for sharing.
I just was wondering how nice it would work on some other platforms (up to the point it become real usable).

I have the Parallax Propeller and the Cypress PSoC5 in mind (and at my hands;) ).
Propeller: 8x 32bit RISC processors (COGs) @ 80MHz
PSoC5: 32-bit ARM Cortex M3 @ 67 MHz

Would be fun to see if this works on any of them and how "useful" it would be.
If I understood right the minimum requirements for your project would be that the target uC has a gcc compiler (or, with most likely even more work, any C compiler), right?

Well there is an alpha-stage gcc for the propeller and Cypress ships there IDEs for the PSoC with gcc.

I gave it a quick trial for the propeller and after bending and a bit symlinking I got compiling started. I added a prop section to your Makefile to set the right parameters for the propeller-gcc compiler and linker.

It end up with
gcc  -Wall -Wextra -o uARM  rt.o math64.o CPU.o MMU.o cp15.o mem.o RAM.o callout_RAM.o SoC.o pxa255_IC.o icache.o pxa255_TIMR.o pxa255_RTC.o pxa255_UART.o pxa255_PwrClk.o pxa255_GPIO.o pxa255_DMA.o pxa255_DSP.o pxa255_LCD.o
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'

but this looks just like one more bending and symlinking step is needed. In fact it seems it start to call again the gcc compiler of the host instead.

Would be glad if you could comment on this :)

BTW. The code from your page did not come with a Makefile but a Makefile.bak
renaming this, back into Makefile let make start
It appears it was looking for cpu.h and cpu.c instead of the given CPU.h and CPU.c but a symlink later
I was able to compile your code without any modification on a i686 machine.

Torwag

Re: Linux on an 8-bit AVR

Reply #4
You need to link in main. If you look at the makefile you'll see that depending on whether you are making a PC or a micro build, wither main_pc.c or main_avr.c is compiled. you need one

it will work on any micro, BUT you'll need to change some code in main (initing peripherals, clocks, interrupte for refresh, etc...) and you'll need to rewrite (in C or in ASM) all code in avr_ASM.S (4 functions). It has: refresh interrupt handler to do refresh, ramRead and ramWrite functions, and sdSpiBute function to address SD card. I already have a much faster version working on a dsPIC33 chip, so it is doable.

Re: Linux on an 8-bit AVR

Reply #5
Hmm,

the file avr_RAM.S seems missing.
any idea?

Re: Linux on an 8-bit AVR

Reply #6
re-download the source. i updated it

Re: Linux on an 8-bit AVR

Reply #7
Hi,
Your website giving 403 forbidden error on access.
Anyways, two days ago I was able to browse your site successfully. I read that you got some 65Khz overall CPU speed while running the AVR overclocked at 24Mhz.
I have a quick question, shouldn't older linux kernel (say v1.0) run faster than ubuntu?
Did you tried to load gnome into the  system (I know lots of p[age faults will occur for that in 16MB Ram)?
Still learning
-Arup