BME680 on a Pico W - linking problem

Hi All,

I have a BME680 sensor configured on a Pi Pico W. The original BME680 config works fine but I want to use the version with the Bosch library to get more info out of the device. When I compile the firmware, I get:

Linking /data/bboard/.pioenvs/bboard/firmware.elf
/data/cache/platformio/packages/toolchain-rp2040-earlephilhower/bin/…/lib/gcc/arm-none-eabi/10.3.0/…/…/…/…/arm-none-eabi/bin/ld: cannot find -lalgobsec
collect2: error: ld returned 1 exit status
*** [/data/bboard/.pioenvs/bboard/firmware.elf] Error 1

I’m newish to ESPHome, not to Linux and compilation but it’s not clear to me where I change any settings to address this. Any hints?


I got it working by downloading the library for the Cortex M0+ directly off the Bosch Sensortec site ( Bosch-BSEC2-Library/src/cortex-m0plus at master · boschsensortec/Bosch-BSEC2-Library · GitHub ) but couldn’t get the linker to find it unless I dropped it directly into the toolchain lib directory of the addons file system. I tried adding it as a library in the YAML file for the Pico and while the debug said the directory had been processed, the linker still failed. There must be an easier way and I’m sure I’m missing a simple directive.

Placing the file in a known location and referencing it in lib_extra_dirs in platformio.ini copies the file into ./piolibdeps but the linker doesn’t find it.

The build process does pull down the library ( in fact, libraries - multiple cpu types come down ) from the Bosch sensortec location, placing them in the .piolibdeps tree though the linker still doesn’t find them.