Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: perform bridge reboot after each sketch upload #13

Open
cmaglie opened this issue Aug 21, 2023 · 1 comment
Open

Proposal: perform bridge reboot after each sketch upload #13

cmaglie opened this issue Aug 21, 2023 · 1 comment

Comments

@cmaglie
Copy link
Member

cmaglie commented Aug 21, 2023

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

@facchinm
Copy link
Member

The wait_for_port is not really a bridge reboot but more a "safer" way to get out of the esp->native->esp connection. I'm ok for setting it to true since it shouldn't have any drawback for normal sketches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants