Hey there,i currently doing a project using nodemcu esp8266, when i upload the code, it shows this output telling some fatal error. Anyone know what is this error and how to fix it? This project is important to me as it is my fyp. Thanks yall
. Variables and constants in RAM (global, static), used 40368 / 80192 bytes (50%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1684 initialized variables
╠══ RODATA 8324 constants
╚══ BSS 30360 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 62811 / 65536 bytes (95%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 30043 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 452128 / 1048576 bytes (43%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 452128 code in flash
esptool.py v3.0
Serial port COM5
A fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
If it isn't clear, alternatively you can provide the link to where you bought the board from and we'll see if we can determine the chip from the product listing.
OK, great. This "PermissionError(13, 'A device attached to the system is not functioning.', None, 31)" error can occur when uploading to the boards that use specific batches of the WCH CH340 USB chip. We have noticed a characteristic of those sketchy CH340 chips is the lack of labeling (normally "WCH CH340G" is written on them), as is the case with your chip. The problem only occurs when using the latest version of the CH340 driver.
The affected users have reported that doing a "roll back" to an older version of the driver was an effective workaround. You can give that a try.
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 a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
Click the "Update driver" button.
An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
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 reply on the forum thread to let me know. I'll provide alternative instructions you can follow.
Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
The dialog will close.
Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
The "Driver Package rollback" dialog will open.
Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
Click the "Yes" button.
The "Driver Package rollback" dialog will close.
Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that error during the sketch upload.
I moved your topic to an appropriate forum category @johnweak1998.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
I have found that when the driver installation gets into this state, it can be solved by uninstalling and then reinstalling the drivers. After that, the "roll back" option should be enabled.
I'll provide instructions:
Close Arduino IDE if it is running.
Connect the Arduino board to your computer with a USB cable.
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.
Click the "Uninstall Device" button.
The "Uninstall Device" dialog will open.
Check the box next to "☐ Attempt to remove the driver for this device.".
Click the "Uninstall" button.
The "Uninstall Device" and "USB-SERIAL CH340 (COMn) Properties" dialogs will close.
Disconnect the USB cable of the Arduino board from your computer.
Reconnect the USB cable of the Arduino board to your computer.
Wait for the "USB-SERIAL CH340 (COMn)" device to appear under the "Ports (COM & LPT)" section of the Device Manager tree. This will take a couple of minutes as Windows must first automatically reinstall the driver. It might appear first as a "USB2.0-Serial" device under the "Other devices section of the tree. Just wait for a little longer and it will appear in its final place under the "Ports (COM & LPT)" section.
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.
A "DriverSetup(X64)" dialog will appear. Click the "INSTALL" button in the dialog.
Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
Click the "OK" button in the "Driver install success!" dialog.
Click the X icon at the top right of the "DriverSetup(X64)" dialog to close it.
Switch back to the Windows "Device Manager".
Double click on the "USB-SERIAL CH340 (COMn)" device under the "Ports (COM & LPT)" section.
The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
Click the "Update driver" button.
An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
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.
Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
The dialog will close.
Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
The "Driver Package rollback" dialog will open.
Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
Click the "Yes" button.
The "Driver Package rollback" dialog will close.
Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that error during the sketch upload.
Hello,
I followed all the steps you mentioned, and initially, everything worked fine. However, after some time, I encountered the same issue again. To troubleshoot, I repeated the steps, and surprisingly, it started working again. This happened yesterday, and today, it worked consistently for about 5-6 times. However, on the 7th attempt, I encountered the same error once more.
I'm not sure why this inconsistency is happening. Could you please provide guidance on what I should do next to address this issue?
Thank you.
Hi @prakruti_b. I'm going to ask you to post the full verbose output from an upload attempt when the failure occurs.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Uncheck the box next to Show verbose output during: ☑ compilation in the "Preferences" dialog.
Check the box next to Show verbose output during: ☐ upload.
Click the "OK" button.
The "Preferences" dialog will close.
Attempt an upload, as you did before.
Wait for the upload to fail. If the upload is successful, continue uploading until a failure occurs.
You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
Open a forum reply here by clicking the "Reply" button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the error output from the upload into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
"C:\Users\hbhav\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\hbhav\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/upload.py" --chip esp8266 --port "COM3" --baud "115200" "" --before default_reset --after hard_reset write_flash 0x0 "C:\Users\hbhav\AppData\Local\Temp\arduino\sketches\0C9043DF09502880EA2A8A78785DD822/ir.ino.bin"
esptool.py v3.0
Serial port COM3
A fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
I've included the detailed output as you requested. Is this the information you were looking for?
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 "Drivers" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
Now please reply here on the forum thread to tell us the version number you saw after "Driver Version" field in that "USB-SERIAL CH340 (COMn) Properties" dialog.
I also have problems with my esp8266 boards on my windows 11 stationary PC. Sometimes the upload stops after 16% sometimes it stops immediatedly (during connect).
My CH340 driver is version 3.7.2022.1 (i downgraded)
On my windows 10 laptop i have no problems...
Hope this can help
I tried to roll back the driver but that option doesn't appear for me even after folling your steps. Do you know what could be wrong and how to fix this?