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

[Bug Report]: Incorrect execution of mkdfu.py (VSC-911) #728

Closed
3 tasks done
ayavilevich opened this issue Jun 1, 2022 · 1 comment · Fixed by #740
Closed
3 tasks done

[Bug Report]: Incorrect execution of mkdfu.py (VSC-911) #728

ayavilevich opened this issue Jun 1, 2022 · 1 comment · Fixed by #740
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)

Comments

@ayavilevich
Copy link

ayavilevich commented Jun 1, 2022

Pre Bug Report Checklist
Before reporting any bug please make sure of these points.

  • Make sure you have searched for existing bugs and features request before you post an issue.
  • This is a bug report for the ESP-IDF Visual Studio Code extension and not an ESP-IDF bug report.
  • I've read the docs and found no information that could have helped solving the issue.

Describe the bug

When building a project using DFU as the flash method, the extension tries to execute
C:\Users\[user]\espmaster\esp-idf\tools\mkdfu.py
without specifying the python exe path first. Resulting in an attempt to run the file with the program that is associated with the file type "py" (Windows OS).

To Reproduce
Create a new ESP32-S2 project. Can use hello_world as template.
Build with method UART then build with method DFU. See terminal and note how system executes mkdfu.py . If you have notepad associated with .py then it will open there.

Expected behavior
Expecting to specify the path to
C:\Users\[username]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe
as first parameter of execution. Just like when calling idf_size.py for example.

Screenshots / terminal output

DFU

> Executing task: ninja  <

[1/4] cmd.exe /C "cd /D C:\Users\[user]\Desktop\ESP32-waker\test\build\esp-idf\esptool_py && C:\Users\[user]\.espressif\python_env\idf5.0_py3...p C:/Users/[user]/Desktop/ESP32-waker/test/build/partition_table/partition-table.bin C:/Users/[user]/Desktop/ESP32-waker/test/build/test.bin"test.bin binary size 0x26020 bytes. Smallest app partition is 0x100000 bytes. 0xd9fe0 bytes (85%) free.
[2/4] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\[user]\Desktop\ESP32-waker\test\build\bootloader\esp-idf\esptool_py && C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:/Users/[user]/espmaster/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/Users/[user]/Desktop/ESP32-waker/test/build/bootloader/bootloader.bin"
Bootloader binary size 0x5560 bytes. 0x1aa0 bytes (24%) free.

> Executing task: C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\[user]\espmaster\esp-idf\tools\idf_size.py c:\Users\[user]\Desktop\ESP32-waker\test\build\test.map <

Total sizes:
Used stat D/IRAM:   53971 bytes ( 134445 remain, 28.6% used)
      .data size:    7460 bytes
      .bss  size:    2128 bytes
      .text size:   43356 bytes
   .vectors size:    1027 bytes
Used Flash size :  103711 bytes
      .text     :   74819 bytes
      .rodata   :   28636 bytes
Total image size:  155554 bytes (.bin may be padded larger)

> Executing task: C:\Users\[user]\espmaster\esp-idf\tools\mkdfu.py write -o c:\Users\[user]\Desktop\ESP32-waker\test\build\dfu.bin --json c:\Users\[user]\Desktop\ESP32-waker\test\build\flasher_args.json --pid 2 <

UART

> Executing task: ninja  <

[1/4] cmd.exe /C "cd /D C:\Users\[user]\Desktop\ESP32-waker\test\build\esp-idf\esptool_py && C:\Users\[user]\.espressif\python_env\idf5.0_py3...p C:/Users/[user]/Desktop/ESP32-waker/test/build/partition_table/partition-table.bin C:/Users/[user]/Desktop/ESP32-waker/test/build/test.bin"test.bin binary size 0x26020 bytes. Smallest app partition is 0x100000 bytes. 0xd9fe0 bytes (85%) free.
[2/4] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\[user]\Desktop\ESP32-waker\test\build\bootloader\esp-idf\esptool_py && C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:/Users/[user]/espmaster/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/Users/[user]/Desktop/ESP32-waker/test/build/bootloader/bootloader.bin"
Bootloader binary size 0x5560 bytes. 0x1aa0 bytes (24%) free.

> Executing task: C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\[user]\espmaster\esp-idf\tools\idf_size.py c:\Users\[user]\Desktop\ESP32-waker\test\build\test.map <

Total sizes:
Used stat D/IRAM:   53971 bytes ( 134445 remain, 28.6% used)
      .data size:    7460 bytes
      .bss  size:    2128 bytes
      .text size:   43356 bytes
   .vectors size:    1027 bytes
Used Flash size :  103711 bytes
      .text     :   74819 bytes
      .rodata   :   28636 bytes
Total image size:  155554 bytes (.bin may be padded larger) 

Environment (please complete the following information):

---------------------------------------------- ESP-IDF Extension for Visual Studio Code report ---------------------------------------------
OS win32 x64 10.0.19044 
System environment variable IDF_PYTHON_ENV_PATH 
 undefined 
Visual Studio Code version 1.67.2 
Visual Studio Code language en 
Visual Studio Code shell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 
ESP-IDF Extension version 1.4.0 
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) C:\Users\[user]\espmaster\esp-idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
Custom extra paths (idf.customExtraPaths) C:\Users\[user]\.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin;C:\Users\[user]\.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s2-elf\bin;C:\Users\[user]\.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s3-elf\bin;C:\Users\[user]\.espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin;C:\Users\[user]\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\[user]\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\Users\[user]\.espressif\tools\cmake\3.20.3\bin;C:\Users\[user]\.espressif\tools\openocd-esp32\v0.11.0-esp32-20211220\openocd-esp32\bin;C:\Users\[user]\.espressif\tools\ninja\1.10.2;C:\Users\[user]\.espressif\tools\idf-exe\1.0.3;C:\Users\[user]\.espressif\tools\ccache\4.3\ccache-4.3-windows-64;C:\Users\[user]\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
Custom extra vars (idf.customExtraVars) {"OPENOCD_SCRIPTS":"C:\\Users\\[user]\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20211220/openocd-esp32/share/openocd/scripts","IDF_CCACHE_ENABLE":"1"}
Virtual env Python Path (idf.pythonBinPath) C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe
Serial port (idf.port) COM16
OpenOCD Configs (idf.openOcdConfigs) interface/ftdi/esp32_devkitj_v1.cfg,target/esp32s2.cfg
ESP-IDF Tools Path (idf.toolsPath) C:\Users\[user]\.espressif
Git Path (idf.gitPath) C:\Users\[user]\.espressif\tools\idf-git\2.30.1\cmd\git.exe
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-IDF Custom extra paths
Access to C:\Users\[user]\.espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin: true
Access to C:\Users\[user]\.espressif\tools\xtensa-esp32s2-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s2-elf\bin: true
Access to C:\Users\[user]\.espressif\tools\xtensa-esp32s3-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32s3-elf\bin: true
Access to C:\Users\[user]\.espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin: true
Access to C:\Users\[user]\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin: true
Access to C:\Users\[user]\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin: true
Access to C:\Users\[user]\.espressif\tools\cmake\3.20.3\bin: true
Access to C:\Users\[user]\.espressif\tools\openocd-esp32\v0.11.0-esp32-20211220\openocd-esp32\bin: true
Access to C:\Users\[user]\.espressif\tools\ninja\1.10.2: true
Access to C:\Users\[user]\.espressif\tools\idf-exe\1.0.3: true
Access to C:\Users\[user]\.espressif\tools\ccache\4.3\ccache-4.3-windows-64: true
Access to C:\Users\[user]\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64: true
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH undefined
Access to Ninja in environment PATH undefined
Access to ESP-IDF Tools Path (idf.toolsPath) true
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.30.1.windows.1
ESP-IDF version 5.0
Python version 3.8.7
Python's pip version 20.3.3
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
bitstring version: 3.1.9
certifi version: 2021.10.8
cffi version: 1.15.0
charset-normalizer version: 2.0.12
click version: 8.0.4
colorama version: 0.4.4
construct version: 2.10.68
contextlib2 version: 21.6.0
cryptography version: 36.0.2
ecdsa version: 0.17.0
esp-coredump version: 1.2
esptool version: 4.1
freertos-gdb version: 1.0.0
future version: 0.18.2
gcovr version: 5.1
idf-component-manager version: 1.1.1
idna version: 3.3
Jinja2 version: 3.1.1
kconfiglib version: 14.1.0
lxml version: 4.8.0
MarkupSafe version: 2.1.1
pip version: 20.3.3
psutil version: 5.9.0
pycparser version: 2.21
pyelftools version: 0.27
pygdbmi version: 0.9.0.2
Pygments version: 2.11.2
pyparsing version: 3.0.9
pyserial version: 3.5
pywin32 version: 303
PyYAML version: 6.0
reedsolo version: 1.5.4
requests version: 2.27.1
requests-toolbelt version: 0.9.1
schema version: 0.7.5
semantic-version version: 2.9.0
setuptools version: 62.3.2
six version: 1.16.0
tqdm version: 4.63.1
urllib3 version: 1.26.9
websocket-client version: 1.3.2
wheel version: 0.36.2
windows-curses version: 2.3.0
xmlrunner version: 1.7.7
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Error
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Python requirements are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "espidf",
      "name": "Launch",
      "request": "launch"
    }
  ]
} 
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "C:\\Users\\[user]\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2021r2-patch3-8.4.0\\xtensa-esp32s2-elf\\bin\\xtensa-esp32s2-elf-gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${config:idf.espIdfPath}/components/**",
                "${config:idf.espIdfPathWin}/components/**",
                "${config:idf.espAdfPath}/components/**",
                "${config:idf.espAdfPathWin}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${config:idf.espIdfPath}/components",
                    "${config:idf.espIdfPathWin}/components",
                    "${config:idf.espAdfPath}/components/**",
                    "${config:idf.espAdfPathWin}/components/**",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            }
        }
    ],
    "version": 4
}
 
----------------------------------------------------------- Latest error -----------------------------------------------------------------
Latest error at Command failed: C:\Users\[user]\.espressif\python_env\idf5.0_py3.8_env\Scripts\python.exe C:\Users\[user]\espmaster\esp-idf\tools\check_python_dependencies.py -r "C:\Users\[user]\espmaster\esp-idf\requirements.txt"
Traceback (most recent call last):
  File "C:\Users\[user]\espmaster\esp-idf\tools\check_python_dependencies.py", line 40, in <module>
    with open(req_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\[user]\\espmaster\\esp-idf\\requirements.txt'

--------------------------------------------------------------------------------------------------------------------------------------------

Output

Nothing relevant in output

Logs

Nothing relevant in log

Extension Configuration settings

{
    "C_Cpp.intelliSenseEngine": "Tag Parser",
    "idf.adapterTargetName": "esp32s2",
    "idf.customExtraPaths": "C:\\Users\\[user]\\.espressif\\tools\\xtensa-esp32-elf\\esp-2021r2-patch3-8.4.0\\xtensa-esp32-elf\\bin;C:\\Users\\[user]\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2021r2-patch3-8.4.0\\xtensa-esp32s2-elf\\bin;C:\\Users\\[user]\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2021r2-patch3-8.4.0\\xtensa-esp32s3-elf\\bin;C:\\Users\\[user]\\.espressif\\tools\\riscv32-esp-elf\\esp-2021r2-patch3-8.4.0\\riscv32-esp-elf\\bin;C:\\Users\\[user]\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\Users\\[user]\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\Users\\[user]\\.espressif\\tools\\cmake\\3.20.3\\bin;C:\\Users\\[user]\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20211220\\openocd-esp32\\bin;C:\\Users\\[user]\\.espressif\\tools\\ninja\\1.10.2;C:\\Users\\[user]\\.espressif\\tools\\idf-exe\\1.0.3;C:\\Users\\[user]\\.espressif\\tools\\ccache\\4.3\\ccache-4.3-windows-64;C:\\Users\\[user]\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\Users\\\\[user]\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.11.0-esp32-20211220/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
    "idf.espIdfPathWin": "C:\\Users\\[user]\\espmaster\\esp-idf",
    "idf.openOcdConfigs": [
        "interface/ftdi/esp32_devkitj_v1.cfg",
        "target/esp32s2.cfg"
    ],
    "idf.portWin": "COM16",
    "idf.pythonBinPathWin": "C:\\Users\\[user]\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
    "idf.toolsPathWin": "C:\\Users\\[user]\\.espressif",
    "idf.flashType": "DFU"
}
@ayavilevich ayavilevich added the bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue) label Jun 1, 2022
@github-actions github-actions bot changed the title [Bug Report]: [Bug Report]: (VSC-911) Jun 1, 2022
@ayavilevich ayavilevich changed the title [Bug Report]: (VSC-911) [Bug Report]: Incorrect execution of mkdfu.py (VSC-911) Jun 1, 2022
@brianignacio5
Copy link
Collaborator

Thanks for reporting this @ayavilevich !

Will fix soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Bug Report from users on Github (don't use this tag manually, its supposed to be used via the issue)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants