avrdude: stk500_loadaddr协议错误Arduino uno GSM模块SIM800L mac计算机上



>我在Mac计算机上设置了arduino IDE,并将Arduino uno与GSM模块一起使用SIM800L EVB

我使用以下代码块通过此模块发送短信。

#include <GSM.h>
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;
// char array of the telephone number to send SMS
// change the number 1-212-555-1212 to a number
// you have access to
char remoteNumber[20]= "12125551212";  
// char array of the message
char txtMsg[200]="Test";
void setup()
{
// initialize serial communications
Serial.begin(9600);
Serial.println("SMS Messages Sender");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
sendSMS();
}
void loop()
{
// nothing to see here
}
void sendSMS(){
Serial.print("Message to mobile number: ");
Serial.println(remoteNumber);
// sms text
Serial.println("SENDING");
Serial.println();
Serial.println("Message:");
Serial.println(txtMsg);
// send the message
sms.beginSMS(remoteNumber);
sms.print(txtMsg);
sms.endSMS(); 
Serial.println("nCOMPLETE!n");  
}

当我尝试以下错误时,控制台上会出现以下错误。考虑到这是我第一次使用这项技术。并且不确定我是否必须设置任何驱动程序才能使用GSM模块。

avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_paged_load(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_cmd(): programmer is out of sync
avr_read(): error reading address 0x0000
read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00

错误是什么?修复它的步骤是什么?

您是否设法将任何草图上传到arduino。首先尝试上传闪烁示例草图。

如果失败,则连接有问题或配置错误。如果您使用的是标准Arduino IDE,则有一个菜单项可以选择正确的板。如果你有错误的板,那么你会收到很多像这里这样的有线消息。

avrdude: stk500_loadaddr(): (a) protocol error, expect=0x14, resp=0x00

因此,首先检查您是否拥有正确的板子。

如果这很好,但您仍然无法加载,那么您可能已经损坏了引导加载程序。Arduino内存的特殊位是为上传草图的程序保留的。其他程序可能会覆盖此代码,从而使芯片变砖。它可以重新加载,但它很棘手。

另一种可能性是模块干扰了程序员。Arduino使用引脚0和1上传草图和串行通信,使用这些引脚连接模块可能会导致冲突。在快速入门中,带有ARDUINO引脚7和8的SIM800(SIM800L用于与GSM模块进行串行通信。

最新更新