Hey there,
since Arduino 1.8.9 and BSEC 1.4.7.3 is out for a month i thought i give it a shoot to see what improvements being made.
Downloaded the BSEC from the mainpage and followed the workaround procedures listed on github, everything worked well for the very basic (library)examples. But the bsec_iot_example (and ultimately my custom made sketch, which is in production mode on a lower BSEC version) throws an error during linking.
After a deeper look at compiler.c.elf.extra_flags and compiler.libraries.ldflags i realized that no linker argument for libalgobsec is passed. No wonder:
If you have already used the previous example code and hack guide, remove the linker flag -libalgobsec in the platform.txt file
So, at least with the standalone example you will need the linker flag compiler.c.elf.libs .... -lalgobsec to link the parts without exiting.
What is the reason? The structure?
Solved! Go to Solution.
The Linker problem now "solved", another problem occured.
I ran into a "Error while initializing BME680"
Error while initializing BME680 -2 (ret.bme680_status) Exception (0): epc1=0x4000e296 epc2=0x00000000 epc3=0x402026f5 excvaddr=0x00000000 depc=0x00000000 >>>stack>>> ctx: cont sp: 3ffffa20 end: 3fffffc0 offset: 01a0 3ffffbc0: 00000000 00000000 00000000 3ffffc40 3ffffbd0: 3ffffef8 3fff0938 3fff0d38 40254d74 3ffffbe0: 00000000 4bc6a7f0 fa1cac08 00000000 3ffffbf0: 89bf0fc0 00000000 00000000 40240000 3ffffc00: 00000000 401c0000 00000000 00000000 3ffffc10: 00000907 000003e8 00000000 3fff0270 3ffffc20: 00234358 000003e8 00000000 3fff0270 3ffffc30: 00000000 00000000 89bf0fc0 40254574 3ffffc40: 00000000 3fff0130 40202377 402026e8 3ffffc50: 3fff0130 00000000 00000000 40202383 3ffffc60: 00000000 00000000 00000000 00000000 3ffffc70: 00000000 00000000 00000000 00000000 3ffffc80: 00000000 00000000 00000000 00000000 3ffffc90: 00000000 00000000 00000000 00000000 3ffffca0: 00000000 00000000 00000000 00000000 3ffffcb0: 00000000 00000000 00000000 00000000 3ffffcc0: 00000000 00000000 00000000 00000000 3ffffcd0: 00000000 00000000 00000000 00000000 3ffffce0: 00000000 00000000 00000000 00000000 3ffffcf0: 00000000 00000000 00000000 00000000 3ffffd00: 00000000 00000000 00000000 00000000 3ffffd10: 00000000 00000000 00000000 00000000 3ffffd20: 00000000 00000000 00000000 00000000 3ffffd30: 00000000 00000000 00000000 00000000 3ffffd40: 00000000 00000000 00000000 00000000 3ffffd50: 00000000 00000000 00000000 00000000 3ffffd60: 00000000 00000000 00000000 00000000 3ffffd70: 00000000 00000000 00000000 00000000 3ffffd80: 00000000 00000000 00000000 00000000 3ffffd90: 00000000 00000000 00000000 00000000 3ffffda0: 00000000 00000000 00000000 00000000 3ffffdb0: 00000000 00000000 00000000 00000000 3ffffdc0: 00000000 00000000 00000000 00000000 3ffffdd0: 00000000 00000000 00000000 00000000 3ffffde0: 00000000 00000000 00000000 00000000 3ffffdf0: 00000000 00000000 00000000 00000000 3ffffe00: 00000000 00000000 00000000 00000000 3ffffe10: 00000000 00000000 00000000 00000000 3ffffe20: 00000000 00000000 00000000 00000000 3ffffe30: 00000000 00000000 00000000 00000000 3ffffe40: 00000000 00000000 00000000 00000000 3ffffe50: 00000000 00000000 00000000 00000000 3ffffe60: 00000000 00000000 00000000 00000000 3ffffe70: 00000000 00000000 00000000 00000000 3ffffe80: 00000000 00000000 00000000 00000000 3ffffe90: 3fffff10 00000000 3fffff0f 402128b2 3ffffea0: 00000000 00000000 00000000 3fff0130 3ffffeb0: 00000032 0000000a 3fff0130 4020e3f4 3ffffec0: 3ffefe34 00000020 3fff0088 4020e765 3ffffed0: 3fffff0f feefeffe 3fff007c 4020ce0d 3ffffee0: 0000000c 842b2cf4 3fffff0e 4020e9a3 3ffffef0: 00000050 00000000 00000000 00000000 3fffff00: 00000000 00000000 00000000 40212800 3fffff10: 00000000 0000002d 3fff2b2c 3fff0270 3fffff20: 000000fe 00000002 402026e8 4020e3f4 3fffff30: 402026fc 3fff0130 3fff0130 40202a70 3fffff40: 40217f60 00002710 3fff0130 4020e9f4 3fffff50: 0000000a 40217f5c 3fff0130 4020e8b8 3fffff60: 000000fe 3fff0130 3fff0130 3fff0270 3fffff70: 000000fe 3fff0130 402026e8 402035ee 3fffff80: 40217f64 feefeffe feefeffe feefeffe 3fffff90: 326461fe 00000000 40217f80 40217f68 3fffffa0: 3fffdad0 00000000 3fff0240 402102bc 3fffffb0: feefeffe feefeffe 3ffe8548 401017ad <<<stack<<<
Reverting to my old sketch from the last BSEC revision works fine, yet throws a library error which i basically can ignore. (libalgobsec.a i think)
(BTW: The same error occurs if I run the basic library example)
Microcontroller: AIThinker NodeMCU ESP-12
Arduino: 1.8.9 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module),..."
Another trace of the functions called up until the error occured (BME680_E_COM_FAIL / -2)
->bme680_init Null pointer check / Result: 0 (Device structure is fine) ->soft reset Null pointer check / Result: 0 (Device structure is fine) (Softreset) -> set_regs Null pointer check / Result: 0 (Device structure is fine) (set_regs) Index 0 (set_regs) BME680_E_COM_FAIL / -2 Result set_regs: -2 Result (soft reset):-2 API init failed Error while initializing BME680 -2
Not that it helps you but I was able to get the standalone example running on an STM32F processor. I tried to compile it for the NodeMCU V1 but I had'nt modified the ESP file as described in the read me so I did not persue it. One of the issues for me was I have files in bad places from previous frustration with the previoud BSEC release.
I found deleting everything Bosch from the library , hardware and Arduino15 directorys helped me get going.
Got it.
In the 1.4.7.3 release the I2C connections are reversed (or were in 1.4.7.x)
You have to change
/** BME680 I2C addresses */ #define BME680_I2C_ADDR_PRIMARY UINT8_C(0x76) #define BME680_I2C_ADDR_SECONDARY UINT8_C(0x77)
into
/** BME680 I2C addresses */ #define BME680_I2C_ADDR_PRIMARY UINT8_C(0x77) #define BME680_I2C_ADDR_SECONDARY UINT8_C(0x76)
in the bme680_defs.h
or simply switch wires 😜