Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: Using the BME680 with IAQ with the Teensy 3.1/3.2

  1. #1
    Senior Member
    Join Date
    Apr 2013
    Posts
    154

    Using the BME680 with IAQ with the Teensy 3.1/3.2

    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.to olchain}{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.to olchain}{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.to olchain}{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
    Attached Files Attached Files
    Last edited by Markus_L811; 06-15-2020 at 01:30 PM. Reason: precompiled

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •