← index #11083Issue #12015
Related · high · value 0.648
QUERY · ISSUE

Can't find esp idf header file: esp_gap_ble_api.h: No such file or directory

openby MATTYGILOopened 2023-03-20updated 2024-05-18
bug

I am trying to change the ble channel of my device, I am creating a custom user module but I get this error:

I am building with
esp idf commit:
5bb59b00e72f8f91eb24d8c65bf9a7ea2b8a4f5f

Micropython:
latest

/ble/ble.c:4:10: fatal error: esp_gap_ble_api.h: No such file or directory
 #include "esp_gap_ble_api.h"

This is my usercmodule code:

#include <stdio.h>
#include "py/nlr.h"
#include "py/runtime.h"
#include "esp_gap_ble_api.h"

STATIC mp_obj_t ble_set_channel_mask(mp_obj_t mask_obj) {
    esp_ble_adv_channel_t mask = mp_obj_get_int(mask_obj);
    esp_ble_gap_set_channel_mask(mask);
    printf("BLE channel mask set to %d\n", mask);
    return mp_const_none;
}

STATIC MP_DEFINE_CONST_FUN_OBJ_1(ble_set_channel_mask_obj, ble_set_channel_mask);

STATIC const mp_map_elem_t ble_module_globals_table[] = {
    { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_ble) },
    { MP_OBJ_NEW_QSTR(MP_QSTR_set_channel_mask), (mp_obj_t)&ble_set_channel_mask_obj },
};

STATIC MP_DEFINE_CONST_DICT(ble_module_globals, ble_module_globals_table);

const mp_obj_module_t ble_module = {
    .base = { &mp_type_module },
    .globals = (mp_obj_dict_t*)&ble_module_globals,
};

This is my micropython.cmake:

add_library(usermod_ble INTERFACE)

target_sources(usermod_ble INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}/ble.c
)

target_include_directories(usermod_ble INTERFACE
    ${CMAKE_CURRENT_LIST_DIR}
)

target_link_libraries(usermod INTERFACE usermod_ble)

This is my micropython.mk:

MBEDTLS_MOD_DIR := $(USERMOD_DIR)

SRC_USERMOD += $(MBEDTLS_MOD_DIR)/ble.c
CANDIDATE · ISSUE

esp32 build error ESP_IDF v5.2.0

closedby heikokueopened 2023-07-15updated 2024-07-13
enhancement

I got two build errors:

  1. /home/heiko/esp/esp-idf/components/app_update/include/esp_ota_ops.h:16:10: fatal error: esp_bootloader_desc.h: No such file or directory
  2. /home/heiko/esp/micropython/ports/esp32/uart.c:70:24: error: 'uart_periph_signal' undeclared (first use in this function)

To fix the first error esp_bootloader_format has to be added to esp32_common.cmake
To fix the second error #include "soc/uart_periph.h" has to be added to uart.c

I will create a pull request

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied