10-27-2020 02:14 PM - edited 10-27-2020 03:56 PM
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':
It seems like those undefined references have to do with the library linking.
What may I do to solve this problem?
Best regards,
Solved! Go to Solution.
10-28-2020 09:54 PM
Hello Carlos,
I reported your request to our application team, the I will back to you when they give me some solution.
Thanks,
11-03-2020 03:26 AM
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,
11-03-2020 05:55 PM
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
11-04-2020 12:34 AM
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,
11-04-2020 08:06 PM - edited 11-04-2020 08:07 PM
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!