esp-nimble-cpp icon indicating copy to clipboard operation
esp-nimble-cpp copied to clipboard

Compilation issues on ESP-S3

Open BarakChamo opened this issue 4 years ago • 4 comments

Hi @h2zero

I just got my hands on an S3 devkit and noticed compilation issues that seem similar to previous issues mentioning the C3.

In the case of the S3, the errors are: 'struct esp_bt_controller_config_t' has no member named 'mode' 'struct esp_bt_controller_config_t' has no member named 'ble_max_conn'; did you mean 'ble_max_act'? 'struct esp_bt_controller_config_t' has no member named 'normal_adv_size' 'struct esp_bt_controller_config_t' has no member named 'scan_duplicate_type'

I tried changing the ifdef check from CONFIG_IDF_TARGET_ESP32C3 to CONFIG_IDF_TARGET_ESP32S3 and that seems to have fixed the mode error, but wasn't sure what to do with the rest.

Also, I noticed you added a few more checks for CONFIG_IDF_TARGET_ESP32. Are these limitations specific to C3? If you wouldn't mind expanding on why these checks are in place and where the different BLE featuresets are documented that would be really helpful!

Thanks again for your hard work on this library 🙏

UPDATE: I can see all the variations clearly listed here: https://github.com/espressif/esp-idf/blob/release/v4.3/components/bt/include/esp32s3/include/esp_bt.h

seems like these are removed:


    .cfg_mask = CFG_NASK,                                                  \
    .scan_duplicate_mode = SCAN_DUPLICATE_MODE,                            \
    .scan_duplicate_type = SCAN_DUPLICATE_TYPE_VALUE,                      \
    .normal_adv_size = NORMAL_SCAN_DUPLICATE_CACHE_SIZE,                   \
    .mesh_adv_size = MESH_DUPLICATE_SCAN_CACHE_SIZE,                       \
    .coex_phy_coded_tx_rx_time_limit = CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
    .hw_target_code = BLE_HW_TARGET_CODE_ESP32C3_CHIP_ECO0,                \
    .slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT,                          \
    .hw_recorrect_en = AGC_RECORRECT_EN,                                   \

while these are added:

    .coex_param_en = BT_CTRL_COEX_PARAMETERS_ENABLE,                       \
    .coex_use_hooks = BT_CTRL_COEX_USE_HOOKS,                              \

however, these are out of sync with the current master for the S3 https://github.com/espressif/esp-idf/blob/master/components/bt/include/esp32s3/include/esp_bt.h#L160

BarakChamo avatar Jul 22 '21 18:07 BarakChamo

Another update: seems to compile successfully with esp-idf#master, haven't gotten to the point of running it yet but will report back.

BarakChamo avatar Jul 22 '21 19:07 BarakChamo

Hi @BarakChamo I have not tried compiling for the S3 yet. As you have pointed out there are differences that need to be accounted for on the different chips. Looks like you've made good progress.

The ESP32 checks are needed for some functions that are only available to it due to different controllers etc..

I would very much welcome a PR with you changes if you'd like to submit one.

h2zero avatar Jul 22 '21 23:07 h2zero

Hey @h2zero

So turns out installing IDF from master and switching the condition to target S3 solves all issues.

Very happy to submit a PR once 4.4 is released and we can see no other changes were added.

BarakChamo avatar Jul 23 '21 01:07 BarakChamo

@BarakChamo Could you close the issue then?

mickeyl avatar Apr 28 '23 15:04 mickeyl