Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BME680 on LPC845 using Bosch's BSEC library

    BME680 on LPC845 using Bosch's BSEC library

    Carlos_Rafael
    Established Member

    Dear Bosch community,

    I’m using a Bosch BME680 sensor with LPC845M301JBD64E. With Bosch’s BME680 driver I can read fine the values of temperature, humidity and pressure.
    Now I need to read the output values of IAQ, CO2 Equivalent and VOC equivalent. 

    Since the only way to get these values is by using the BSEC precompiled library, I’m trying to use it but without success.
    I’m working with MCUXpresso IDE and I already linked the library on my projet, but when I compile it, i’m getting these errors:

    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(bsec_codegen_update_subscription.o): in function `bsec_codegen_update_subscription':
    bsec_codegen_update_subscription.c:(.text+0x338): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(Bsec.o): in function `bsec_Bsec_getModHeatingDuration':

    Bsec.c:(.text+0x5f8): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(ChannelHub.o): in function `bsec_ChannelHub_do':
    ChannelHub.c:(.text+0x3a6): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ChannelHub.c:(.text+0x3ee): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ChannelHub.c:(.text+0x434): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(ChannelHub.o):ChannelHub.c:(.text+0x47a): more undefined references to `roundf' follow
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(GasHumidityBaselineTracker.o): in function `bsec_GasHumidityBaselineTracker_doStep':
    GasHumidityBaselineTracker.c:(.text+0x498): undefined reference to `fminf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: GasHumidityBaselineTracker.c:(.text+0x602): undefined reference to `fmaxf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: GasHumidityBaselineTracker.c:(.text+0x6e0): undefined reference to `roundf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(HumidityTemperatureCorrector.o): in function `bsec_HumidityTemperatureCorrector_updateInterfaceDependency':
    HumidityTemperatureCorrector.c:(.text+0x22c): undefined reference to `fminf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\bme680_Project\bsec\lib\libalgobsec.a(IaqEstimator.o): in function `bsec_IaqEstimator_doStep':
    IaqEstimator.c:(.text+0xe2): undefined reference to `fmaxf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../arm-none-eabi/bin/ld.exe: IaqEstimator.c:(.text+0xea): undefined reference to `fminf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../arm-none-eabi/bin/ld.exe: IaqEstimator.c:(.text+0x112): undefined reference to `fmaxf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../arm-none-eabi/bin/ld.exe: IaqEstimator.c:(.text+0x160): undefined reference to `fmaxf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../arm-none-eabi/bin/ld.exe: IaqEstimator.c:(.text+0x18e): undefined reference to `fmaxf'
    c:/nxp/mcuxpressoide_11.0.1_2563/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.1.201907311258/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../arm-none-eabi/bin/ld.exe: IaqEstimator.c:(.text+0x196): undefined reference to `fminf'

     

     

    It seems like those undefined references have to do with the library linking.

    What may I do to solve this problem?

     

    Best regards,

    12 REPLIES 12

    Hello Carlos, 

     

    I think that is LPC845 MCU related question, so you might get the solution from them quickly 🙂 

    Thanks, 

    Hello Carlos, 

     

    Could you try to do with below setting? 

    The compiler: arm-none-eabi-gcc

    Compile command: -c -std=c89 -mcpu=cortex-m0plus -mthumb -O2 -fdata-sections -fno-builtin -fno-common

    Thanks, 

    Hello Minhwan,

    Did you mean c99 instead of C89?
    If I use C89 in the compile command that you wrote, I get a lot of errors in comments since “//” to demark a comment isn't part of C89.
    If I use C99 my code is only increasing the used flash size but the problem I mentioned before persists.

    I still couldn't figure out what is happening but for a while I just used the functions roundf ,fminf, fmaxf in my main.c and the code compiles fine.
    As mcuxpresso compiles a library only if it is being used, perhaps the bsec precompiled library is not enough to point to the compiler to do that. It's just a hypothesis.

    My major problem now is getting the values of bVOC and CO2e. But I think it is not related to this issue, so I opened this other topic .

    Thanks

    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