아두이노
avrdude 실행 파일과 avrdude.conf 파일
'김용환'
2011. 12. 30. 14:42
과거에 임베디드 시스템을 개발 및 포팅할 때는 컴파일과 업로드(버닝) 이렇게 두가지를 사용했다. 컴파일할 때는 크로스 컴파일러 쓰고 업로드할 때는 따로 하드웨어 업체(삼성, LG)에서 준 툴을 이용해서 업로드 했다. 이번에 아두이노를 분석해가면서 avrdude 라는 파일을 처음 보게 되어서 공부차 작성해 본다.
avrdude는 AVR 마이크로 콘트롤러에 ROM과 EEPROM 이미지를 업로드하는 유틸리티이다. “http://www.nongnu.org/avrdude/” URL에 따르면, Braian S. Dean이라는 사람이 AVR 마이크로 시리즈를 위한 in-system 프로그램 프로젝트중의 하나였다고 한다.처음에는 FreeBSD에 포팅했었고 다양한 운영체제서도 동작하기를 원하는 요구사항이 있어서, 싸이트(http://savannah.nongnu.org/projects/avrdude)를 오픈하고 사람들이 접근해서 쓸 수 있도록 하였다.
아두이노 및 다른 ISP칩셉에 연동이 가능하다. 그 이유는 설정파일 (avrdude.conf)을 가지고 할 수 있다.
<http://savannah.nongnu.org/projects/avrdude>
기능을 알기 위해서 살펴본다.
>avrdude Usage: avrdude [options] Options: -p <partno> Required. Specify AVR device. -b <baudrate> Override RS-232 baud rate. -B <bitclock> Specify JTAG/STK500v2 bit clock period (us). -C <config-file> Specify location of configuration file. -c <programmer> Specify programmer type. -D Disable auto erase for flash memory -i <delay> ISP Clock Delay [in microseconds] -P <port> Specify connection port. -F Override invalid signature check. -e Perform a chip erase. -O Perform RC oscillator calibration (see AVR053). -U <memtype>:r|w|v:<filename>[:format] Memory operation specification. Multiple -U options are allowed, each request is performed in the order specified. -n Do not write anything to the device. -V Do not verify. -u Disable safemode, default when running from a scrip t. -s Silent safemode operation, will not ask you if fuses should be changed back. -t Enter terminal mode. -E <exitspec>[,<exitspec>] List programmer exit specifications. -x <extended_param> Pass <extended_param> to programmer. -y Count # erase cycles in EEPROM. -Y <number> Initialize erase cycle # in EEPROM. -v Verbose output. -v -v for more. -q Quell progress output. -q -q for less. -? Display this usage. avrdude version 5.11, URL: <http://savannah.nongnu.org/projects/avrdude/> |
아두이노 우노에 이미지를 업로드하려면 다음과 같이 사용하는데, 간단히 보면 다음과 같다.
> avrdude -p atmega328p -P com3 -c arduino -U flash:w:gds.hex:i
| |
-p atmega328p | 마이크로 프로세서의 타입을 지정한다. |
-c arduino | 통신 프로토콜을 지정한다. |
-P com3 | com3 시리얼 포트로 내려받는다. |
-U flash:w:gds.hex:i
| flash 는 flash memory를 의미 w 는 write를 의미 test.hex = 업로드할 파일 I = Intel 의 hex format을 의미 |