我正在使用一个名为Arduino-makefile或Arduino-mk的Arduino软件包从命令行对Arduino Uno进行编程。最近,我想对ATtiny85微控制器(MC)进行编程。这是我的makefile:
################ MAKEFILE ###################################
ARDUINO_DIR = /usr/share/arduino
###################################################
ISP_PROG = usbasp
ALTERNATE_CORE = attiny-master
BOARD_TAG = attiny
BOARD_SUB = attiny85
F_CPU = 16000000L
###################################################
include /usr/share/arduino/Arduino.mk
# !!! Important. You have to use 'make ispload' when using an ISP.
这就是我要上传到Attiny85 MC的内容:
int led = 3;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
以下是制作makefile的说明:Makefile
我还下载了此boards.txt文件。
要将代码上传到MC,我使用了不起作用的命令sudo make upload
,因此我使用了sudo make ispload
。这两个命令都给出了错误消息:
avr-g++: error: missing device or architecture after ‘-mmcu=’
/usr/share/arduino/Arduino.mk:1215: recipe for target 'build-attiny-attiny85/ATtinyBlink.o' failed
make: *** [build-attiny-attiny85/ATtinyBlink.o] Error 1
答案 0 :(得分:0)
尝试删除BOARD_TAG
,仅保留BOARD_SUB
。