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

Bluescreen of Death when board prints continuously to Serial Monitor #2592

Open
3 tasks done
Joko-1 opened this issue Dec 5, 2024 · 7 comments
Open
3 tasks done

Bluescreen of Death when board prints continuously to Serial Monitor #2592

Joko-1 opened this issue Dec 5, 2024 · 7 comments
Labels
os: windows Specific to Windows operating system topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project

Comments

@Joko-1
Copy link

Joko-1 commented Dec 5, 2024

Describe the problem

A Bluescreen of Death occurs after about 30 seconds when the board is running a sketch program that causes continuous printing to Serial Monitor:

Image

To reproduce

  1. Upload a sketch that causes the board to print continuously to Serial (about every 10ms).
  2. Open Serial Monitor

🐛 A BSOD occurs after about 30 s.

Expected behavior

No BSOD

Arduino IDE version

2.3.4

Operating system

Windows

Operating system version

10 22H2

Additional context

The fault does not occur when I open the serial port of the board in PuTTY.


Board: ESP32-WROOM-32 with CH340 Serial chip


Stillstandcode: DRIVER IRQL NOT. LESS OR EQUAL
Fehlerursache: CH341S64.SYS


I have attempted the following to solve the problem, without any success:

  • Reinstalling the CH340 driver
  • Updating from Arduino IDE 2.3.3 to 2.3.4
  • Using another cable
  • Using another Arduino sketch

Additional reports

Related

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@Joko-1 Joko-1 added the type: imperfection Perceived defect in any part of project label Dec 5, 2024
@per1234 per1234 changed the title Bluescreen of Death with Serial Monitor Bluescreen of Death when board prints continuously to Serial Monitor Dec 5, 2024
@per1234
Copy link
Contributor

per1234 commented Dec 5, 2024

Hi @Joko-1. Thanks for your report. I'm going to ask you to provide some additional information:

Please provide a simple sketch that you have verified to produce the BSOD. For example, does the BSOD occur if you upload this sketch to your board?:

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("hello");
  delay(5);
}

Please also tell me which version of the CH340 driver you have installed. You can find this information by the following procedure:

  1. Open the Windows Device Manager.
  2. Select View > Devices by type from the Device Manager menus.
  3. Open the "View" menu.
  4. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  5. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  6. 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.
  7. 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.


Please also tell me whether there is labeling on the CH340 chip on your board. If present, the labeling would look something like this:

Image

📷

SparkFun - CC BY-SA 4.0 (cropped)

But the chip might also be blank.

@per1234 per1234 added the status: waiting for information More information must be provided before work can proceed label Dec 5, 2024
@per1234 per1234 self-assigned this Dec 5, 2024
@Joko-1
Copy link
Author

Joko-1 commented Dec 5, 2024

Thanks for respond,

It also happens, when I use your script.

I tested it a few times with baud rate 115200, 9600.
I didn't get the 30s as earlier (it took ~2-3min), but I noticed that it happened faster at 115200 baud.

Driver:
Driver Provider: wch.cn
Driver Date: 16.09.2024
Driver Version: 3.9.2024.9

Chip:
WCH
CH340C
205695D41

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Dec 6, 2024
@per1234 per1234 removed their assignment Dec 6, 2024
@KashifKhaan
Copy link

The BSOD issue appears to stem from the CH341S64.SYS driver for the CH340 Serial chip. Here's a streamlined approach to resolve it:

  • Update or Revert the CH340 Driver: Download the latest or a stable older version from wch.cn.
  • Adjust Serial Communication: Reduce the baud rate (e.g., to 9600) and limit the frequency of serial prints (e.g., every 100ms or more).
  • Use Alternative Serial Tools: If the Arduino IDE causes BSOD, switch to PuTTY or another terminal.
  • Test Different Hardware: Use a different USB cable, port, or a board with a non-CH340 USB-to-Serial chip (e.g., CP2102).
  • Update Arduino IDE: Ensure you're on the latest version to avoid IDE-specific bugs.

@AkhmadKhoirudin

This comment has been minimized.

@bankdaysun
Copy link

After this issue occurred, I tried to fix it by installing the old 2011 driver
Image
Select "Older Windows Driver Version and Instructions"
https://sparks.gogo.co.nz/ch340.html?srsltid=AfmBOorOaQq3i3DrMbWlf7fW4zSXS1gbigIbjYHjBQ3w1P91_VicE93r
It worked fine and stopped the BSOD
Device: ESP32 Dev module CH340
date:9/12/2024

@per1234
Copy link
Contributor

per1234 commented Jan 6, 2025

Thanks for sharing this valuable information @bankdaysun! This indicates that the problem is in the latest version of the CH340 driver, and not in Arduino IDE.

Did you find that the problem came back later? I ask because in my experience Windows will automatically update the driver to the problematic version once again after some time.

@per1234 per1234 added topic: serial monitor Related to the Serial Monitor os: windows Specific to Windows operating system labels Jan 6, 2025
@per1234
Copy link
Contributor

per1234 commented Jan 7, 2025

Hi @Joko-1. I will provide instructions you can follow to install an older version of the driver. Hopefully the problem will not occur when that older version is used, as was reported by @bankdaysun.

Unfortunately I am not able to reproduce the fault on a Windows 10 virtual machine, or on a Windows 11 physical machine (I don't have a Windows 10 physical machine) by running the "hello" sketch on my ESP32-CAM board (which has a CH340 chip) with the problematic 3.9.2024.9 version of the driver installed. So I am not able to personally verify that this workaround will fix the problem.

  1. Click the following link to download the previous version of the driver from the chip manufacturer's website:
    https://www.wch-ic.com/downloads/file/65.html?time=2023-03-16%2022:57:59
  2. Wait for the download to finish.
  3. Run the downloaded CH341SER.EXE file.
  4. A "User Account Control" dialog may now appear asking "Do you want to allow this app to make changes to your device?". Click the "Yes" button.
  5. A "DriverSetup(X64)" dialog will open. Click the "INSTALL" button in the dialog.
  6. Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
  7. Click the "OK" button in the "Driver install success!" dialog.
    The dialog will close.
  8. Click the X icon at the top right of the "DriverSetup(X64)" dialog
    The dialog will close.
  9. Close Arduino IDE if it is running.
  10. Connect the Arduino board to your computer with a USB cable.
  11. Open the Windows Device Manager.
  12. Select View > Devices by type from the Device Manager menus.
  13. Open the "View" menu.
  14. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  15. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  16. 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.
  17. Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
  18. You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
    1. Click the "Update driver" button.
      An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
    2. Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
    3. You should now see the driver installation wizard update the driver. Wait for the update to finish, as indicated by the message "Windows has successfully updated your drivers" in the dialog.
      ❗ It is possible you will instead see the message "The best drivers are already installed". If so, please stop following the instructions here and comment on the issue to let me know. I'll provide alternative instructions you can follow.
    4. Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
      The dialog will close.
  19. Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
    The "Driver Package rollback" dialog will open.
  20. Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
  21. Click the "Yes" button.
    The "Driver Package rollback" dialog will close.
  22. Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.

Now start Arduino IDE again, upload the "hello" test sketch to your board. Hopefully it will no longer cause a BSoD.

When you perform the special "roll back" procedure per the instructions I provided above, Windows is smart enough to understand that it should not later update the driver to the problematic version 3.9.2024.9 again. So this fix should be persistent (until such time as WCH releases a new version of the driver, which historically they have only done every year or two, and hopefully might contain a fix anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: windows Specific to Windows operating system topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants