Using Bluetooth Classic on an ESP32C6

sc0ut_
Posts: 1
Joined: Sat Apr 27, 2024 7:40 pm

Using Bluetooth Classic on an ESP32C6

Postby sc0ut_ » 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:
bt_settings.png
bt_settings.png (5.42 KiB) Viewed 955 times
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);
}
When compiling the code, the linker throws an error:

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.
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:
bt_definition_missing.png
bt_definition_missing.png (16.43 KiB) Viewed 955 times
The #define BTC_GAP_BT_INCLUDED is FALSE because the #define UC_BT_CLASSIC_ENABLED is FALSE:
bt_defines_missing.png
bt_defines_missing.png (24.52 KiB) Viewed 955 times
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.

ESP_Sprite
Posts: 9729
Joined: Thu Nov 26, 2015 4:08 am

Re: Using Bluetooth Classic on an ESP32C6

Postby ESP_Sprite » Sun Apr 28, 2024 8:52 am

You cannot; as documented in the datasheet the C6 is a BLE-only chip meaning it doesn't support BT Classic.

Who is online

Users browsing this forum: No registered users and 93 guests