NimBLE-Arduino icon indicating copy to clipboard operation
NimBLE-Arduino copied to clipboard

ESP32-C2 and Arduino platform 5.5.1 multiple definition

Open EmileSpecialProducts opened this issue 2 weeks ago • 1 comments

When Compiling my project for the ESP32-C2 and Arduino platform 5.5.1 then I get the errors:

multiple definition of `scan_stack_enableAdvFlowCtrlVsCmd';
multiple definition of `adv_stack_enableClearLegacyAdvVsCmd';
multiple definition of `chanSel_stack_enableSetCsaVsCmd'; 
multiple definition of `hci_stack_enableSetVsEvtMaskVsCmd';
multiple definition of `winWiden_stack_enableSetConstPeerScaVsCmd'; 
multiple definition of `adv_stack_enableScanReqRxdVsEvent';

I have resolved this by adding this in the file NimBLE-Arduino/nimble/esp_port/esp-hci/src/na_hci_driver.c at Line 68 I do not know if the ESP_IDF_VERSION_VAL(5, 5, 1) is the Correct version.

// Prevent linking errors when using arduino + bluedroid with esp32c2
#if defined (CONFIG_IDF_TARGET_ESP32C2)
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 5, 1)
void adv_stack_enableClearLegacyAdvVsCmd(bool en){}
void scan_stack_enableAdvFlowCtrlVsCmd(bool en){}
void advFilter_stack_enableDupExcListVsCmd(bool en){}
void arr_stack_enableMultiConnVsCmd(bool en){}
void pcl_stack_enableSetRssiThreshVsCmd(bool en){}
void chanSel_stack_enableSetCsaVsCmd(bool en){}
void log_stack_enableLogsRelatedVsCmd(bool en){}
void hci_stack_enableSetVsEvtMaskVsCmd(bool en){}
void winWiden_stack_enableSetConstPeerScaVsCmd(bool en){}
#if CONFIG_IDF_TARGET_ESP32C61_ECO3
void conn_stack_enableSetPrefTxRxCntVsCmd(bool en){}
#endif // CONFIG_IDF_TARGET_ESP32C61_ECO3

void adv_stack_enableScanReqRxdVsEvent(bool en){}
void conn_stack_enableChanMapUpdCompVsEvent(bool en){}
void sleep_stack_enableWakeupVsEvent(bool en){}
#endif

EmileSpecialProducts avatar Dec 07 '25 18:12 EmileSpecialProducts

Thanks @EmileSpecialProducts, I will look into this for the next update to the nimble core.

h2zero avatar Dec 09 '25 00:12 h2zero