Difference between revisions of "AVR Development"
Bob Edwards (Talk | contribs) |
Bob Edwards (Talk | contribs) |
||
Line 10: | Line 10: | ||
* binutils-avr - Binary utilities supporting Atmel's AVR targets | * binutils-avr - Binary utilities supporting Atmel's AVR targets | ||
* gcc-avr - The GNU C compiler (cross compiler for avr) | * gcc-avr - The GNU C compiler (cross compiler for avr) | ||
+ | * [http://www.nongnu.org/avr-libc/ avr-libc] - libc for AVR | ||
* gdb-avr - The GNU Debugger for avr | * gdb-avr - The GNU Debugger for avr | ||
* simulavr - Atmel AVR simulator | * simulavr - Atmel AVR simulator | ||
− | * | + | * [[AVRDUDE]] - software for programming Atmel AVR microcontrollers |
All the other usual tools such as make, editors, version control etc. can be used as per any other development project. | All the other usual tools such as make, editors, version control etc. can be used as per any other development project. | ||
Line 51: | Line 52: | ||
== Downloading to target == | == Downloading to target == | ||
− | We use [[ | + | We use [[AVRDUDE]] with either the [[Arduino]]-compatible serial loader already in FLASH and some form of serial interface, such as the [[FT232R]] based USB-serial cables, or a [[Bus Pirate]] connected to the [[Atmel AVR]] 6-pin programming header. |
In the case of the [[AVR Stick]], we use an 8-pin Small Outline Integrated Circuit (SOIC) testclip connected to the [[Bus Pirate]]. | In the case of the [[AVR Stick]], we use an 8-pin Small Outline Integrated Circuit (SOIC) testclip connected to the [[Bus Pirate]]. |
Revision as of 11:36, 30 September 2011
The Atmel AVR micros are well supported in the FOSS world with complete development tool chains such as a C compiler, simulator, debugger, downloader etc.
We prefer to develop in C and use standard Unix command-line tools.
An alternative is to use the Arduino Integrated Development Environment (IDE), which runs on a Java Virtual Machine (JVM) and the coding style is C++ based.
Contents |
Support in Debian GNU/Linux and variants
The Atmel AVR "toolchains" have been available for Debian/Ubuntu Linux for some years. Specifically:
- binutils-avr - Binary utilities supporting Atmel's AVR targets
- gcc-avr - The GNU C compiler (cross compiler for avr)
- avr-libc - libc for AVR
- gdb-avr - The GNU Debugger for avr
- simulavr - Atmel AVR simulator
- AVRDUDE - software for programming Atmel AVR microcontrollers
All the other usual tools such as make, editors, version control etc. can be used as per any other development project.
Makefile template
A template Makefile:
PROJNAME = ... DEVICE = atmega328p CC = avr-gcc INCS = -Iusbdrv -I. CFLAGS = -Wall -Os $(INCS) -mmcu=$(DEVICE) -DDEBUG_LEVEL=0 AVRDUDE = avrdude -p $(DEVICE) -c arduino -P /dev/ftdi_cable1 -b 57600 -v USBDRV_OBJS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o # symbolic targets: all: $(PROJNAME).hex .c.o: $(CC) -c $(CFLAGS) $< -o $@ .S.o: $(CC) -x assembler-with-cpp -c $(CFLAGS) $< -o $@ .c.s: $(CC) -S $(CFLAGS) $< -o $@ %.bin: %.o $(USBDRV_OBJS) $(CC) $(CFLAGS) -o $@ $< $(USBDRV_OBJS) %.hex: %.bin rm -f $@ avr-objcopy -j .text -j .data -O ihex $< $@ flash: all $(AVRDUDE) -U flash:w:$(PROJNAME).hex
Downloading to target
We use AVRDUDE with either the Arduino-compatible serial loader already in FLASH and some form of serial interface, such as the FT232R based USB-serial cables, or a Bus Pirate connected to the Atmel AVR 6-pin programming header.
In the case of the AVR Stick, we use an 8-pin Small Outline Integrated Circuit (SOIC) testclip connected to the Bus Pirate.
External links
- Atmel AVR on Wikipedia