Rebuilding arduino's libraries based on IDF v4 (arduino as a component) for BLE low power

bobo1974
Posts: 17
Joined: Fri Feb 08, 2019 2:14 pm

Rebuilding arduino's libraries based on IDF v4 (arduino as a component) for BLE low power

Postby bobo1974 » Mon May 11, 2020 1:46 pm

I want to rebuild arduino's libraries based on IDF v4 to benefit from recent idf improvment on BLE power consumption (https://github.com/espressif/esp-idf/issues/947)

I had previously successfully rebuild arduino's libraries based on IDF 3.2. That worked following the instructions:
https://github.com/espressif/arduino-esp32/issues/1142
https://github.com/espressif/arduino-esp32/issues/1531

But as I did not get the benefits I expected on BLE consumption, I thought the improvement were after 3.2 so I am now trying to rebuild the libraries based on esp-idf v4.

So I followed again the standard process:
- Installed arduino IDE + and install arduino-esp32 git repo forcing idf-release/v4.0
- Then install esp-idf v4.0, install arduino idf-release/v4.0 in the component folder, and creating a "blink" project).
- I did a checkout to b0f053d82 (arduino's last entry)

Everything compiles fine with idf.y build!

**And my question is now: what should I copy back to arduino.**

In the 3.2 test, I copied the *.a librairies, except the bootloader ones, to the sdk/lib directory of arduino. (Now that I installed via git, the sdk directory is in <Skectch directory>\hardware\espressif\esp32\tools\sdk\lib)

Now based on idf 4.0, copying the .a files works fine if I compile a basic blink project.

But my BLE power test program generate errors in arduino compilation. Note: it compiles and works fine before I change the libraries!

This is the begining of the many errors I got when compiling my program (le code is after the errors.)

Anyone could help me there?

EDIT: I added more logs. Looks like It has to do with encryption. During the idf.py build, I was initially requested to add mbedTLS PSK and some encryption, which I did.

Code: Select all

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-unwrap.c.obj):(.literal.aes_unwrap+0x0): undefined reference to `esp_aes_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-unwrap.c.obj):(.literal.aes_unwrap+0x4): undefined reference to `esp_aes_setkey'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-unwrap.c.obj):(.literal.aes_unwrap+0x8): undefined reference to `esp_aes_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-unwrap.c.obj):(.literal.aes_unwrap+0xc): undefined reference to `esp_internal_aes_decrypt'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-unwrap.c.obj): in function `aes_unwrap':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-unwrap.c:68: undefined reference to `esp_aes_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-unwrap.c:69: undefined reference to `esp_aes_setkey'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-unwrap.c:71: undefined reference to `esp_aes_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-unwrap.c:95: undefined reference to `esp_internal_aes_decrypt'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-unwrap.c:105: undefined reference to `esp_aes_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-wrap.c.obj):(.literal.aes_wrap+0x0): undefined reference to `esp_internal_aes_encrypt'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(aes-wrap.c.obj): in function `aes_wrap':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-wrap.c:62: undefined reference to `esp_aes_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-wrap.c:63: undefined reference to `esp_aes_setkey'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-wrap.c:65: undefined reference to `esp_aes_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-wrap.c:87: undefined reference to `esp_internal_aes_encrypt'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/aes-wrap.c:100: undefined reference to `esp_aes_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.ecp_opp+0x0): undefined reference to `mbedtls_ecp_copy'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.ecp_opp+0x4): undefined reference to `mbedtls_mpi_cmp_int'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.ecp_opp+0x8): undefined reference to `mbedtls_mpi_sub_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_init+0x0): undefined reference to `mbedtls_mpi_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_init_set+0x0): undefined reference to `mbedtls_mpi_read_binary'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_deinit+0x0): undefined reference to `mbedtls_mpi_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_to_bin+0x0): undefined reference to `mbedtls_mpi_size'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_to_bin+0x4): undefined reference to `mbedtls_mpi_write_binary'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_add+0x0): undefined reference to `mbedtls_mpi_add_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_mod+0x0): undefined reference to `mbedtls_mpi_mod_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_exptmod+0x0): undefined reference to `mbedtls_mpi_exp_mod'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_inverse+0x0): undefined reference to `mbedtls_mpi_inv_mod'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_div+0x0): undefined reference to `mbedtls_mpi_div_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_mulmod+0x0): undefined reference to `esp_mpi_mul_mpi_mod'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_cmp+0x0): undefined reference to `mbedtls_mpi_cmp_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_bits+0x0): undefined reference to `mbedtls_mpi_bitlen'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_legendre+0x0): undefined reference to `mbedtls_mpi_sub_int'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_bignum_legendre+0x4): undefined reference to `mbedtls_mpi_shift_r'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_deinit+0x0): undefined reference to `mbedtls_ecp_group_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_init+0x0): undefined reference to `mbedtls_ecp_group_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_init+0x4): undefined reference to `mbedtls_ecp_group_load'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_init+0x0): undefined reference to `mbedtls_ecp_point_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_deinit+0x0): undefined reference to `mbedtls_ecp_point_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_from_bin+0x0): undefined reference to `mbedtls_mpi_lset'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_add+0x0): undefined reference to `mbedtls_ecp_muladd'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x0): undefined reference to `mbedtls_entropy_func'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x4): undefined reference to `mbedtls_ctr_drbg_random'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x8): undefined reference to `mbedtls_entropy_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0xc): undefined reference to `mbedtls_ctr_drbg_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x10): undefined reference to `mbedtls_ctr_drbg_seed'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x14): undefined reference to `mbedtls_ecp_mul'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x18): undefined reference to `mbedtls_ctr_drbg_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_mul+0x1c): undefined reference to `mbedtls_entropy_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_compute_y_sqr+0x0): undefined reference to `mbedtls_mpi_mul_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_solve_y_coord+0x0): undefined reference to `mbedtls_mpi_add_int'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_solve_y_coord+0x4): undefined reference to `mbedtls_mpi_div_int'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_solve_y_coord+0x8): undefined reference to `mbedtls_mpi_get_bit'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_solve_y_coord+0xc): undefined reference to `mbedtls_mpi_copy'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_is_at_infinity+0x0): undefined reference to `mbedtls_ecp_is_zero'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj):(.literal.crypto_ec_point_cmp+0x0): undefined reference to `mbedtls_ecp_point_cmp'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `ecp_opp':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:448: undefined reference to `mbedtls_ecp_copy'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:452: undefined reference to `mbedtls_mpi_cmp_int'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:453: undefined reference to `mbedtls_mpi_sub_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_init':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:46: undefined reference to `mbedtls_mpi_init'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_init_set':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:60: undefined reference to `mbedtls_mpi_read_binary'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_deinit':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:71: undefined reference to `mbedtls_mpi_free'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_to_bin':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:85: undefined reference to `mbedtls_mpi_size'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:97: undefined reference to `mbedtls_mpi_size'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:97: undefined reference to `mbedtls_mpi_write_binary'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_add':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:107: undefined reference to `mbedtls_mpi_add_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_mod':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:116: undefined reference to `mbedtls_mpi_mod_mpi'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_exptmod':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:125: undefined reference to `mbedtls_mpi_exp_mod'

c:/users/etawy/onedrive/development/arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\etawy\OneDrive\Development\Arduino\hardware\espressif\esp32/tools/sdk/lib\libwpa_supplicant.a(crypto_mbedtls.c.obj): in function `crypto_bignum_inverse':

