PIO version of avrdude uploading very inconsistent, whereas arduino’s ide version - always uploads.
I use the same source ( obviously for arduino’s ide it is missing #include ). There are no HW changes between attempts to upload.
Arduino’s uploads consistently and slowly - visually it’s progress of upload is slow. The same with PIO is lightning fast but it fails on verification.
Arduino’s IDE avrdude output:
avrdude: Version 6.0.1, compiled on Apr 14 2015 at 19:04:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/home/az/bin/arduino-1.6.5-r5/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/az/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file "/tmp/build4777040840136462297.tmp/BasicConnectivityTest.cpp.hex"
avrdude: writing flash (10458 bytes):
Writing | ################################################## | 100% 2.93s
avrdude: 10458 bytes of flash written
avrdude: verifying flash memory against /tmp/build4777040840136462297.tmp/BasicConnectivityTest.cpp.hex:
avrdude: load data flash data from input file /tmp/build4777040840136462297.tmp/BasicConnectivityTest.cpp.hex:
avrdude: input file /tmp/build4777040840136462297.tmp/BasicConnectivityTest.cpp.hex contains 10458 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 2.19s
avrdude: verifying ...
avrdude: 10458 bytes of flash verified
avrdude done. Thank you.
PIO avrdude:
Looking for upload port...
Warning! Please install `99-platformio-udev.rules` and check that your board's PID and VID are listed in the rules.
https://raw.githubusercontent.com/platformio/platformio/develop/scripts/99-platformio-udev.rules
Auto-detected: /dev/ttyUSB0
Uploading .pioenvs/pro8MHzatmega328/firmware.hex
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
avrdude: Version 6.0.1, compiled on Apr 14 2015 at 19:04:16
System wide configuration file is "/home/az/.platformio/packages/tool-avrdude/avrdude.conf"
User configuration file is "/home/az/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file ".pioenvs/pro8MHzatmega328/firmware.hex"
avrdude: writing flash (10904 bytes):
Writing | ########################################
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
#avrdude: stk500_cmd(): programmer is out of sync
*** [upload] Error 1
========================== [ERROR] Took 10.65 seconds ==========================