Configure UNO R4 WiFi to wait for post-touch port change #74
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The upload operation for the UNO R4 WiFi follows this sequence:
bossac
command that flashes the binary to the board.It is common for the address of the board port to change after the "1200 bps touch" step and so the Arduino development tools have a system for detecting the post-touch address and using that address when the upload command is generated from the "pattern" defined for the board in
platform.txt
. That system involves a post-touch wait to watch for the new port to appear before eventually timing out and resorting to the fallback behavior of using the original address to the upload pattern if no address change was detected. Since some boards will never produce a post-touch address change (meaning the post-touch wait step would only cause an unnecessary delay in the upload operation) it is possible to configure the board to skip the wait step by setting theupload.wait_for_upload_port
property tofalse
in the board definition.The assumption was made that the address of the UNO R4 WiFi board's port will never experience a post-touch address change, so its
upload.wait_for_upload_port
property was set tofalse
:ArduinoCore-renesas/boards.txt
Line 138 in e5ab698
However, the board's port address can change under certain conditions and this caused the
bossac
command invocation to fail with a "No device found on ..." error because of the original port address being used in the generated command instead of the post-touch address (#73).This spurious upload failure is avoided by changing the value of the
upload.wait_for_upload_port
property totrue
.❗ Note that this does have the unfortunate side effect of introducing the 10 s post-touch wait delay in all uploads that do not produce a port address change. I don't have any idea about an alternative solution that would make uploads 100% reliable while also avoiding this inefficiency.
Fixes #73