Markus_L811
Well-known member
If you want to use the IAQ function, you need to add an precompiled file and change some of the file locations.
1. Download the lib from github: Link
2. Create an Folder basic_BME680 in your Sketchfolder "C:\-your path-\Documents\Arduino\"
3. Copy some files to it.
BSEC_BME680\examples\basic\basic.ino
BSEC_BME680\src\*
BSEC_BME680\src\bme680\bme*
BSEC_BME680\src\inc\*
BSEC_BME680\src\bsec.*
BSEC_BME680\keywords.txt
BSEC_BME680\src\cortex-m4 (the cortex-m4 folder with file, the Teensy 3.1/3.2 is an m4)
4. Modify the bcec.h
Change:
#include "inc/bsec_datatypes.h"
#include "inc/bsec_interface.h"
#include "bme680/bme680.h"
to:
#include "bsec_datatypes.h"
#include "bsec_interface.h"
#include "bme680.h"
5. Now the tricky part change the platform.txt from teensyduino (1.8.12 for example)
Open arduino-1.8.12\hardware\teensy\avr\platform.txt
Search for: ## Link
Change:
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
to:
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "C:\-your path-\Documents\Arduino\basic_BME680\cortex-m4\libalgobsec.a" "-L{build.path}" {build.flags.libs}
So after this you should run the BME680 with all features.
Downside the precompiled is now part as long as it stayes inside the platform.txt and it needs to be done with every new Teensyduino version.
Atm. I don't know an better way to get this done:
When you add this to the platform.txt
compiler.libraries.ldflags=
And change the ## Link to this
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "{compiler.libraries.ldflags}" "-L{build.path}" {build.flags.libs}
the compiler ask for the libalgobsec.a in the folder BSEC_BME680\src\mk20dx256 but even if I do him the favor it won't compile sucessfully. If someone has some hints to do that would be nice.
Paul does not support to include precompiled from the lib itself at this point so far.
File with the complete folder added with this version "Bosch Sensortec Environmental Cluster (BSEC) Software v1.4.7.4 released on July 3rd, 2019" and changed bcec.h
1. Download the lib from github: Link
2. Create an Folder basic_BME680 in your Sketchfolder "C:\-your path-\Documents\Arduino\"
3. Copy some files to it.
BSEC_BME680\examples\basic\basic.ino
BSEC_BME680\src\*
BSEC_BME680\src\bme680\bme*
BSEC_BME680\src\inc\*
BSEC_BME680\src\bsec.*
BSEC_BME680\keywords.txt
BSEC_BME680\src\cortex-m4 (the cortex-m4 folder with file, the Teensy 3.1/3.2 is an m4)
4. Modify the bcec.h
Change:
#include "inc/bsec_datatypes.h"
#include "inc/bsec_interface.h"
#include "bme680/bme680.h"
to:
#include "bsec_datatypes.h"
#include "bsec_interface.h"
#include "bme680.h"
5. Now the tricky part change the platform.txt from teensyduino (1.8.12 for example)
Open arduino-1.8.12\hardware\teensy\avr\platform.txt
Search for: ## Link
Change:
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" {build.flags.libs}
to:
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "C:\-your path-\Documents\Arduino\basic_BME680\cortex-m4\libalgobsec.a" "-L{build.path}" {build.flags.libs}
So after this you should run the BME680 with all features.
Downside the precompiled is now part as long as it stayes inside the platform.txt and it needs to be done with every new Teensyduino version.
Atm. I don't know an better way to get this done:
When you add this to the platform.txt
compiler.libraries.ldflags=
And change the ## Link to this
recipe.c.combine.pattern="{compiler.path}{build.toolchain}{build.command.linker}" {build.flags.optimize} {build.flags.ld} {build.flags.ldspecs} {build.flags.cpu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "{compiler.libraries.ldflags}" "-L{build.path}" {build.flags.libs}
the compiler ask for the libalgobsec.a in the folder BSEC_BME680\src\mk20dx256 but even if I do him the favor it won't compile sucessfully. If someone has some hints to do that would be nice.
Paul does not support to include precompiled from the lib itself at this point so far.
File with the complete folder added with this version "Bosch Sensortec Environmental Cluster (BSEC) Software v1.4.7.4 released on July 3rd, 2019" and changed bcec.h
Attachments
Last edited: