乐鑫技术交流
直播中

李桂英

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

ESP32S3编译示例工程a2dp_sink出错的原因?

ESP-IDF 4.4.2
示例工程 examplesbluetoothbluedroidclassic_bta2dp_sink 在 ESP32 下编译正常,但是改为 S3 后,链接时报错,若干函数找不到。
我看了一下 sdkconfig.defaults 文件,里面很多选项,在切换到 S3 以后,menuconfig 里是没有的。
S3不支持 a2dp 吗?还是这个示例工程不兼容 S3 ?
/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x38): undefined reference to `esp_bt_gap_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x3c): undefined reference to `esp_avrc_ct_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x40): undefined reference to `esp_avrc_ct_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x44): undefined reference to `esp_avrc_tg_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x48): undefined reference to `esp_avrc_tg_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x4c): undefined reference to `esp_avrc_rn_evt_bit_mask_operation'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x50): undefined reference to `esp_avrc_tg_set_rn_evt_cap'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x54): undefined reference to `esp_a2d_sink_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x58): undefined reference to `esp_a2d_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x5c): undefined reference to `esp_a2d_sink_register_data_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.bt_av_hdl_stack_evt+0x60): undefined reference to `esp_bt_gap_set_scan_mode'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x38): undefined reference to `esp_bt_gap_set_pin'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj): in function `bt_av_hdl_stack_evt':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:107: undefined reference to `esp_bt_gap_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:109: undefined reference to `esp_avrc_ct_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:110: undefined reference to `esp_avrc_ct_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:111: undefined reference to `esp_avrc_tg_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:112: undefined reference to `esp_avrc_tg_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:115: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:116: undefined reference to `esp_avrc_tg_set_rn_evt_cap'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:118: undefined reference to `esp_a2d_sink_init'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:119: undefined reference to `esp_a2d_register_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:120: undefined reference to `esp_a2d_sink_register_data_callback'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:123: undefined reference to `esp_bt_gap_set_scan_mode'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(main.c.obj): in function `app_main':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/main.c:167: undefined reference to `esp_bt_gap_set_pin'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj):(.literal.bt_av_new_track+0x4): undefined reference to `esp_avrc_ct_send_metadata_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj):(.literal.bt_av_new_track+0x8): undefined reference to `esp_avrc_ct_send_register_notification_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj):(.literal.bt_av_hdl_avrc_ct_evt+0x20): undefined reference to `esp_avrc_ct_send_get_rn_capabilities_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj):(.literal.volume_set_by_local_host+0x18): undefined reference to `esp_avrc_tg_send_rn_rsp'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_hdl_a2d_evt':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:248: undefined reference to `esp_bt_gap_set_scan_mode'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:252: undefined reference to `esp_bt_gap_set_scan_mode'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_new_track':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:307: undefined reference to `esp_avrc_ct_send_metadata_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:107: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:109: undefined reference to `esp_avrc_ct_send_register_notification_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_playback_changed':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:116: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:118: undefined reference to `esp_avrc_ct_send_register_notification_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_play_pos_changed':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:125: undefined reference to `esp_avrc_rn_evt_bit_mask_operation'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:127: undefined reference to `esp_avrc_ct_send_register_notification_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_hdl_avrc_ct_evt':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:326: undefined reference to `esp_avrc_ct_send_get_rn_capabilities_cmd'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `volume_set_by_local_host':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:217: undefined reference to `esp_avrc_tg_send_rn_rsp'/home/alee/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: esp-idf/main/libmain.a(bt_app_av.c.obj): in function `bt_av_hdl_avrc_tg_evt':/mnt/d/lib/esp-idf-v4.4/examples/bluetooth/bluedroid/classic_bt/a2dp_sink/main/bt_app_av.c:410: undefined reference to `esp_avrc_tg_send_rn_rsp'collect2: error: ld returned 1 exit statusninja: build stopped: subcommand failed.ninja failed with exit code 1

                                                                                                                                               

回帖(1)

nhcp

2024-6-13 16:37:05
根据您提供的信息,我将分步分析可能导致编译错误的原因:

1. **检查ESP-IDF版本**:首先,请确保您使用的ESP-IDF版本与ESP32-S3兼容。虽然您使用的是ESP-IDF 4.4.2,但建议您查看ESP-IDF的官方文档,以确认该版本是否支持ESP32-S3。

2. **检查示例工程兼容性**:其次,您提到在ESP32上编译示例工程没有问题,但在ESP32-S3上出现链接错误。这可能意味着示例工程可能不完全兼容ESP32-S3。您可以尝试查找是否有针对ESP32-S3的示例工程,或者查看示例工程的更新日志,看看是否有关于ESP32-S3的兼容性信息。

3. **检查编译器和链接器设置**:链接错误可能是由于编译器或链接器设置不正确导致的。请检查您的编译器和链接器设置,确保它们与ESP32-S3兼容。您可以尝试清理项目并重新编译,以确保所有设置都正确应用。

4. **检查函数实现**:您提到链接时报错,若干函数找不到。这可能是因为ESP32-S3的某些硬件特性或库函数与ESP32不同。您可以检查报错的函数,看看它们是否在ESP32-S3上实现了,或者是否有替代的实现方式。

5. **使用menuconfig检查配置**:您提到在切换到S3后,menuconfig里有很多选项。这可能意味着某些配置选项在ESP32-S3上不可用。您可以使用menuconfig检查并调整相关配置选项,以确保它们与ESP32-S3兼容。

6. **查阅官方文档和社区**:最后,您可以查阅ESP32-S3的官方文档,看看是否有关于A2DP支持的信息。此外,您还可以在ESP-IDF社区中寻求帮助,看看其他开发者是否遇到了类似的问题,并了解他们是如何解决的。

综上所述,要解决这个问题,您需要检查ESP-IDF版本、示例工程兼容性、编译器和链接器设置、函数实现以及配置选项。同时,查阅官方文档和社区也是一个很好的途径。希望这些信息能帮助您解决问题。
举报

更多回帖

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