Description
Currently, the bridge firmware does not perform any reboot until it's needed to reconfigure the native USB device (for example because the uploaded sketch includes the HID
library to emulate Keyboard/Mouse or do MIDI stuff and the USB descriptor needs to be changed).
In the board.txt
of the Renesas
platform, the upload.wait_for_upload_port
directive is currently set to false
.
This works fine for uploading sketches that do not use cause USB reconfiguration, but it becomes problematic if the upload produces a USB port change (because the IDE will not follow the port change).
Since we cannot avoid the USB reconfiguration in some cases, I propose to uniform the upload in the other way and always restart the USB connection after each sketch upload. By doing so we could set the upload.wait_for_upload_port
directive to true
and correctly handle all sketch uploads.
Another bonus is that after restarting the USB connection we can always restart the bridge from a clean state.
In all other cases, the bridge can continue to run continuously as it is now, for example, if the user opens and closes the monitor, the reboot is not needed.
Related issues:
arduino/ArduinoCore-renesas#73
arduino/ArduinoCore-renesas#74