Adafruit Feather 328P: Won't upload sketches, stk500_disable(): protocol error

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dkurtz
 
Posts: 2
Joined: Fri Sep 30, 2022 8:57 am

Adafruit Feather 328P: Won't upload sketches, stk500_disable(): protocol error

Post by dkurtz »

Hey there, thank you all in advance for your help.

I recently ordered and received two new Adafruit Feather 328P boards, and, like many others, I am having problems uploading sketches to the board. I'd really like to get the boards to work, and I hope you all can help.

System information:

OS: Mac OS 10.11.6 El Capitan
Arduino IDE: 1.8.10
CP210x VCP Driver: 6.0.2
USB Cable: data cable (tried 2 different cables)

Arduino IDE setup:

Board: Adafruit Feather 328P (also tried Arduino Pro or Pro Mini with ATMega328 3.3v 8Hz)
Port: /dev/cu.SLAB_USBtoUART
Programmer: ArduinoISP

I have followed all the procedures listed on LadyAda's Feather 328P page:

Adafruit Feather 328P Arduino IDE Setup by LadyAda
https://learn.adafruit.com/adafruit-fea ... -ide-setup

The first time I plugged in the Feather, the red blinking was blinking constantly until I unplugged the board. I tried to upload the "Blink" sketch, but got only the following message:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


After trying myriad setup changes, Arduino IDE app restarts, different USB cables, I got the same behavior. I then combed the internet for information to help, and found the many posts related this issue, here are just a couple of them:

Adafruit Forum: Feather 328 problem
viewtopic.php?t=188873&hilit=Feather+328+problem

Adafruit Forum: 328P - avrdude: stk500_recv(): programmer is not responding
viewtopic.php?t=187254&hilit=Feather+328P+stk500

I tried the "press reset button during uploading" suggestion: it only changed the behavior of the red blinking LED: the red LED does not blink at any time now, (unless I press the reset button and then it blinks only three times and goes off).

The following error messages initially appeared when trying to upload the default "Blink" sketch to the Feather 328P as I use the rest button to solve the issue:

Here's the error I get if I DON'T press the reset button after the sketch compiles:

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0


Here's the error I get if I DO press the reset button after the sketch compiles:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe0
An error occurred while uploading the sketch


Here's the error I get if I depress the reset button after the sketch compiles and let go after the first "programmer is not responding" message:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.


THEN ...

After trying this technique for an hour, I somehow managed to hit the reset button at precisely the right time (I have no idea what the right time was) and the blink sketch uploaded correctly. I was so pleased to see the red LED responding to the Blink sketch finally.. But resolution was short-lived: I tried to upload the blink sketch again, and then got the original error message:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


(((ARGH))) This endgame has happened to others who have posted on the Adafruit Forum:

Adafruit Forum: Yet another Feather 328 not loading
viewtopic.php?t=188873&hilit=Feather+328+blink

(I did adding a 20uF capacitor between RST and GND. No change.)

I now have a board with the "Blink" sketch that will not allow any sketches to update.

I'd really appreciate any help with getting these to work. Thank you!

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit Feather 328P: Won't upload sketches, stk500_disable(): protocol error

Post by mikeysklar »

That you managed to upload the code once confirms that your computer + cable + Feather 328p are able to function together.

The reset button press needs to be precisely after compiling and just before (2 seconds) the upload is supposed to start.

An alternative option is to press the reset button and click the 'Upload' button from the Arduino IDE (skipping the compile phase) which is easier to time.

User avatar
dkurtz
 
Posts: 2
Joined: Fri Sep 30, 2022 8:57 am

Re: Adafruit Feather 328P: Won't upload sketches, stk500_disable(): protocol error

Post by dkurtz »

Mikey -

Thank you so much for your help! (BTW, your name came up many times as I was reading the posts that others had made regarding the error messages seen when trying to upload sketches to the Adafruit Feather 328P board.)

After reviewing your reply, I went back and tried to refine my timing technique so that I could use your work-around to get a new sketch uploaded to the Feather 328P. The last suggestion you gave was the most useful and here's what I did to get a sketch uploaded successfully. I'll explain it here in detail so that other newbies to the Feather 328P -- like myself -- might have a clearer understanding of what to do if they cannot upload sketches to this board.

With the Feather 328P connected and the Arduino IDE ready for uploading the default "Blink" sketch, I:

1) Started a timer so that I had an accurate stopwatch showing the advancing seconds.

2) I pressed down and held the reset button down with one hand.

3) With the reset button held down (IMPORTANT), I hovered my mouse (using my other hand) over the "Upload" button in the Arduino IDE and prepared to press down when my "timer mark" occurred (see next step).

4) I watched the timer and clicked "Upload" with the mouse when the clock rolled over to a new second (i.e. 00:00:10). This would act as my "timer mark."

5) Exactly 5 seconds after the "timer mark" (i.e. 00:00:15 I released the reset button on the Feather 328P.

6) The following error messages display in the Arduino IDE:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00


Although the above error message is displayed, the "Blink" sketch was successfully uploaded. This was initially confusing, and I didn't realize the upload was successful until I modified the Blink sketch to blink faster and then tried uploading again using the steps above. When I saw the LED blinking faster I knew the revised Blink sketch had uploaded.

Is there any effort being made to fix this confusing problem? From my perspective, the Feather still isn't functioning as well as it should (this reset workaround is not user-friendly), and the Arduino IDE doesn't provide any feedback that a sketch has been correctly uploaded which will be a problem as I refine sketches and try to upload them. I really like the specs of this board, and I'd like to buy many more of them to use.

Mikey, your help in learning the precise time to upload the sketch was key, and I thank you! :-)

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit Feather 328P: Won't upload sketches, stk500_disable(): protocol error

Post by mikeysklar »

Thank you for the detailed walk through. I think you '5 seconds' number will be forum gold to others learning the reset timing dance.

The IDE message showing that avrdude was having problems communicating is probably true. It tries repeatedly to send over the compiled hex file and some of the attempts fail. Do you happen to have verbose output on for upload (File --> Preferences). That might make it clearer as to what else is happening (eg. a successful upload).

The manual bootloader reset press is specific to different controller boards bootloader and serial controllers. I do not believe this will change for the Feather 328p units when loading code over USB.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”