Skip to content

Add USB send timeout #152

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

Closed
wants to merge 1 commit into from

Conversation

sandeepmistry
Copy link
Contributor

This change adds a 70 millisecond timeout on USB sends.

Related to one of the problems in arduino-libraries/WiFi101#72 (comment). On Windows, if you open and close the Serial Monitor with a sketch that uses SerialUSB.println(...) the entire sketch will hang.

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b86_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Add USB send timeout #152
  5. Select one of the boards under SAMD Pull Request Add USB send timeout #152 in Tools->Board menu
  6. Compile/Upload as usual

@sandeepmistry
Copy link
Contributor Author

Hi @RamonRibes,

Could you please tryout this build with the following sketch. Then open and close the Serial Monitor in the IDE. The LED should continue to blink after you do so.

void setup() {
  Serial.begin(9600);
  Serial.println("hello");

  pinMode(6, OUTPUT);
}

void loop() {
  Serial.println("LED HIGH");
  digitalWrite(6, HIGH);
  delay(1000);

  Serial.println("LED LOW");
  digitalWrite(6, LOW);
  delay(1000);
}

@RamonRibes
Copy link

RamonRibes commented Jul 12, 2016

Test procedure:
-Arduino IDE 1.6.9 (new installation on a Windows 10 new PC).
-Loaded standard SAMD boards library.
-Selected MKR1000.
-Compiled&started your sketch (Serial monitor kept closed).
-The built-in led does as intended.
-After 12 minutes, i opened the serial monitor. Led is doing OK. Monitor shows messages.
-After 12 minutes, i closed the serial monitor. Led remains in HIGH state.


-Build Pull Request #152 as instructed.
-Selected MKR1000 from Pull Request #152.
-Compiled&started your sketch (Serial monitor kept closed).
-The built-in led does as intended.
-After 12 minutes, i opened the serial monitor. Led is doing OK. Monitor shows messages.
-After 12 minutes, i closed the serial monitor. Led remains switching on/off each second.
-After 12 minutes, i re-opened the serial monitor. Led is doing OK. Monitor shows messages again.
...so the patch is working OK!
Congratulations! :-)

@sandeepmistry
Copy link
Contributor Author

@RamonRibes great news!

So there is a solution for 1/3 problems you are facing so far.

@sandeepmistry
Copy link
Contributor Author

Closing this now in favour of #154.

@sandeepmistry sandeepmistry deleted the usb-send-timeout branch October 26, 2016 14:37
boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants