乐鑫技术交流
直播中

李燕

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

tinyusb示例是如何为usbtiny.h生成一个找不到文件错误的?

对于 IDF 4.4.3 版,tinyusb 示例会为 usbtiny.h 生成一个找不到文件的错误。默认配置似乎是正确的,但包含路径中似乎缺少相关目录。
我通过运行 install.sh 和采购 export.sh 脚本来设置 IDF,并按预期从“idf.py build”开始构建。
仅在 1095 的 1019 之后,我收到以下错误:
[1019/1035] Building C object esp-idf/main/..._idf_main.dir/tusb_serial_device_main.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir /tusb_serial_device_main.c.obj
/home/thomas/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/ esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I../main -I../../../../../components/newlib/platform_include -I../../../ ../../components/freertos/include -I../../../../../components/freertos/include/esp_additions/freertos -I../../../.. /../components/freertos/port/xtensa/include -I../../../../../components/freertos/include/esp_additions -I../../../.. /../components/esp_hw_support/include -I../../../../../components/esp_hw_support/include/soc -I../../../../../组件/esp_hw_support/include/soc/esp32 -I../../../../../components/esp_hw_support/port/esp32/. -I../../../../../components/esp_hw_support/port/esp32/private_include -I../../../../.. /components/heap/include -I../../../../../components/log/include -I../../../../../components/lwip/include /apps -I../../../../../components/lwip/include/apps/sntp -I../../../../../components/lwip/lwip /src/include -I../../../../../components/lwip/port/esp32/include -I../../../../../components/lwip /port/esp32/include/arch -I../../../../../components/soc/include -I../../../../../components/soc /esp32/。-I../../../../../components/soc/esp32/include -I../../../../../components/hal/esp32/include -I ../../../../../components/hal/include -I../../../../../components/hal/platform_port/include -I../. ./../../../components/esp_rom/include -I../../../../../components/esp_rom/include/esp32 -I../../.. /../../components/esp_rom/esp32 -I../../../../../components/esp_common/include -I../../../../.. /components/esp_system/include -I../../../../.. /components/wifi_provisioning/include -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated -declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=/work/idf-esp32-v4.4/examples/peripherals/usb/tusb_serial_device=。-fmacro-prefix-map=/work/idf-esp32-v4.4=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-转换-std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER="v4.4.3-dirty" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/tusb_serial_device_main.c .obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/tusb_serial_device_main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.
../main/tusb_serial_device_main.c:18:10: fatal error: tinyusb.h: No such file or directory
#include "tinyusb.h"
          ^~~~~~~~~~~
编译终止。
[1025/1035] 构建 C 对象 esp-idf/libso...ypto_core/ed25519/ref10/ed25519_ref10.c.obj
ninja:构建停止:子命令失败。
ninja 失败,退出代码 1
这是:
commit 6407ecb3f8d2cc07c4c230e7e64f2046af5c86f7(HEAD,标签:v4.4.3)






回帖(3)

王苑苑

2023-3-2 15:45:21
问题是您正在为不支持 USB 的 ESP32 芯片编译示例。如果您真的打算在 ESP32-S2 或 ESP32-S3 上运行示例,则需要运行 `idf.py set-target esp32s2` 或 `idf.py set-target esp32s3` 然后重新构建。
举报

李青

2023-3-2 15:45:27
我无法将 set-target 步骤集成到我的构建环境中,它应该使用 -B 标志来设置构建目录,还有一些 -Ddefines 通过 CMakeLists.txt 中的环境变量和 add_compile_definitions( MY_DEF=$ENV{MY_DEF})。此外,我想从我尝试符号链接到 sdkconfig.defaults 的构建特定文件中设置 sdkconfig。
举报

李皓茗

2023-3-2 15:45:32
使用“idf.py set-target esp32-s2”设置目标后,构建环境使用我的自定义定义进行了正确设置,但对于目标设备而言似乎不完整。所以直接运行ninja是不行的。如果我改为运行“idf.py build”,则配置会获得正确的目标设备,但会丢失自定义 -D 定义。
举报

更多回帖

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