Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

avrdude: stk500_loadaddr protocol error Arduino uno GSM module SIM800L EVB on mac computer

Ask Question

I set up arduino IDE on mac computer and use Arduino uno with GSM module SIM800L EVB

I used following code block to send SMS through this module.

#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;
      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");  

While i try this following error comes on the console. Consider this is the first time i use this technology. And not sure whether i have to set up any drivers to use GSM module.

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

What is the error? and what are the steps to fix it?

Should have been removed here, since it's specifically about Arduino hardware and fits there better. – gre_gor Jan 10, 2018 at 18:50

Have you managed to upload any sketches to the arduino at all. First try and upload the blink example sketch.

If that fails there is a problem with the connection or a miss-configuration. If you are using the standard Arduino IDE there is a menu item to select the correct board. If you have the wrong board then you get lots of wired messages like the one here.

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

So first check you have the correct board.

If that’s fine but you still can’t load then you might have corrupted the bootloader. A special bit of the arduino memory is reserved for the program which uploads sketches. Its possible for other programs to overwrite this code, bricking the chip. It can be reloaded but its tricky.

The other possibility is that the module is interfering with the programmer. The Arduino uses pins 0 and 1 for uploading sketches, and serial communication, connecting the module using these pins could cause a conflict. In QUICKSTART SIM800 (SIM800L) WITH ARDUINO pins 7 and 8 are used for serial communication with the GSM module.

blink example works. select board also done fine. this cause only if i connect GSM800L module. – sugunan Jan 13, 2018 at 17:07 You could disconnect the module, load the sketch, then reconnect the module and see if it works that way. Looking at this post ayomaonline.com/programming/… there seems to to be something a bit odd with the voltage levels on the module. Maybe connecting the board is causing the atmega chip to fail. Also avoid using pins 1 and 2 as these may be used while uploading the sketch. – Salix alba Jan 14, 2018 at 11:33 that link you shared working fine. The default Arduino TX and RX ports are the problem. As i didn't seen any working solution than what you post. If you change the answer accordingly i can mark as accepted. – sugunan Jan 15, 2018 at 8:07

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.