Using Bluetooth Classic on an ESP32C6
Posted: Sat Apr 27, 2024 8:09 pm
Hiya,
I've got a new ESP32-C6-DevKitM-1 and wanted to do some basic bluetooth stuff like scanning (discovering) other devices using GAP. Unfortunately there are linker errors, which I could trace down to a missing "CONFIG_BT_CLASSIC_ENABLED" #define:
I'm using ESP-IDF v5.2.1 and the ESP-IDF extension for VSCode. I've created a new project by using "idf.py create-project", which resulted in an empty project.
In this project, I used menuconfig to enable the "Bluetooth" feature: The main.c looks like:
When compiling the code, the linker throws an error:
I tried to isolate the error and this are my findings:
The function definition of esp_bt_gap_register_callback doesn't get compiled because the #define BTC_GAP_BT_INCLUDED is FALSE: The #define BTC_GAP_BT_INCLUDED is FALSE because the #define UC_BT_CLASSIC_ENABLED is FALSE: And UC_BT_CLASSIC_ENABLED is FALSE because #define CONFIG_BT_CLASSIC_ENABLED is not defined (I can't attach another screenshot, but you'll find this in components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h, line 29).
The #define CONFIG_BT_CLASSIC_ENABLED would be set if CONFIG_CLASSIC_BT_ENABLED=y would be part of the sdkconfig. But I find no way to add this feature in the menuconfig.
Do you have any hints how I can use Bluetooth Classic with the ESP32C6?
Thank you.
I've got a new ESP32-C6-DevKitM-1 and wanted to do some basic bluetooth stuff like scanning (discovering) other devices using GAP. Unfortunately there are linker errors, which I could trace down to a missing "CONFIG_BT_CLASSIC_ENABLED" #define:
I'm using ESP-IDF v5.2.1 and the ESP-IDF extension for VSCode. I've created a new project by using "idf.py create-project", which resulted in an empty project.
In this project, I used menuconfig to enable the "Bluetooth" feature: The main.c looks like:
Code: Select all
#include <stdio.h>
#include "esp_bt.h"
#include "esp_gap_bt_api.h"
void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param)
{
}
void app_main(void)
{
esp_bt_gap_register_callback(esp_bt_gap_cb);
}
Code: Select all
C:/dev/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj): in function `app_main':
C:/esp/bt_test_minimal/main/main.c:7:(.text.app_main+0x6): undefined reference to `esp_bt_gap_register_callback'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
The function definition of esp_bt_gap_register_callback doesn't get compiled because the #define BTC_GAP_BT_INCLUDED is FALSE: The #define BTC_GAP_BT_INCLUDED is FALSE because the #define UC_BT_CLASSIC_ENABLED is FALSE: And UC_BT_CLASSIC_ENABLED is FALSE because #define CONFIG_BT_CLASSIC_ENABLED is not defined (I can't attach another screenshot, but you'll find this in components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h, line 29).
The #define CONFIG_BT_CLASSIC_ENABLED would be set if CONFIG_CLASSIC_BT_ENABLED=y would be part of the sdkconfig. But I find no way to add this feature in the menuconfig.
Do you have any hints how I can use Bluetooth Classic with the ESP32C6?
Thank you.