ESP32-S3使能了TINYUSB后无法使用蓝牙

Moderator: ESP_Bob

cheenyoulin
Posts: 2
Joined: Fri Jul 28, 2023 4:22 pm

ESP32-S3使能了TINYUSB后无法使用蓝牙

Postby cheenyoulin » Sun Jul 30, 2023 6:48 am

我用示例的hello world工程,menuconfig使能了蓝牙,然后导入esp_bt头文件,编译没有问题,但是我用了示例的tinyusb hid工程,做同样的操作,会找不到esp_bt.h文件,已经Clean过后再编译了。
ec127ce412ee1046a43fa88f420e5c2c.png
ec127ce412ee1046a43fa88f420e5c2c.png (19.6 KiB) Viewed 14305 times
工程在此:
tusb_hid.zip
(3.48 MiB) Downloaded 545 times

ESP_Bob
Posts: 80
Joined: Fri Nov 27, 2020 12:52 pm

Re: ESP32-S3使能了TINYUSB后无法使用蓝牙

Postby ESP_Bob » Tue Aug 08, 2023 7:49 am

main/CMakeLists.txt 中的 `REQUIRES driver` 删除,然后把 build 目录删除再试试。

cheenyoulin
Posts: 2
Joined: Fri Jul 28, 2023 4:22 pm

Re: ESP32-S3使能了TINYUSB后无法使用蓝牙

Postby cheenyoulin » Fri Aug 11, 2023 11:30 am

删除后,再次编译,会找不到nvs相关函数,引入#include "nvs_flash.h"后可以继续编译
但最后链接时,仍然找不到蓝牙相关的函数引用

Code: Select all

[1/10] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\Administrator\Downloads\tusb_hid\tusb_hid\build\bootloader\esp-idf\esptool_py && C:\Users\Administrator\.espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe C:/Users/Administrator/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/build/bootloader/bootloader.bin"
Bootloader binary size 0x51f0 bytes. 0x2e10 bytes (36%) free.
[2/8] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/tusb_hid_example_main.c.obj
C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:782:13: warning: 'app_send_hid_demo' defined but not used [-Wunused-function]  
  782 | static void app_send_hid_demo(void)
      |             ^~~~~~~~~~~~~~~~~
[6/8] Linking CXX executable tusb_hid.elf
FAILED: tusb_hid.elf 
cmd.exe /C "cd . && C:\Users\Administrator\.espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin\xtensa-esp32s3-elf-g++.exe -mlongcalls -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32S3=0 -Wl,--Map=C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/build/tusb_hid.map -Wl,--no-warn-rwx-segments -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32s3.peripherals.ld -T esp32s3.rom.ld -T esp32s3.rom.api.ld -T esp32s3.rom.libgcc.ld -T esp32s3.rom.newlib.ld -T esp32s3.rom.version.ld -T memory.ld -T sections.ld @CMakeFiles\tusb_hid.elf.rsp -o tusb_hid.elf  && cd ."
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/main/libmain.a(tusb_hid_example_main.c.obj):(.literal.gap_event_handler+0x1c): undefined reference to `esp_ble_gap_start_advertising'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/main/libmain.a(tusb_hid_example_main.c.obj):(.literal.gatts_profile_event_handler+0x70): undefined reference to `esp_ble_gap_config_adv_data_raw'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/main/libmain.a(tusb_hid_example_main.c.obj):(.literal.gatts_profile_event_handler+0x74): undefined reference to `esp_ble_gap_config_scan_rsp_data_raw'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/main/libmain.a(tusb_hid_example_main.c.obj): in function `gap_event_handler':
C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:228: undefined reference to `esp_ble_gap_start_advertising'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:234: undefined reference to `esp_ble_gap_start_advertising'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: esp-idf/main/libmain.a(tusb_hid_example_main.c.obj): in function `gatts_profile_event_handler':
C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:349: undefined reference to `esp_ble_gap_config_adv_data_raw'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:354: undefined reference to `esp_ble_gap_config_scan_rsp_data_raw'
c:/users/administrator/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:/Users/Administrator/Downloads/tusb_hid/tusb_hid/main/tusb_hid_example_main.c:466: undefined reference to `esp_ble_gap_start_advertising'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

 *  终端进程“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja ”已终止,退出代码: 1。

ESP_Bob
Posts: 80
Joined: Fri Nov 27, 2020 12:52 pm

Re: ESP32-S3使能了TINYUSB后无法使用蓝牙

Postby ESP_Bob » Tue Aug 15, 2023 10:04 am

app_send_hid_demo 是用户代码,不是蓝牙提供的,请检查该函数是否在用户代码中实现

Who is online

Users browsing this forum: No registered users and 6 guests