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

Espressif-IDE is not clearing serial port before trying to upload (IEP-1398) #1115

Open
jessecheu opened this issue Jan 12, 2025 · 2 comments
Assignees

Comments

@jessecheu
Copy link

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:

  1. 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.

@github-actions github-actions bot changed the title Espressif-IDE is not clearing serial port before trying to upload Espressif-IDE is not clearing serial port before trying to upload (IEP-1398) Jan 12, 2025
@DerValdemar
Copy link

DerValdemar commented Jan 21, 2025

I have same problem. Did you found any solutions for this? I also noticed that if I close COM monitor with Ctrl+] next flashing is succesful

@sigmaaa
Copy link
Collaborator

sigmaaa commented Jan 21, 2025

Hi @jessecheu, @DerValdemar

Thank you for reporting this issue!

I’m unable to reproduce it on my end, but it seems the issue might occur because the serial monitor opens automatically after flashing.

When this happens, could you try switching to the terminal tab and disconnecting the terminal connection using this button?
Image

Additionally, if opening the serial monitor after flashing is not essential, you can disable this behavior by editing the configuration and turning off the "Open Serial Monitor After Flashing" option.

Image

However, even without this option, the serial monitor can be launched manually by using this icon:

Image
and then selecting "ESP-IDF Serial Monitor"

@sigmaaa sigmaaa self-assigned this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants