-
-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlatformIO breaks serial interface for Arduino Leonardo (but only for PlatformIO) #178
Comments
Could ask you to try upload firmware without platformio run --target upload PlatformIO will automatically detect upload port. |
I have. Here's the output of the command without
That was the first time. As you can see it was succesful. However, when I run it again, it does this:
|
It means that problem occurs from the 2-nd attempt to upload firmware? |
Correct. After the (Arduino) Leonardo has been written to by PlatformIO it not longer lists as a serial device at /dev/ for longer than half a second after connecting via USB (or after resetting it).
On a side note: thanks for the quick response and assistance. PlatformIO still seems a lot more comfortable in use than the official Arduino tooling IMO, because it's more flexible (doesn't dictate the use of one specific project structure). |
Thanks! I suppose where this issue maybe hidden. I've just created new branch-feature where we will try to resolve this issue. Please try this first build: pip uninstall platformio
pip install https://github.com/platformio/platformio/archive/feature/issue-178.zip |
No, sorry, this hasn't changed anything as far as I can see. To me it would seem that the problem is in the behavior of the Leonardo after having been flashed with PlatformIO, as it really does behave differently from the 'flashed by Arduino IDE"-way. Run 1 - forgot to press reset button
Run 2 - success!
Run 3 - same problem :/
Edit: I'm reading your commit and I now understand your approach. Maybe it would be easier to fix the behavior of the Leonardo than to fix the IDE? Because both are at fault here. |
Let's rephrase what do we have:
Could you provide TeamViewer access to your Mac with connected Leonardo board? Because we don't have this board and we can't reproduce this issue. |
Could I ask to run this command when you connect Leonardo to USB: platformio serialports list PlatformIO uses this command to auot-detect available upload ports. |
That seems correct, yes. However, I do not have a Mac, I run Lubuntu 14.04. I'll have a look at the sources, and yes, I've just installed TeamViewer so give me a sign when you have the time. Output after having been flashed with PlatformIO:
Output after having been flashed with Arduino IDE:
|
@valeros pelase contact with @WillemWillemWillem and try to debug the Leonardo behaviour. P.S: @WillemWillemWillem please email to [email protected]. |
The issue's solved, uploads work without resets now. There were two problems:
The changes in this version will be merged into PlatformIO 1.5.0 soon by @valeros. |
Hi @WillemMali, Can 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. Also, 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. I use Linux Mint 17. Cheers, |
Hi Andreas, I personally am under the impression that Arduino.h puts the Arduino in a Could you maybe share (a stripped down version of) the code you've used to As an aside, have you tried uploading the blink example using the Arduino That's all I have for now, good luck! 2015-12-01 13:05 GMT+01:00 andreas271828 [email protected]:
|
Thanks Willem! It's a huge challenge to press and release the Reset button at the right time and then also click the Upload button at the right time or even select a different port within the short time given, because sometimes the port just keeps changing! But .... I got back access to both Leonardos :) You mentioned one of the main reasons why I actually want to get rid of Arduino.h and the rest of the framework: it's HUGE ;) The second reason is that it's less portable. Thanks again, |
Hi Andreas, It's a huge challenge to press and release the Reset button at the right time and then also click the Upload button at the right time or even select a different port within the short time given, because sometimes the port just keeps changing! But .... I got back access to both Leonardos :) You mentioned one of the main reasons why I actually want to get rid of Arduino.h and the rest of the framework: it's HUGE ;) The second reason is that it's less portable. My code's working fine without it (just using core AVR includes), but it's breaking the serial interface every time, even when I include Arduino.h. If you use sketches it executes some extra code that's not executed otherwise (see main.cpp in the relevant framework code). I'll see if I can clean that up and use it directly or if I have to go with the extra load for now. Thanks again, Andreas — |
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. |
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:
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:
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.
The text was updated successfully, but these errors were encountered: