h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
711 stars 147 forks source link

undefined reference to `xPortEnterCriticalTimeout' #434

Closed AndrewMagpie closed 4 months ago

AndrewMagpie commented 2 years ago

I'm new to using nimble, but was using default esp32 BLE library authored by nkolban.

When I try build my sketch I get the follow compiler errors:

c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\NimBLE-Arduino\NimBLECharacteristic.cpp.o: in function `NimBLECharacteristic::getValue(long*)':
C:\Users\ME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:578: undefined reference to `xPortEnterCriticalTimeout'
c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\NimBLE-Arduino\NimBLECharacteristic.cpp.o: in function `NimBLECharacteristic::setValue(unsigned char const*, unsigned int)':
C:\Users\ME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:578: undefined reference to `xPortEnterCriticalTimeout'
c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\NimBLE-Arduino\NimBLECharacteristic.cpp.o: in function `NimBLECharacteristic::handleGapEvent(unsigned short, unsigned short, ble_gatt_access_ctxt*, void*)':
C:\Users\ME\Documents\Arduino\libraries\NimBLE-Arduino\src/NimBLECharacteristic.cpp:284: undefined reference to `xPortEnterCriticalTimeout'
c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\NimBLE-Arduino\nimble\porting\nimble\src\os_mempool.c.o: in function `vPortEnterCritical':
C:\Users\ME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:578: undefined reference to `xPortEnterCriticalTimeout'
c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\ME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:578: undefined reference to `xPortEnterCriticalTimeout'
c:/users/ME/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: libraries\NimBLE-Arduino\nimble\porting\npl\freertos\src\npl_os_freertos.c.o:C:\Users\ME\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.3/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h:578: more undefined references to `xPortEnterCriticalTimeout' follow

What do I need to do to get xPortEnterCriticalTimeout included?

h2zero commented 2 years ago

Interesting, I have not seen this before. Can you share the build environment and settings used?

AndrewMagpie commented 2 years ago

Windows 10 environment Arduino 1.8.19 ESP32 - Espressif v2.0.3 (v2.0.4 doesnt seem to work for me) Using these libraries: https://github.com/lbernstone/arduino-esp32-solo https://github.com/Bodmer/TFT_eSPI) https://github.com/lucadentella/TOTP-Arduino) https://github.com/arduino-libraries/NTPClient)

h2zero commented 4 months ago

Closing this as an environment error, not an issue with this library.