{"action":"created","issue":{"url":"https://api.github.com/repos/platformio/platformio/issues/178","labels_url":"https://api.github.com/repos/platformio/platformio/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/platformio/platformio/issues/178/comments","events_url":"https://api.github.com/repos/platformio/platformio/issues/178/events","html_url":"https://github.com/platformio/platformio/issues/178","id":68816908,"number":178,"title":"PlatformIO breaks serial interface for Arduino Leonardo (but only for PlatformIO)","user":{"login":"WillemMali","id":4689687,"avatar_url":"https://avatars.githubusercontent.com/u/4689687?v=3","gravatar_id":"","url":"https://api.github.com/users/WillemMali","html_url":"https://github.com/WillemMali","followers_url":"https://api.github.com/users/WillemMali/followers","following_url":"https://api.github.com/users/WillemMali/following{/other_user}","gists_url":"https://api.github.com/users/WillemMali/gists{/gist_id}","starred_url":"https://api.github.com/users/WillemMali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WillemMali/subscriptions","organizations_url":"https://api.github.com/users/WillemMali/orgs","repos_url":"https://api.github.com/users/WillemMali/repos","events_url":"https://api.github.com/users/WillemMali/events{/privacy}","received_events_url":"https://api.github.com/users/WillemMali/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/platformio/platformio/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"valeros","id":886732,"avatar_url":"https://avatars.githubusercontent.com/u/886732?v=3","gravatar_id":"","url":"https://api.github.com/users/valeros","html_url":"https://github.com/valeros","followers_url":"https://api.github.com/users/valeros/followers","following_url":"https://api.github.com/users/valeros/following{/other_user}","gists_url":"https://api.github.com/users/valeros/gists{/gist_id}","starred_url":"https://api.github.com/users/valeros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeros/subscriptions","organizations_url":"https://api.github.com/users/valeros/orgs","repos_url":"https://api.github.com/users/valeros/repos","events_url":"https://api.github.com/users/valeros/events{/privacy}","received_events_url":"https://api.github.com/users/valeros/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/platformio/platformio/milestones/10","html_url":"https://github.com/platformio/platformio/milestones/1.5.0","labels_url":"https://api.github.com/repos/platformio/platformio/milestones/10/labels","id":1082082,"number":10,"title":"1.5.0","description":"","creator":{"login":"ivankravets","id":1760209,"avatar_url":"https://avatars.githubusercontent.com/u/1760209?v=3","gravatar_id":"","url":"https://api.github.com/users/ivankravets","html_url":"https://github.com/ivankravets","followers_url":"https://api.github.com/users/ivankravets/followers","following_url":"https://api.github.com/users/ivankravets/following{/other_user}","gists_url":"https://api.github.com/users/ivankravets/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankravets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankravets/subscriptions","organizations_url":"https://api.github.com/users/ivankravets/orgs","repos_url":"https://api.github.com/users/ivankravets/repos","events_url":"https://api.github.com/users/ivankravets/events{/privacy}","received_events_url":"https://api.github.com/users/ivankravets/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":8,"state":"closed","created_at":"2015-04-24T11:08:48Z","updated_at":"2015-05-15T11:01:57Z","due_on":null,"closed_at":"2015-05-15T11:01:57Z"},"comments":12,"created_at":"2015-04-16T00:31:36Z","updated_at":"2015-12-01T12:05:15Z","closed_at":"2015-05-14T15:07:23Z","body":"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.\r\n\r\nLuckily 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.\r\n\r\nHere's some outputs:\r\n\r\n    ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port \"/dev/ttyACM0\"\r\n    [Thu Apr 16 02:25:48 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)\r\n    -----------------------------------------------------------------------------------\r\n    BeforeUpload([\"upload\"], [\".pioenvs/leonardo/firmware.hex\"])\r\n    scons: *** [upload] /dev/ttyACM0: No such file or directory\r\n    =========================== [ ERROR ] Took 2.39 seconds ===========================\r\n    ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port \"/dev/ttyACM0\"\r\n    [Thu Apr 16 02:25:53 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)\r\n    -----------------------------------------------------------------------------------\r\n    BeforeUpload([\"upload\"], [\".pioenvs/leonardo/firmware.hex\"])\r\n    scons: *** [upload] Broken pipe\r\n    =========================== [ ERROR ] Took 2.40 seconds ===========================\r\n\r\nWhen 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:\r\n\r\n    ford@FordPrefect:~/Documents/work/42tech/cbgb/arduino$ platformio run --upload-port \"/dev/ttyACM0\"\r\n    [Thu Apr 16 02:25:31 2015] Processing leonardo (targets: upload, platform: atmelavr, board: leonardo, framework: Arduino)\r\n    -----------------------------------------------------------------------------------\r\n    BeforeUpload([\"upload\"], [\".pioenvs/leonardo/firmware.hex\"])\r\n    \"/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\r\n\r\n    avrdude: Version 6.0.1, compiled on Apr  3 2014 at 21:52:43\r\n    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/\r\n    Copyright (c) 2007-2009 Joerg Wunsch\r\n\r\n    System wide configuration file is \"/home/ford/.platformio/packages/tool-avrdude/avrdude.conf\"\r\n\r\n    Using Port                    : /dev/ttyACM0\r\n    Using Programmer              : avr109\r\n    Overriding Baud Rate          : 57600\r\n    AVR Part                      : ATmega32U4\r\n    Chip Erase delay              : 9000 us\r\n    PAGEL                         : PD7\r\n    BS2                           : PA0\r\n    RESET disposition             : dedicated\r\n    RETRY pulse                   : SCK\r\n    serial program mode           : yes\r\n    parallel program mode         : yes\r\n    Timeout                       : 200\r\n    StabDelay                     : 100\r\n    CmdexeDelay                   : 25\r\n    SyncLoops                     : 32\r\n    ByteDelay                     : 0\r\n    PollIndex                     : 3\r\n    PollValue                     : 0x53\r\n    Memory Detail                 :\r\n\r\n    Block Poll               Page                       Polled\r\n    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack\r\n    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\r\n    eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00\r\n    flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00\r\n    lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00\r\n    hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00\r\n    efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00\r\n    lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00\r\n    calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00\r\n    signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00\r\n\r\n    Programmer Type : butterfly\r\n    Description     : Atmel AppNote AVR109 Boot Loader\r\n\r\n    Connecting to programmer: .\r\n    Found programmer: Id = \"CATERIN\"; type = S\r\n    Software Version = 1.0; No Hardware Version given.\r\n    Programmer supports auto addr increment.\r\n    Programmer supports buffered memory access with buffersize=128 bytes.\r\n\r\n    Programmer supports the following devices:\r\n    Device code: 0x44\r\n\r\n    avrdude: devcode selected: 0x44\r\n    avrdude: AVR device initialized and ready to accept instructions\r\n\r\n    Reading | ################################################## | 100% 0.00s\r\n\r\n    avrdude: Device signature = 0x1e9587\r\n    avrdude: safemode: lfuse reads as FF\r\n    avrdude: safemode: hfuse reads as D8\r\n    avrdude: safemode: efuse reads as CB\r\n    avrdude: reading input file \".pioenvs/leonardo/firmware.hex\"\r\n    avrdude: writing flash (240 bytes):\r\n\r\n    Writing | ################################################## | 100% 0.02s\r\n\r\n    avrdude: 240 bytes of flash written\r\n    avrdude: verifying flash memory against .pioenvs/leonardo/firmware.hex:\r\n    avrdude: load data flash data from input file .pioenvs/leonardo/firmware.hex:\r\n    avrdude: input file .pioenvs/leonardo/firmware.hex contains 240 bytes\r\n    avrdude: reading on-chip flash data:\r\n\r\n    Reading | ################################################## | 100% 0.00s\r\n\r\n    avrdude: verifying ...\r\n    avrdude: 240 bytes of flash verified\r\n\r\n    avrdude: safemode: lfuse reads as FF\r\n    avrdude: safemode: hfuse reads as D8\r\n    avrdude: safemode: efuse reads as CB\r\n    avrdude: safemode: Fuses OK (H:CB, E:D8, L:FF)\r\n\r\n    avrdude done.  Thank you.\r\n\r\n    =========================== [SUCCESS] Took 5.53 seconds ===========================\r\n\r\nI hope you can do something about this. To me this seems like you use a bugged/outdated firmware version. Feel free to contact me."},"comment":{"url":"https://api.github.com/repos/platformio/platformio/issues/comments/160947805","html_url":"https://github.com/platformio/platformio/issues/178#issuecomment-160947805","issue_url":"https://api.github.com/repos/platformio/platformio/issues/178","id":160947805,"user":{"login":"andreas271828","id":5901143,"avatar_url":"https://avatars.githubusercontent.com/u/5901143?v=3","gravatar_id":"","url":"https://api.github.com/users/andreas271828","html_url":"https://github.com/andreas271828","followers_url":"https://api.github.com/users/andreas271828/followers","following_url":"https://api.github.com/users/andreas271828/following{/other_user}","gists_url":"https://api.github.com/users/andreas271828/gists{/gist_id}","starred_url":"https://api.github.com/users/andreas271828/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreas271828/subscriptions","organizations_url":"https://api.github.com/users/andreas271828/orgs","repos_url":"https://api.github.com/users/andreas271828/repos","events_url":"https://api.github.com/users/andreas271828/events{/privacy}","received_events_url":"https://api.github.com/users/andreas271828/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T12:05:15Z","updated_at":"2015-12-01T12:05:15Z","body":"Hi @WillemMali,\r\n\r\nCan you please provide more details regarding Arduino.h. I'm trying to avoid including Arduino specific files or only want to include what's absolutely necessary. Can you explain what is happening and what code in Arduino.h (or files that are included indirectly) is preventing that from happening.\r\n\r\nAlso, I have two Leonardos and now broke both of them this way. Unfortunately, I just can't get anything running with the Reset button - with both Leonardos. I tried to use the Reset button to upload software without the 1200bps trick (that the Arduino IDE and PlatformIO do automatically) and I tried to use the button to get the microcontroller back into a programmable state as described above by you. I can't seem to ever see the device again with platformio serialports list or in Arduino IDE, even shortly after pressing the button or plugging the USB cable back in.\r\n\r\nI use Linux Mint 17.\r\n\r\nCheers,\r\nAndreas"}}