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,

    13 REPLIES 13

    Hello Carlos, 

     

    I reported your request to our application team, the I will back to you when they give me some solution. 

    Thanks, 

     

    Hello Carlos, 

     

    Our application team checked your error log that it looks like your current setting doesn't support C99 library. 

    If yes, could you add C99 library in your project because our library is required C99 library. 

    Please let me know after that. 

    Thanks, 

    Hello Minhwan, thanks for your answer.

    I have set MCUXpresso to use the C99 library, but the problem persists, I’m getting the same error log.

    I have created a repository with a simple version of my project in case you want to check.

    https://github.com/rafaelcrevelari/bme680_lpc845 

    Thanks

    Hello Carlos, 

     

    Could you test C99 library is really included in your code? 

    You can simply include <stdbool.h> and use it in your code, then I report it to my team again.

    Thanks,

    Hi Minhwan,

    I tried to use the functions roundf ,fminf, fmaxf in my main.c and I got undefined references for them. So I realized that I haven't linked the math lib with -lm.

    After linking with -lm, the functions in my main.c compiled but with the warning of “implicit declaration”. All the errors related to `roundf' ,`fminf', `fmaxf' from bsec lib have gone.

    So after that, I started to get the error “undefined reference to __errno ” in the bsec library, witch was solved by changing the managed linker script to Redlib(none) and removing the option “No startup or default libs (-nostdlib)” from MCU Linker->General.

    The code is compiling without errors, but there is still a curious problem.

    If I remove roundf ,fminf, fmaxf from my main.c, which was used only to test the C99 library, I get all the errors back, the same error log that I posted in the beginning of this topic.

    Do you have any idea why it is happening?

     

    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