PlatformIO Community

Cannot upload firmware to Arduino Uno board

I’m running PIO v3.6.0a3, and I’m unable to upload firmware to Arduino Uno board. Here’s the output of upload command:

Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Auto-detected: COM8
Uploading .pioenvs\uno\firmware.hex
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xdb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xdb

and so on.

Resp changes from one attempt to another. It can show 0x5f, 0x7e, 0x6e, etc.

This is my platformio.ini file:

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = LiquidCrystal, StreamLib
board_build.f_cpu = 16000000L
build_flags = -DUSE_NETWORK

Does uploading work with the Arduino IDE? avrdude: stk500_recv(): programmer is not responding is sadly a very general error message for “something went wrong”, see https://arduino.stackexchange.com/questions/17/avrdude-stk500-getsync-not-in-sync-resp-0x00-aka-some-dude-named-avr-won/22541

I’ve bought another Arduino Uno board and the uploading works with it. So I don’t think there’s any issue with Platformio.

The issue is resolved by increasing the upload speed to 115200 in the upload_speed line in file platformio.ini

upload_speed = 57600

2 Likes

Increasing or decreasing? :wink: The default is 115200 (and has been for at least three years), and the OP didn’t have a custom speed set in his platformio.ini as shown.

If this worked have an old bootloader on your board that uses this baud rate, all the newer bootloaders use 115200. That was also a quiet subtle change and the reason the Arduino IDE now knows “ATMega328P” [115200 baud] and “ATMega328 (Old Bootloader)” [57600 baud] which was the previously named “ATMega328”. Still, this doesn’t cover the whole issue, as there could be a million other reasons the programmer is not responding.

1 Like

This was the solution for me. Thanks!