Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Support for Multiple BME688 in BSEC2 on ESP32 - link error

    Support for Multiple BME688 in BSEC2 on ESP32 - link error


    Is there no multi device support for ESP32?  I am linking to the right blob, this is all Bosch code from the BSEC distribution, it should link.


    Using Arduino,the example, bme68x_demo_sample.ino, using board Adafruit ESP32 Feather, fails to link with the following display:

    Library Bosch-BSEC2-Library has been declared precompiled:
    Using precompiled library in D:\Data\PROJECTS\Sketchbook\libraries\Bosch-BSEC2-Library\src\esp32
    libraries\Bosch-BSEC2-Library\bsec2.cpp.o:(.literal._ZN5Bsec218updateSubscriptionEP21bsec_virtual_sensor_thf+0x0): undefined
               reference to `bsec_update_subscription_m'
    ...etc for additional multi calls.

    I have reloaded from GIT using a zip file for V1.5.0 and the library.json file shows:
    "version": "1.5.2400",

    In my application, I need to instantiate for multiple BME688 devices (up to 4) at two separate I2S addresses on each of two I2S hardware connections.  I know HOW to do this but the required calls are not in the pre-compiled library.  Anybody got a clue?

    3 REPLIES 3

    Community Moderator
    Community Moderator

    Hi evansf,

    Example bme68x_demo_sample.ino only run with BME688 dev kit, if you would like to other hardware, you need to modify the code based on you own hardware.

    I did exactly that to start with and I got the link error.  Debugging to find the problem revealed that the BSEC.cpp code uses the multi calls (e.g.  bsec_update_subscription_m() instead of the earlier bsec_update_subscription()  )  functions.  To make my problem clearer for this post,  I attempted to compile the example code supplied in the dev-kit, using the board from the dev-kit without any changes.  That is to say, I am trying to get the dev kit example to compile and link and run on the dev-kit hardware.  This attempt fails with the same link error.

    The dev-kit example code does not compile and run on the dev-kit because the ESP32 library blob does not contain the _m() multiple versions of the interface functions which are required in the BSEC2.cpp class methods.  The bsec code used in association with the AI-Studio does not use the BSEC2 class interface and it links with the older library interface (i.e. not the  xxxxxxx_m() functions).

    With this understanding,  can you help me get a succesful compile of bsec2 which will link with the ESP32 board that is used in the dev-kit?  I believe that it will require a new library blob from the BSEC team at Bosch. 


    I moved this code over to a carefully provisioned PlatforIO project.  under that system,  the example code compiles and links correctly.  Why the Arduino environment does not work remains a mystery.