Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    MPE680 BSEC doesn't compile/link on ESP32 (1.0.4) Arduino IDE (1.8.12)

    MPE680 BSEC doesn't compile/link on ESP32 (1.0.4) Arduino IDE (1.8.12)

    dannyyy
    New Poster

    Hi,

    I have installed the BSEC library according to the documentation on GitHub.
    I'm using the following components in its version:
    - MAC OSX 10.15.3 (latest)
    - WEMOS LoLin 32
    - BSEC Library: Latest Master on Gihub
    - Arduino IDE: 1.8.12
    - ESP32 Core: 1.0.4

    What I did was extending the `platform.txt` with the variable `compiler.libraries.ldflags=` and added just this variable to the receipe so it loooks like:

    ## Combine gc-sections, archives, and objects
    recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf"

     

    I tried to run the 'basic' example. But while compiling/linking I get the following errors:

    Using built-in specs.
    COLLECT_GCC=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-gcc
    COLLECT_LTO_WRAPPER=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/lto-wrapper
    Target: xtensa-esp32-elf
    Configured with: /Volumes/build/idf/crosstool-NG/.build/src/gcc-5.2.0/configure --build=x86_64-build_apple-darwin16.3.0 --host=x86_64-build_apple-darwin16.3.0 --target=xtensa-esp32-elf --prefix=/Volumes/build/idf/crosstool-NG/builds/xtensa-esp32-elf --with-local-prefix=/Volumes/build/idf/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/sysroot --with-sysroot=/Volumes/build/idf/crosstool-NG/builds/xtensa-esp32-elf/xtensa-esp32-elf/sysroot --with-newlib --enable-threads=no --disable-shared --with-pkgversion='crosstool-NG crosstool-ng-1.22.0-80-g6c4433a' --disable-__cxa_atexit --enable-cxx-flags='-fno-rtti -ffunction-sections' --with-gmp=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --with-mpfr=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --with-mpc=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --with-isl=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --with-cloog=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --with-libelf=/Volumes/build/idf/crosstool-NG/.build/xtensa-esp32-elf/buildtools --enable-lto --enable-target-optspace --without-long-double-128 --disable-libgomp --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-nls --enable-languages=c,c++ --disable-libstdcxx-verbose --enable-threads=posix --enable-gcov-custom-rtio
    Thread model: posix
    gcc version 5.2.0 (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 
    COMPILER_PATH=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/
    LIBRARY_PATH=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/lib/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../xtensa-esp32-elf/sysroot/lib/:/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../xtensa-esp32-elf/sysroot/usr/lib/
    COLLECT_GCC_OPTIONS='-nostdlib' '-L/Users/dannyyy/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/lib' '-L/Users/dannyyy/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/ld' '-T' 'esp32_out.ld' '-T' 'esp32.common.ld' '-T' 'esp32.rom.ld' '-T' 'esp32.peripherals.ld' '-T' 'esp32.rom.libgcc.ld' '-T' 'esp32.rom.spiram_incompatible_fns.ld' '-u' 'ld_include_panic_highint_hdl' '-u' 'call_user_start_cpu0' '-u' '__cxa_guard_dummy' '-u' '__cxx_fatal_exception' '-v' '-L/Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/src/esp32' '-o' 'basic.ino.elf'
    /Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/collect2 -plugin /Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/liblto_plugin.so -plugin-opt=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/lto-wrapper -plugin-opt=-fresolution=/var/folders/pr/57h8bwx95y99np2_1q2jl5j00000gn/T//ccV9B9rK.res --sysroot=/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../xtensa-esp32-elf/sysroot -o basic.ino.elf -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -u __cxa_guard_dummy -u __cxx_fatal_exception -L/Users/dannyyy/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/lib -L/Users/dannyyy/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/ld -L/Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/src/esp32 -L/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0 -L/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc -L/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/lib -L/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../xtensa-esp32-elf/sysroot/lib -L/Users/dannyyy/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../xtensa-esp32-elf/sysroot/usr/lib --gc-sections -static --undefined=uxTopUsedPriority --start-group sketch/basic.ino.cpp.o libraries/Wire/Wire.cpp.o libraries/SPI/SPI.cpp.o core/core.a -lgcc -lesp32 -lphy -lesp_http_client -lmbedtls -lrtc -lesp_http_server -lbtdm_app -lspiffs -lbootloader_support -lmdns -lnvs_flash -lfatfs -lpp -lnet80211 -ljsmn -lface_detection -llibsodium -lvfs -ldl_lib -llog -lfreertos -lcxx -lsmartconfig_ack -lxtensa-debug-module -lheap -ltcpip_adapter -lmqtt -lulp -lfd -lfb_gfx -lnghttp -lprotocomm -lsmartconfig -lm -lethernet -limage_util -lc_nano -lsoc -ltcp_transport -lc -lmicro-ecc -lface_recognition -ljson -lwpa_supplicant -lmesh -lesp_https_ota -lwpa2 -lexpat -llwip -lwear_levelling -lapp_update -ldriver -lbt -lespnow -lcoap -lasio -lnewlib -lconsole -lapp_trace -lesp32-camera -lhal -lprotobuf-c -lsdmmc -lcore -lpthread -lcoexist -lfreemodbus -lspi_flash -lesp-tls -lwpa -lwifi_provisioning -lwps -lesp_adc_cal -lesp_event -lopenssl -lesp_ringbuf -lfr -lstdc++ -lalgobsec -lalgobsec --end-group -EL -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld
    sketch/basic.ino.cpp.o:(.literal._Z5setupv+0x10): undefined reference to `Bsec::delay_ms(unsigned int)'
    sketch/basic.ino.cpp.o:(.literal._Z5setupv+0x28): undefined reference to `Bsec::begin(unsigned char, TwoWire&, void (*)(unsigned int))'
    sketch/basic.ino.cpp.o:(.literal._Z5setupv+0x30): undefined reference to `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)'
    sketch/basic.ino.cpp.o:(.literal._Z4loopv+0x8): undefined reference to `Bsec::run(long long)'
    sketch/basic.ino.cpp.o:(.literal.startup._GLOBAL__sub_I_iaqSensor+0x8): undefined reference to `Bsec::Bsec()'
    sketch/basic.ino.cpp.o: In function `setup()':
    /Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/examples/basic/basic.ino:18: undefined reference to `Bsec::begin(unsigned char, TwoWire&, void (*)(unsigned int))'
    /Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/examples/basic/basic.ino:36: undefined reference to `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)'
    sketch/basic.ino.cpp.o: In function `loop()':
    /Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/examples/basic/basic.ino:48: undefined reference to `Bsec::run(long long)'
    sketch/basic.ino.cpp.o: In function `_GLOBAL__sub_I_iaqSensor':
    /Users/dannyyy/Documents/Arduino/libraries/BSEC-Arduino-library-master/examples/basic/basic.ino:8: undefined reference to `Bsec::Bsec()'
    collect2: error: ld returned 1 exit status
    exit status 1
    Error compiling for board WEMOS LOLIN32.

    Any idea what the issue could be?

    Kind regards,
    Danny

    5 REPLIES 5

    handytech
    Community Moderator
    Community Moderator

    I just found that a new Arduino IDE release was rolled out last week with the Release Notes below:

    ARDUINO 1.8.13 2020.06.16
    
    ...
    
    [arduino-builder]
    * FIX REGRESSION: Fixed precompiled libraries containing "wrapper" code that has to be compiled together
                      with the precompiled part.
    
    ...

    After upgrading my Arduino IDE to v1.8.13, the BSEC Arduino library seems to be working as expected again!

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist