Frequent reading and writing of the serial port causes a blue screen in the window
Describe the problem
Frequent reading and writing of the serial port causes a blue screen in the window
To reproduce
Port interface: // Stores data received from the serial port into the provided byte array // buffer. The function returns the number of bytes read. // // The Read function blocks until (at least) one byte is received from // the serial port or an error occurs. Read(p []byte) (n int, err error)
// Send the content of the data byte array to the serial port.
// Returns the number of bytes written.
Write(p []byte) (n int, err error)
Please double-check that you have reported each of the following
before submitting the issue.
- [X] I've provided the FULL source code that causes the problem
- [X] I've provided all the actions required to reproduce the problem
Expected behavior
Operating system and version
window11
Please describe your hardware setup
Additional context
Issue checklist
- [X] I searched for previous requests in the issue tracker
- [X] My request contains all necessary details
Thanks for your report @jinronga!
Please provide the source code of a complete minimal Go program that produces the BSoD.
Please also tell us which version of the CH340 driver you have installed. You can find this information by the following procedure:
- Connect the device that produces the serial port you are using when the fault occurs to your computer.
- Open the Windows Device Manager.
- Select View > Devices by type from the Device Manager menus.
- Open the "View" menu.
- If there is a ✓ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
- Open the "Ports (COM & LPT)" section of the Device Manager tree.
- You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Double click on that item. The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
- Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
You will see the version in the "Driver Version" field of the dialog.
Hi @jinronga. We are still waiting for you to provide the information requested in my previous reply so that we can proceed with the investigation or evaluation of this bug.
The BSOD can only be caused by a bug in the kernel code (A.K.A. drivers). In the go-serial library we can only workaround the issue. As @per1234 already stated, a minimal example to reproduce the bug is essential.