-
-
Notifications
You must be signed in to change notification settings - Fork 725
USB stop receiving after disconnect and reconnect cable #350
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
Comments
Hello, Let me tell you that I have a similar problem. When I start my board with external power and the USB cable connected, everything works fine. Even if I close and open the serial monitor, I can receive and send commands to the board. But if I disconnect the USB cable and connect it again, I can only receive commands, but not send. This problem also occurs using the RTCzero library when the board goes out of from standby mode The code I use is: ` //while (!SerialUSB) ; // Wait for Serial monitor to open void loop(){ if (millis() > msg_time + 2000){ I hope someone can help us Thanks. |
Hi ctorregrosa, thanks for your comment. Which version of the SAMD package are you using? Please load the 1.6.17 release and let me know if with it your sketch works. Regards |
Hi Marco, Currently I'm using the 1.6.19 release. Following your advice and editing the library "USBCore.cpp", specifically commenting the new line 457, 458 and 459 and adding the old line 457 of the following link: [https://github.com/arduino/ArduinoCore-samd/commit/2bb54068a2ffad535d9d908f0bdc4ec0f1d46708] I solved the problem temporarily. I do not know if this modification is the right one, but it works for both problems exposed in the previous post. Thanks fo your advice. Regards |
Hi Cristobal, I will try to dig deeper into the issue but, as I told, I am not an USB guru and so I don't know when and if I will elaborate a clean solution. In the meantime I kindly request the developers of the patch: Thanks in advance. |
Avoid memory leak by deleting the buffers; DoubleBufferedEPOutHandler should be refactored (in beta branch) to allow separate "new" and "setup" procedures Fixes arduino#350
Hi @Sulymarco , |
Hi everybody,
Failure description:
Usb stop receiving if the cable is disconnected and reconnected to the host and the Arduino is powered also from another source, and then when the USB cable is disconnected the board is not resetted.
Setup description:
The programming port is used by the Arduino IDE and the native USB by the
Terminal application.
4)The TestUsbZero.ino sketch is used to reproduce the failure:
Procedure description:
Connect the Arduino programming port and the native USB to the PC.
Run the Arduino Ide and load the TestUsbZero.ino.
Set the board to Arduino/Genuino/Zero(programming port) and the port to the COM that matches the programming port.
Compile and download the sketch.
Open the Arduino monitor.
Run the Terminal application and open in it the COM that matches the native USB.
In the Terminal application the test strings sent by the native USB are printed OUT.
In the Arduino monitor some key USB registers are printed out.
If we type something in the Terminal this is received by the native USB and printed out in the Arduino
monitor.
Everything is correct.
Close the port in the Terminal application to prevent it to hang.
Disconnect and reconnect the native USB cable and reopen the matching COM in the Terminal
application.
In the Terminal application the test strings sent by the native USB are printed OUT.
In the Arduino monitor some key USB registers are printed out.
If we type something in the Terminal this is no more received by the native USB.
Failure analysis:
This behaviour is consistent with the content of the USB registers that are monitored, as the Bulk
Endpoint Out is no more enabled.
I have tracked down this behaviour to the following patch:
Don't reallocate USB buffers if already allocated
Disabling it prevent the failure to show up.
I am not enougth expert in USB and C++ to suggest a safe and clean patch to this issue.
Please can somebody find a solution?
Marco
The text was updated successfully, but these errors were encountered: