Skip to content
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

Wait for device to connect in avrdude module. #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NicoHood
Copy link
Contributor

This was created especially for serial bootloaders. Sometimes it takes some time after reset for them to show up (CDC USB Bootloader). With this patch the module waits for the device to connect and then flashes it. This is way more comfort and also used similar in the arduino IDE.

I did not add a timeout for simplicity. If avrdude hangs, there is also no timeout. A special check for usb "ports" were added in order to not break them.

@abcminiuser
Copy link
Owner

Thanks for the patch. I just did a quick test and this doesn't seem to behave on Windows - the [ -c ...] character device check fails under MSYS bash when used with a Windows COM port. Can you think of an alternative here we can use that's cross platform?

@NicoHood
Copy link
Contributor Author

NicoHood commented Jan 2, 2018

You can try -e which just checks if the file exists. -c is just a bit more precise.

@abcminiuser
Copy link
Owner

No bueno. Apparently under Cygwin/MinGW, COM ports aren't mapped to the same DOS style device names as the native command line shell (so while a utility can open a file COM1 or \\?\COM1 on Windows, that doesn't work under Cygwin or MinGW bash). It appears they show up as zero-indexed /dev/ttyS*.

@NicoHood
Copy link
Contributor Author

NicoHood commented Jan 4, 2018

Hm I have no idea how this works on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants