dmbs icon indicating copy to clipboard operation
dmbs copied to clipboard

Wait for device to connect in avrdude module.

Open NicoHood opened this issue 7 years ago • 4 comments

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.

NicoHood avatar Dec 29 '17 08:12 NicoHood

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?

abcminiuser avatar Dec 31 '17 06:12 abcminiuser

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

NicoHood avatar Jan 02 '18 10:01 NicoHood

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*.

abcminiuser avatar Jan 04 '18 09:01 abcminiuser

Hm I have no idea how this works on windows.

NicoHood avatar Jan 04 '18 17:01 NicoHood