platformio-core: PlatformIO breaks serial interface for Arduino Leonardo (but only for PlatformIO)

When I flash my Leonardo with your software, it will start disconnecting from serial immediately after having been connected. It will only very briefly appear as a tty serial device when being connected, and not long enough to flash it using PlatformIO.

Luckily the Arduino IDE can still flash it (I have open the “Tools” menu in the 300ms after I’ve reset the Arduino, select the right port, then press the reset button again while uploading). After the Arduino IDE has flashed it it stays connected via serial again, and PlatformIO can flash it again.

Here’s some outputs:

ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port "/dev/ttyACM0"
[Thu Apr 16 02:25:48 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)
-----------------------------------------------------------------------------------
BeforeUpload(["upload"], [".pioenvs/leonardo/firmware.hex"])
scons: *** [upload] /dev/ttyACM0: No such file or directory
=========================== [ ERROR ] Took 2.39 seconds ===========================
ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port "/dev/ttyACM0"
[Thu Apr 16 02:25:53 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)
-----------------------------------------------------------------------------------
BeforeUpload(["upload"], [".pioenvs/leonardo/firmware.hex"])
scons: *** [upload] Broken pipe
=========================== [ ERROR ] Took 2.40 seconds ===========================

When I have just flashed the Leonardo with the Arduino IDE, I still have to press the reset button when it’s started uploading. Here’s the output that goes along with that:

ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port "/dev/ttyACM0"
[Thu Apr 16 02:25:31 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)
-----------------------------------------------------------------------------------
BeforeUpload(["upload"], [".pioenvs/leonardo/firmware.hex"])
"/home/ford/.platformio/packages/tool-avrdude/avrdude" -v -D -p atmega32u4 -C "/home/ford/.platformio/packages/tool-avrdude/avrdude.conf" -c avr109 -b 57600 -P /dev/ttyACM0 -U flash:w:.pioenvs/leonardo/firmware.hex:i

avrdude: Version 6.0.1, compiled on Apr  3 2014 at 21:52:43
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/home/ford/.platformio/packages/tool-avrdude/avrdude.conf"

Using Port                    : /dev/ttyACM0
Using Programmer              : avr109
Overriding Baud Rate          : 57600
AVR Part                      : ATmega32U4
Chip Erase delay              : 9000 us
PAGEL                         : PD7
BS2                           : PA0
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  9000  9000 0x00 0x00
flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
lock           0     0     0    0 no          1    0      0  9000  9000 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 : butterfly
Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9587
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: reading input file ".pioenvs/leonardo/firmware.hex"
avrdude: writing flash (240 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 240 bytes of flash written
avrdude: verifying flash memory against .pioenvs/leonardo/firmware.hex:
avrdude: load data flash data from input file .pioenvs/leonardo/firmware.hex:
avrdude: input file .pioenvs/leonardo/firmware.hex contains 240 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 240 bytes of flash verified

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: safemode: Fuses OK (H:CB, E:D8, L:FF)

avrdude done.  Thank you.

=========================== [SUCCESS] Took 5.53 seconds ===========================

I hope you can do something about this. To me this seems like you use a bugged/outdated firmware version. Feel free to contact me.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I think I’m seeing this with my Adafruit Feather 32u4 and PlatformIO 2.8.5. Flashing works most of the but sometimes it starts failing and and I have to unbrick using Arduino IDE and blink sketch.