Arduino_STM32
Arduino_STM32 copied to clipboard
Use dd command instead of test command to wait the Serial device
discussed in the topic "Failed to reconnect serial monitor after uploading on macOS" at http://stm32duino.com/viewtopic.php?f=21&t=2050
Forum topic has been created to discuss this
http://www.stm32duino.com/viewtopic.php?f=53&t=2275
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
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.
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 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 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.
Now looks nice with a single change :)