BSEC Sensor Library

@warriorofwire I finally got it working.

  1. Regarding your local build issue. Particle has a much better tutorial here on how to set it up tool now.
  2. BSEC provides a static library that needs to be linked for the compiler to be able to use it. @tlangmo has provided step by step instruction on how to get it done.

Here is how I got it working.

  1. Get your local build up and running using Particle Workbench
  2. Clone the BME680 with IAQ output - Particle repo
  3. Add the libalgobsec.a to the the build directory /user/applications/photon-BME680/
  4. Modify makefile located in /modules/photon/user-part to add:
  • Add export MODULAR=y
export COMPILE_LTO=n
export MODULAR=y
  • Update LIB_DEPS & LDFLAGS variable to include the static library
LIB_DIRS += $(dir $(LIB_DEPS))
LIB_DEPS += $(PROJECT_ROOT)/user/applications/photon-BME680/libalgobsec.a
LDFLAGS += -Wl,--whole-archive $(PROJECT_ROOT)/hal/src/photon/lib/STM32F2xx_Peripheral_Libraries.a $(PROJECT_ROOT)/user/applications/photon-BME680/libalgobsec.a -Wl,--no-whole-archive

Compile and flash from the /modules using

  • make all PLATFORM=photon APPDIR=
  • particle flash --usb /target/.bin

(ScruffR: updated broken “local build” links to redirect to Particle Workbench)

2 Likes