Can't compile BLE

Sports5115
Posts: 12
Joined: Mon Jul 24, 2023 2:32 pm

Can't compile BLE

Postby Sports5115 » Tue May 28, 2024 10:32 pm

ESP32 WROOM32D
latest IDF docker image
in menuconfig I enabled

Bluetooth/host bluedroid/
Bluetooth/controller
Bluetooth/bluedroidoptions/ Enable BLE 4.2 features

CMake txt:
idf_component_register(SRCS “ble_wrp.c”
REQUIRES driver
PRIV_REQUIRES nvs_flash bt
INCLUDE_DIRS “include”)

Code: Select all

rm -R build 
idf.py build
still getting

Code: Select all

/project/main/ble_wrp.c:20:8: error: unknown type name 'esp_ble_scan_params_t'
   20 | static esp_ble_scan_params_t ble_scan_params = {
      |        ^~~~~~~~~~~~~~~~~~~~~
I think this is not activated
#if CONFIG_BT_BLE_42_FEATURES_SUPPORTED==0
#error "BLE 42 features are not enabled in menuconfig"
#endif

divy98
Posts: 6
Joined: Mon May 06, 2024 5:56 am

Re: Can't compile BLE

Postby divy98 » Wed May 29, 2024 10:40 am

In the code have you included the required bt/ble header files?

Sports5115
Posts: 12
Joined: Mon Jul 24, 2023 2:32 pm

Re: Can't compile BLE

Postby Sports5115 » Thu Jun 06, 2024 8:44 pm

in sdkconfig I have

Code: Select all

CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y

Code: Select all

   esp_ble_scan_params_t;
is implemented in

Code: Select all

  components/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h

and i have this in my C file:

Code: Select all

  #include "esp_gap_ble_api.h"
same way as instructed in doc
https://docs.espressif.com/projects/esp ... ?highlight

so I dont understand why it doesnt work.

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Re: Can't compile BLE

Postby rrwatt » Fri Jun 07, 2024 9:34 pm

Can you post your whole CMakeLists.txt file? That might help me understand whats going on.

Sports5115
Posts: 12
Joined: Mon Jul 24, 2023 2:32 pm

Re: Can't compile BLE

Postby Sports5115 » Fri Jun 07, 2024 10:12 pm

it finds the header, includes it, but the header doesn't contain the expected type?

Code: Select all

idf_component_register(
  INCLUDE_DIRS
    "."

  SRCS
    "user_main.c"
    "dio.c"
    "ble_wrp.c"

  REQUIRES
    driver
    esp_common
    esp_driver_i2s
    freertos
    hal
    log
    bt
    nvs_flash
)
also attaching the generated sdkconfig
Attachments
sdkconfig.txt
(76.65 KiB) Downloaded 46 times

rrwatt
Posts: 19
Joined: Mon Jan 01, 2024 3:13 am

Re: Can't compile BLE

Postby rrwatt » Fri Jun 07, 2024 10:30 pm

I think the problem is with the state of BLE_42_FEATURE_SUPPORT in the header file. You can try to override it by removing the if/endif in the header file and forcing it to define esp_ble_scan_params_t no matter what. Remember to change it back later though.

Sports5115
Posts: 12
Joined: Mon Jul 24, 2023 2:32 pm

Re: Can't compile BLE

Postby Sports5115 » Fri Jun 07, 2024 11:50 pm

I had to manually add

Code: Select all

add_compile_definitions(BLE_42_FEATURE_SUPPORT)
into cmake file.
What a shitty system :(

Who is online

Users browsing this forum: Majestic-12 [Bot] and 137 guests