Description
Describe the bug
A clear and concise description of what the bug is.
When trying to upload any program to a ESP32 MCU. I get the error message:
�[0;33m--- esp-idf-monitor 1.5.0 on \\.\COM4 115200�[0m --- Warning: ELF file 'C:/Users/../build/udemy_esp32_iot_app.elf' does not exist --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H could not open port '\\\\.\\COM4': PermissionError(13, 'Access is denied.', None, 5) --- Connection to \\.\COM4 failed. Available ports: COM4
I tried it on different ESP32 target devices so it seems the problem is with uploading using the espressif-IDE.
To Reproduce
Steps to reproduce the behavior:
- Trying to upload code.
Expected behavior
A clear and concise description of what you expected to happen.
Code is able to successfully upload code.
Screenshots
If applicable, add screenshots to help explain your problem.
Espressif-IDE Product Information:
Espressif > Product Information (Copy content from the console and attach as a file)
CDT Build environment variables.txt
Eclipse Error log:
Window > Show View > Other > Search for "Error Log" (Attach as a file)
Please attach the error log as described here !SESSION 2025-01-09 205241.515 ----.txt
I found that the fix is going to task manager and ending all python process related to espressif-ide.
It seems that the file that isn't being closed properly before trying to upload the code to the target is.
"C:\Espressif\python_env\idf5.3_py3.11_env\Scripts" and "C:\Espressif\tools\idf-python\3.11.2"
I believe that pySerial isn't being closed properly.
Another fix was to restart my computer which properly closed the serial port.