problem bt.c

Remyhx
Posts: 23
Joined: Thu Jun 17, 2021 8:22 pm

problem bt.c

Postby Remyhx » Wed Jun 01, 2022 8:43 am

Hi,

Since the recent updates I have to add #include "esp_timer.h" to components/bt/controller/esp32/bt.c, otherwise I get a lot of compile errors compiling for NimBLE. Is this because of a fault on my side, or maybe a bug?

My IDF version: ESP-IDF v5.0-dev-3275-g01d014c42-dirty

Gr Remy

Remyhx
Posts: 23
Joined: Thu Jun 17, 2021 8:22 pm

Re: problem bt.c

Postby Remyhx » Wed Jun 01, 2022 8:45 am

NB: C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:477:18: error: unknown type name 'esp_timer_handle_t'
static DRAM_ATTR esp_timer_handle_t s_btdm_slp_tmr;
^~~~~~~~~~~~~~~~~~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c: In function 'btdm_sleep_enter_phase1_wrapper':
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1110:9: error: implicit declaration of function 'esp_timer_start_once'; did you mean 'esp_intr_alloc'? [-Werror=implicit-function-declaration]
if (esp_timer_start_once(s_btdm_slp_tmr, us_to_sleep - uncertainty) != ESP_OK) {
^~~~~~~~~~~~~~~~~~~~
esp_intr_alloc
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c: In function 'btdm_sleep_exit_phase3_wrapper':
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1146:9: error: implicit declaration of function 'esp_timer_stop'; did you mean 'esp_intr_free'? [-Werror=implicit-function-declaration]
esp_timer_stop(s_btdm_slp_tmr);
^~~~~~~~~~~~~~
esp_intr_free
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c: In function 'esp_bt_controller_init':
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1699:5: error: unknown type name 'esp_timer_create_args_t'; did you mean 'esp_coex_prefer_t'?
esp_timer_create_args_t create_args = {
^~~~~~~~~~~~~~~~~~~~~~~
esp_coex_prefer_t
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1700:9: error: field name not in record or union initializer
.callback = btdm_slp_tmr_callback,
^
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1700:9: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1700:21: warning: initialization of 'int' from 'void (*)(void *)' makes integer from pointer without a cast [-Wint-conversion]
.callback = btdm_slp_tmr_callback,
^~~~~~~~~~~~~~~~~~~~~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1700:21: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1701:9: error: field name not in record or union initializer
.arg = NULL,
^
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1701:9: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1701:16: warning: excess elements in scalar initializer
.arg = NULL,
^~~~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1701:16: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1702:9: error: field name not in record or union initializer
.name = "btSlp"
^
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1702:9: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1702:17: warning: excess elements in scalar initializer
.name = "btSlp"
^~~~~~~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1702:17: note: (near initialization for 'create_args')
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1704:16: error: implicit declaration of function 'esp_timer_create'; did you mean 'esp_intr_free'? [-Werror=implicit-function-declaration]
if ((err = esp_timer_create(&create_args, &s_btdm_slp_tmr)) != ESP_OK) {
^~~~~~~~~~~~~~~~
esp_intr_free
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1738:24: warning: comparison between pointer and integer
if (s_btdm_slp_tmr != NULL) {
^~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1739:9: error: implicit declaration of function 'esp_timer_delete'; did you mean 'esp_bt_mem_release'? [-Werror=implicit-function-declaration]
esp_timer_delete(s_btdm_slp_tmr);
^~~~~~~~~~~~~~~~
esp_bt_mem_release
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1740:24: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
s_btdm_slp_tmr = NULL;
^
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c: In function 'esp_bt_controller_deinit':
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1771:24: warning: comparison between pointer and integer
if (s_btdm_slp_tmr != NULL) {
^~
C:/Espressif/esp-idf/components/bt/controller/esp32/bt.c:1774:24: warning: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
s_btdm_slp_tmr = NULL;
^
cc1.exe: some warnings being treated as errors
[28/217] Building C object esp-id...mble/nimble/host/src/ble_sm.c.obj
ninja: build stopped: subcommand failed.

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

Re: problem bt.c

Postby ESP_Sprite » Thu Jun 02, 2022 5:19 am

Are you sure you're updating the submodules as well?

Remyhx
Posts: 23
Joined: Thu Jun 17, 2021 8:22 pm

Re: problem bt.c

Postby Remyhx » Thu Jun 02, 2022 11:20 am

Every week I do a:

git pull

git submodule update --init --recursive

If I change the bt.c, it will give a message that it won't change the file (previously never needed to do), now i just remove that file, update and then add the esp-timer.h

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

Re: problem bt.c

Postby ESP_Sprite » Fri Jun 03, 2022 2:38 am

Can you share a project (can be a sample project) you have an issue with, plus the Git commit hash of the esp-idf version it breaks with?

Who is online

Users browsing this forum: Baidu [Spider], markkuk and 297 guests