Captain's Universe Home
Captain's Universe Home
Cosmic Ray Muon DetectorTeleGarden Pages
Time on MarsBryophyllum Plants
Jupiter Radio AstronomyAncient Pages
Salzburg Tourist GuideEarth Magnetometer
  H O M E     AJAX & MORE     LINUX & MORE     RTAI     XENOMAI     ADEOS IPIPE      
    JAVA & BROWSERS     *NIX     ELECTRONICS     REVIEWS     ARTEMIA     FAIRY SHRIMP      



Linux Atmel AVR Simulator with GUI

There is the nice simulator VMLAB, which is basically a Windows application, but it runs smoothly in Linux with WINE. Since the avr-gcc version for Windows, WinAVR, did not install in WINE, I used the coff option in VMLAB (set that option when creating a new project).


Making a COFF out of an ELF binary is not supported by avr-gcc (avr-objcopy) by default so you need to look for the "cdk-avr-binutils" for your linux distribution. Most likely there is a package out there.

In order to avoid overwriting of the avr-gcc binaries by the cdk-avr-binutils package, I just unpacked the .deb/.rpm file and used the avr-objcopy binary in a custom directory.


MCU=atmega16
CC=avr-gcc
OBJCOPY=avr-objcopy
# optimize for size:
CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues

TARGET = adc-noise
# path to your VMLAB project directory in WINE
VMLABDIR = ~/.wine/drive_c/avr/adc-noise/
# location path of avr-objcopy which supports the coff-avr option
OBJCOPYCOFF=/path/to/cdk-avr-binutils/avr-objcopy


all: adc-noise.hex
adc-noise.hex : adc-noise.out 
	$(OBJCOPY) -R .eeprom -O ihex adc-noise.out adc-noise.hex 
adc-noise.out : adc-noise.o 
	$(CC) $(CFLAGS) -o adc-noise.out -Wl,-Map,adc-noise.map adc-noise.o 
adc-noise.o : adc-noise.c 
	$(CC) $(CFLAGS) -Os -c adc-noise.c


COFFCONVERT=$(OBJCOPYCOFF) --debugging \
--change-section-address .data-0x800000 \
--change-section-address .bss-0x800000 \
--change-section-address .noinit-0x800000 \
--change-section-address .eeprom-0x810000 

coff: $(TARGET).out
	$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
	cp -f $(TARGET).c $(VMLABDIR)
	cp -f $(TARGET).hex $(VMLABDIR)
	cp -f $(TARGET).cof $(VMLABDIR)

Troubleshooting:
avr-objcopy: adc-noise.cof: Invalid bfd target
Problem: You're not using a coff-avr option enabled avr-objcopy
Solution: Use the "cdk-avr-binutils"







Last-Modified: Tue, 14 Aug 2007 03:56:43 GMT

Google
 
Web www.captain.at
go to top
© 1996-2010 . All rights reserved.
No reproduction, distribution, publishing or transmission of the copyrighted materials at this site is permitted. Policy
go to top