C:/esp/esp-idf/components/wpa_supplicant/src/crypto/crypto_mbedtls.c:134: undefined reference to `mbedtls_mpi_inv_mod'

Code: Select all

#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include <driver/rtc_io.h>
#include "esp_bt.h"
#include <WiFi.h>
#include "esp_err.h"
#include "esp_pm.h"

const int scanTime =5;
BLEScan* pBLEScan;
BLEAdvertising *pAdvertising;
esp_err_t ret;

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Start");
  pinMode(12, OUTPUT);//LED
  pinMode(13, OUTPUT);//LED
  pinMode(14, OUTPUT);//LED
  pinMode(36, INPUT); //VUSB
  pinMode(35, INPUT); //VBAT
  WiFi.mode(WIFI_OFF);
  Serial.println("All off");
  delay(5000);
}

void loop() {
  if(!BLEDevice::getInitialized()) {BLEDevice::init("beacon");}
  esp_bt_sleep_enable();
  ret = esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_N12);
  ret = esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN, ESP_PWR_LVL_N12);
  ret = esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_N12);
  BLEDevice::setPower(ESP_PWR_LVL_N12);
  pAdvertising = BLEDevice::getAdvertising();
  pAdvertising->setMinInterval(800);
  pAdvertising->setMaxInterval(800);
  pAdvertising->start();
  Serial.println("Advertising");
    
  Serial.println("Scanning");
  pBLEScan = BLEDevice::getScan(); //create new scan
  pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
  pBLEScan->setInterval(150);
  pBLEScan->setWindow(100);  // less or equal setInterval value
  BLEScanResults results = pBLEScan->start(scanTime, false);

  Serial.println("End");
  pBLEScan->clearResults();
  pAdvertising->stop();
 
}

Who is online

Users browsing this forum: No registered users and 20 guests