Visual Studio Code path distortion when flash command is sent to bash

anthropophagus
Posts: 3
Joined: Fri Apr 02, 2021 6:35 pm

Visual Studio Code path distortion when flash command is sent to bash

Postby anthropophagus » Fri Apr 02, 2021 6:50 pm

Hello,
I am new to C/C++ development in VSC on Windows and I have encountered with to issues so far regarding to flashing my ESP32. First:

Code: Select all

> Executing task: C:\Users\MyName\.espressif\python_env\idf4.2_py3.7_env\Scripts\python.exe C:\Users\MyName\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM3 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 VSC_ESP.bin <

/usr/bin/bash: C:UsersMyName.espressifpython_envidf4.2_py3.7_envScriptspython.exe: command not found
The terminal process "C:\cygwin64\bin\bash.exe '-c', 'C:\Users\MyName\.espressif\python_env\idf4.2_py3.7_env\Scripts\python.exe C:\Users\MyName\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM3 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 VSC_ESP.bin'" failed to launch (exit code: 127).
This happens if my Settings.json contains this:

Code: Select all

"idf.pythonBinPathWin": "C:\\Users\\MyName\\.espressif\\python_env\\idf4.2_py3.7_env\\Scripts\\python.exe"
If I edit Settings.json so that python path looks like this:

Code: Select all

 Executing task: C:/Users/MyName/.espressif/python_env/idf4.2_py3.7_env/Scripts/python.exe C:\Users\MyName\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM3 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 VSC_ESP.bin <

C:\Users\MyName\AppData\Local\Programs\Python\Python37\python.exe: can't open file 'C:UsersMyNameespesp-idfcomponentsesptool_pyesptoolesptool.py': [Errno 2] No such file or directory
The terminal process "C:\cygwin64\bin\bash.exe '-c', 'C:/Users/MyName/.espressif/python_env/idf4.2_py3.7_env/Scripts/python.exe C:\Users\MyName\esp\esp-idf\components\esptool_py\esptool\esptool.py -p COM3 -b 460800 --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 VSC_ESP.bin'" terminated with exit code: 2.
So, the python command is now recognized as the path is no more distorted, but I have not a clue where "C:\Users\MyName\esp\esp-idf\components\esptool_py\esptool\esptool.py" is defined so I cannot edit it so that bash would understand that. Of course, another option would fix the distortion issue but I do not understand what is causing that.

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: Visual Studio Code path distortion when flash command is sent to bash

Postby ESP_bignacio » Wed Apr 07, 2021 11:22 am

Can you change the terminal for Visual Studio Code like:

"terminal.integrated.shell.windows": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" in you settings.json

or command prompt ? We haven't tested the extension tasks using Cygwin64 bash

Who is online

Users browsing this forum: No registered users and 79 guests