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

Flash from within docker fails (IDFGH-12273) (VSC-1612) #1458

Closed
3 tasks done
SimonPVS opened this issue Mar 5, 2024 · 6 comments
Closed
3 tasks done

Flash from within docker fails (IDFGH-12273) (VSC-1612) #1458

SimonPVS opened this issue Mar 5, 2024 · 6 comments
Assignees

Comments

@SimonPVS
Copy link

SimonPVS commented Mar 5, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hi

I am using esp-idf 5.1.2 and i followed the 'using-docker-container' tutorial.
It is possible to build a project inside the docker, but i am not able to flash the binary to my device.
The host os is windows 10.

Flashing fails with:

` * Executing task: /opt/esp/python_env/idf5.1_py3.8_env/bin/python /opt/esp/idf/components/esptool_py/esptool/esptool.py -p /dev/ttyUSB1 -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 COM1xx.bin 0x8000 partition_table/partition-table.bin

esptool.py v4.7.dev3
Serial port /dev/ttyUSB1

A fatal error occurred: Could not open /dev/ttyUSB1, the port is busy or doesn't exist.
([Errno 13] could not open port /dev/ttyUSB1: [Errno 13] Permission denied: '/dev/ttyUSB1')

Hint: Try to add user into dialout group: sudo usermod -a -G dialout $USER

  • The terminal process "/opt/esp/python_env/idf5.1_py3.8_env/bin/python '/opt/esp/idf/components/esptool_py/esptool/esptool.py', '-p', '/dev/ttyUSB1', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '40m', '--flash_size', '2MB', '0x1000', 'bootloader/bootloader.bin', '0x10000', 'COM1xx.bin', '0x8000', 'partition_table/partition-table.bin'" terminated with exit code: 2. `

What can I try to resolve this?

@github-actions github-actions bot changed the title Flash from within docker fails Flash from within docker fails (IDFGH-12273) Mar 5, 2024
@dobairoland
Copy link

Please see the note in the https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html#using-the-image-interactively section. Using remote serial port is a way to overcome this limitation on Windows.

@SimonPVS
Copy link
Author

SimonPVS commented Mar 5, 2024

Thanks, using the esp tool esp_rfc2217_server.exe it works.

Maybe the tutorial should be updated because this states it should work with usbipd: https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/using-docker-container.md

@dobairoland
Copy link

cc @brianignacio5

@brianignacio5
Copy link
Collaborator

brianignacio5 commented Mar 6, 2024

This question is probably better located in vscode-esp-idf-extension repository.

Are you sure that the serial port was properly bind and attached to WSL with usbipd? You can use the ESP-IDF: Select port to use command to see available serial ports. I have tested it recently and it does work as long as the device was properly bind and attached.

Will add documentation using esp tool esp_rfc2217 for an alternative solution to usbipd.

@SimonPVS
Copy link
Author

SimonPVS commented Mar 6, 2024

Apologies for using the wrong repository.

The COM port seemed to be attached to WSL. (I checked it as proposed in the tutorial)
But I think there is something wrong permission wise. I could not figure out what..

@Alvin1Zhang Alvin1Zhang transferred this issue from espressif/esp-idf Mar 9, 2025
@github-actions github-actions bot changed the title Flash from within docker fails (IDFGH-12273) Flash from within docker fails (IDFGH-12273) (VSC-1612) Mar 9, 2025
Copy link

Thanks for using our extension! 🚀

Your feedback matters! Could you take a moment to rate it on the marketplace? A positive rating helps other developers discover our tools and motivates us to keep improving.

⭐ Rate ESP-IDF Extension: https://marketplace.visualstudio.com/items?itemName=espressif.esp-idf-extension&ssr=false#review-details

Your support means a lot to our development team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants