乐鑫技术交流
直播中

崔映芬

7年用户 926经验值
私信 关注
[问答]

idf.py set-target esp32s3提示错误是什么原因导致的?怎么解决?

D:硬件开发资料esp-idf-v5.0.1examplesperipheralstwaitwai_networktwai_network_master>idf.py set-target esp32s3
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory 'd:硬件开发资料esp-idf-v5.0.1examplesperipheralstwaitwai_networktwai_network_masterbuild' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32s3, new sdkconfig created. Existing sdkconfig renamed to sdkconfig.old.
Running cmake in directory d:硬件开发资料esp-idf-v5.0.1examplesperipheralstwaitwai_networktwai_network_masterbuild
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=1 d:硬件开发资 料esp-idf-v5.0.1examplesperipheralstwaitwai_networktwai_network_master"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.40.0.windows.1")
-- ccache will be used for faster recompilation
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- The ASM compiler identification is GNU
-- Found assembler: M:/work/tool/Espressif_ide2.9.0/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: M:/work/tool/Espressif_ide2.9.0/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: M:/work/tool/Espressif_ide2.9.0/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file D:/硬件开发资料/esp-idf-v5.0.1/examples/peripherals/twai/twai_network/twai_network_master/sdkconfig
Traceback (most recent call last):
  File "D:硬件开发资料esp-idf-v5.0.1toolskconfig_newprepare_kconfig_files.py", line 102, in
    main()
  File "D:硬件开发资料esp-idf-v5.0.1toolskconfig_newprepare_kconfig_files.py", line 94, in main
    env.update(json.load(args.env_file))
  File "C:UsersiwlbAppDataLocalProgramsPythonPython310libjson__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 35: illegal multibyte sequence
Traceback (most recent call last):
  File "D:硬件开发资料esp-idf-v5.0.1toolskconfig_newconfgen.py", line 607, in
    main()
  File "D:硬件开发资料esp-idf-v5.0.1toolskconfig_newconfgen.py", line 255, in main
    env = json.load(args.env_file)
  File "C:UsersiwlbAppDataLocalProgramsPythonPython310libjson__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 35: illegal multibyte sequence
CMake Error at D:/硬件开发资料/esp-idf-v5.0.1/tools/cmake/kconfig.cmake:176 (message):
  Failed to run confgen.py
  (M:/work/tool/Espressif_ide2.9.0/python_env/idf5.0_py3.10_env/Scripts/python.exe;D:/硬件开发资料/esp-idf-v5.0.1/tools/kconfig_new/confgen.py;--list-separator=semicolon;--kconfig;D:/硬件开发资料/esp-idf-v5.0.1/Kconfig;--sdkconfig-rename;D:/硬件开发资料/esp-idf-v5.0.1/sdkconfig.rename;--config;D:/硬件开发资料/esp-idf-v5.0.1/examples/peripherals/twai/twai_network/twai_network_master/sdkconfig;--env-file;D:/硬件开发资料/esp-idf-v5.0.1/examples/peripherals/twai/twai_network/twai_network_master/build/config.env).
  Error 1
Call Stack (most recent call first):
  D:/硬件开发资料/esp-idf-v5.0.1/tools/cmake/build.cmake:590 (__kconfig_generate_config)
  D:/硬件开发资料/esp-idf-v5.0.1/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "D:/硬件开发资料/esp-idf-v5.0.1/examples/peripherals/twai/twai_network/twai_network_master/build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf.py", line 772, in
    main()
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf.py", line 707, in main
    cli(sys.argv[1:], prog_name=PROG, complete_var=SHELL_COMPLETE_VAR)
  File "M:worktoolEspressif_ide2.9.0python_envidf5.0_py3.10_envlibsite-packagesclickcore.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "M:worktoolEspressif_ide2.9.0python_envidf5.0_py3.10_envlibsite-packagesclickcore.py", line 1053, in main
    rv = self.invoke(ctx)
  File "M:worktoolEspressif_ide2.9.0python_envidf5.0_py3.10_envlibsite-packagesclickcore.py", line 1691, in invoke
    return _process_result(rv)
  File "M:worktoolEspressif_ide2.9.0python_envidf5.0_py3.10_envlibsite-packagesclickcore.py", line 1628, in _process_result
    value = ctx.invoke(self._result_callback, value, **ctx.params)
  File "M:worktoolEspressif_ide2.9.0python_envidf5.0_py3.10_envlibsite-packagesclickcore.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf.py", line 602, in execute_tasks
    task(ctx, global_args, task.action_args)
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf.py", line 189, in __call__
    self.callback(self.name, context, global_args, **action_args)
  File "d:硬件开发资料esp-idf-v5.0.1toolsidf_py_actionscore_ext.py", line 161, in set_target
    ensure_build_directory(args, ctx.info_name, True)
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf_py_actionstools.py", line 455, in ensure_build_directory
    RunTool('cmake', cmake_args, cwd=args.build_dir, hints=hints)()
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf_py_actionstools.py", line 219, in __call__
    print_hints(stderr_output_file, stdout_output_file)
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf_py_actionstools.py", line 125, in print_hints
    output = ' '.join(line.strip() for line in file if line.strip())
  File "D:硬件开发资料esp-idf-v5.0.1toolsidf_py_actionstools.py", line 125, in
    output = ' '.join(line.strip() for line in file if line.strip())
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 50: illegal multibyte sequence

D:硬件开发资料esp-idf-v5.0.1examplesperipheralstwaitwai_networktwai_network_master>
                     

回帖(2)

任莉虹

2024-6-12 09:48:33
请更换 esp-idf 在英文路径下。
举报

贺服窍

2024-6-12 16:27:42
根据您提供的错误信息,这个问题可能是由于以下几个原因导致的:

1. 路径问题:您的项目路径中可能包含特殊字符或空格,导致命令无法正确执行。
2. 权限问题:您可能没有足够的权限来执行这个命令。
3. 环境问题:您的开发环境可能没有正确配置。

为了解决这个问题,请尝试以下步骤:

1. 检查路径:确保您的项目路径中没有特殊字符或空格。如果有,请将项目移动到一个没有特殊字符或空格的路径下。

2. 以管理员身份运行:尝试以管理员身份运行命令提示符或终端,然后再次执行命令。

3. 检查环境变量:确保您的环境变量已经正确设置。对于ESP-IDF,您需要设置以下环境变量:
   - `IDF_PATH`:指向您的ESP-IDF安装目录。
   - `PATH`:将`IDF_PATH`中的`components/esptool_py/esptool`添加到系统路径。

4. 更新ESP-IDF:您当前使用的ESP-IDF版本是5.0.1,尝试更新到最新版本,以获取最新的功能和修复。

5. 清理并重新配置:在命令提示符或终端中,尝试执行以下命令来清理并重新配置项目:
   ```
   cd path/to/your/project
   idf.py fullclean
   idf.py set-target esp32s3
   idf.py menuconfig
   ```


举报

更多回帖

发帖
×
20
完善资料,
赚取积分