host_bluedroid_ble_compatibility_test

Example of the component espressif/esp_hosted v2.0.11
Supported Targets ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-H2 ESP32-S3 ESP32-P4 ESP32-H2

ESP-IDF BLE Compatibility Test Example

This example is to test the Bluetooth compatibility and mobile phones.

How to Use Example

This example has been modified to work with ESP-Hosted. The original ESP-IDF example is at [ https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/ble_compatibility_test ].

This example is able to run on the ESP32-P4 Dev Board, acting as the BT Host, connected to a ESP32 co-processor via the GPIO header, using SPI FD (full duplex) as Hosted HCI transport. The ESP32-P4 acts as the BT Controller. The following GPIO settings were used:

SPI Function ESP32 GPIO ESP32-P4 GPIO
MOSI 13 4
MISO 12 5
CLK 14 26
CS 15 6
Handshake 26 20
Data Ready 4 36
Reset -1 2

Note

SPI Mode 2 was used on both the ESP32-P4 and ESP32.

Users are free to choose which supported ESP-Hosted transport to use. See the main ESP-Hosted README for a list of supported transports.

Before project configuration and build, be sure to set the correct chip target using:

Bash

idf.py set-target <chip_name>

Test Scenario

  • ESP32-P4-Function-EV-Board connected to a ESP32 via the GPIO header
  • Test case
  • Test APK: LightBlue V2.0.5

Configure the project

On the ESP32-P4 Dev Board, run idf.py menuconfig.

  • Check and enable Classic Bluetooth and Classic BT HID Device under Component config --> Bluetooth --> Bluedroid Options
  • Ensure that Component config --> Bluetooth --> Controller is Disabled.
  • Under Component config --> ESP-Hosted config:
    • Configure ESP-Hosted to use SPI Full-duplex as the transport
    • Set the Slave chipset used as ESP32
    • Check and enable Bluetooth Support
    • Configure the GPIOs used for SPI FD on both the ESP32-P4 and ESP32, following the table above

Build and Flash

Run idf.py -p PORT flash monitor to build, flash and monitor the project.

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

To create a project from this example, run:

idf.py create-project-from-example "espressif/esp_hosted=2.0.11:host_bluedroid_ble_compatibility_test"

or download archive (~12.29 KB)