Arduino_STM32 icon indicating copy to clipboard operation
Arduino_STM32 copied to clipboard

Use dd command instead of test command to wait the Serial device

Open hanyazou opened this issue 7 years ago • 7 comments

discussed in the topic "Failed to reconnect serial monitor after uploading on macOS" at http://stm32duino.com/viewtopic.php?f=21&t=2050

hanyazou avatar Jun 02 '17 23:06 hanyazou

Forum topic has been created to discuss this

http://www.stm32duino.com/viewtopic.php?f=53&t=2275

rogerclarkmelbourne avatar Jul 03 '17 06:07 rogerclarkmelbourne

Its unclear from that thread if anyone else has confirmed whether this change is OK.

The last comment from danielef seems to suggest it needs the sleep that you commented out in the code posted to the forum.

I'm not in a position to test this as all my mac's are old and not updateable to the current versions of MacOs

rogerclarkmelbourne avatar Oct 08 '17 00:10 rogerclarkmelbourne

Today I tested this dd modification on latest macOS (10.13) and latest Arduino IDE (1.8.5). I had thought that the dd mod may not be required on the latest OS. But it was still required. Opening the device fails randomly if test -c /dev/cu.XXX returns successfully. The error is "resource busy".

And I had to extend timeout of the generic_boot20_pc13.bin. That was too short. The dfu-util always fails with the default timeout duration.

I'm afraid that no one use this configuration on mac except me.

hanyazou avatar Oct 21 '17 13:10 hanyazou

I added one more wait loop after upload-reset (0c9aab8) because I found that the new macOS required longer duration to list the target device. I tried various wait argument 750, 1000, 1250... of upload-reset to find 4,000ms seems to be enough. But it was too long to wait for 4 seconds every time before uploading.

hanyazou avatar Oct 22 '17 06:10 hanyazou

@hanyazou seems like your PR includes a lot of unrelated commits, quite a good bunch of them. I suspect you may have been adding more commits to the branch you used for the PR. Has biten me before...

victorpv avatar Dec 01 '17 23:12 victorpv

@victorpv thank you for the comment. I've used 'git rebase' on the branch on Oct 22. The rebase took many commits from the master into my branch. I re-created branch in the same name to cleanup.

hanyazou avatar Dec 02 '17 07:12 hanyazou

Now looks nice with a single change :)

victorpv avatar Dec 04 '17 06:12 victorpv