- AVR-GCC는 AVR에서 Cross Compile을 위해 만든 공짜 컴파일러
- 방법
- 설치 방법
c:\> 에서 avrgcc 폴더로 옮기고
c:\avrgcc>에서 install을 실행 시킨 후 바탕화면의 avr-gcc 배치파일을 이용해 도스창을 열어서 쓴다.
- Makefile 사용법
~cpp
# Simple Makefile
# Volker Oth (c) 1999
include $(AVR)/include/make1
########### change this lines according to your project ##################
HEADER = ../Include
MYLIBDIR =
GCCLIB = $(AVR)/lib/gcc-lib/avr/2.97/avr3
NEWLIB = $(AVR)/lib
#INCDIR means .h file search path
INCDIR = . -I$(HEADER)
#----------------------------------------------
#put the name of the target mcu here (at90s8515, at90s8535, attiny22, atmega603 etc.)
MCU = atmega163
#put the name of the target file here (without extension)
TRG = test
#put your C sourcefiles here
SRC = $(TRG).c \
$ utils.c \
$ global.c \
$ uart.c
#put additional assembler source file here
ASRC =
#additional libraries and object files to link
LIB = $(LIBDIR)/libc.a $(GCCLIB)/libgcc.a $(NEWLIB)/libbfd.a $(NEWLIB)/libiberty.a
#additional includes to compile
INC =
#INCDIR means .h file search path
INCDIR = . -I$(HEADER)
#compiler flags
CPFLAGS = -g -O3 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst)
#linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref
########### you should not need to change the following line #############
include $(AVR)/include/make2
###### dependecies, add any dependencies you need here ###################
all : $(TRG).siz
$(TRG).o : \
$ config.h \
$(TRG).c
$(TRG).siz : $(TRG).elf
avr-size --format=sysv $(TRG).elf > $(TRG).siz
avr-size --format=sysv $(TRG).elf
wr : $(TRG).rom
uisp --STK200 --erase
uisp --STK200 --upload $(TRG).rom
erase :
uisp --STK200 --erase
우우.. 정직아 내껀 왜 안올라가냐.. rom 까지 만들었는데..--; - 떡
device missing or unknown device 라고 나온다. ponyprog 에서 장치를 꼭 163 L 로 해야하나? 163 밖에 없던데..