Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BME680 BSEC how to connect

    BME680 BSEC how to connect

    Yuriy
    New Poster

    I connected the BME680 sensor using the BME680_driver (3.5.10 from 01/23/2020). The sensor works well.
    I need to connect the BSEC library. I found BSEC_1.4.7.4_Generic_Release, but cannot figure out how to do this correctly. I am reading BST-BME680-Integration-Guide-AN008-47.pdf, I need to connect bsec_interface.h, bsec_datatypes.h, bsec_integration.h, bsec_integration.c. But files are found many times. For example, ..... BSEC_1.4.7.4_Generic_Release \ algo \ normal_version \ bin \ IAR7 \ Cortex_M3 and ...... BSEC_1.4.7.4_Generic_Release \ algo \ normal_version \ contains files with identical names that must be on connection?
    Where to get the rest of the files?
    I managed to compile the project in IAR7, but it does not work. I need files for IAR7, using STM32f103. Where to get the files, and how to connect?

    6 REPLIES 6

    My BME680 is located on a small board, except for it there is STM32F103 or STM32L151 installed. BME680 is connected to master I2c STM32. Data is read by an external controller connected to the I2C slave STM32. Everything works well. But the STM32 heats up, it causes the BME680 to heat up. I want to put STM32 in STOP mode. In my case, BSEC performs 2 delays
    bme680_bsec_trigger_measurement (bsec_bme_settings_t * sensor_settings, sleep_fct sleep)
    / * Delay till the measurement is ready. Timestamp resolution in ms * /
            sleep ((uint32_t) meas_period);
    delay approximately 0.3 sec

    bsec_iot_loop (sleep_fct sleep, get_timestamp_us_fct get_timestamp_us, output_ready_fct output_ready, state_save_fct state_save, uint32_t save_intvl)
    if (time_stamp_interval_ms> 0)
            {
                sleep ((uint32_t) time_stamp_interval_ms);
            }
    The delay is approximately 2.7 seconds.
    I want to put the microcontroller in STOP mode for 2.7 seconds. At this time, the microcontroller generators stop. The problem is that get_timestamp_us () receives incorrect data in this case and the BME680 throws an error. This is my guess.
    How can this problem be solved?
    If you put the microcontroller in STOP mode for 3 seconds, and then do sleep (2700); then everything works, the interval between measurements increases to 6 seconds. The BME680 provides data, although it is possible that the IQA calculation is not performed correctly. But I'm not so sure.

    handytech
    Community Moderator
    Community Moderator

    It is technically possible to put your MCU in sleep/STOP mode between samples but you need to meet some BSEC requirements:

    • It is mandatory for BSEC to receive absolute timestamps. This could be achieved by different means, for example with a Real-Time Clock (RTC), by getting the absolute time externally (if your device has some connectivity features), or for prototyping/POC designs you could try to keep track of a counter in some internal memory to recover an appropriate absolute timestamp before the next sample.
    • The majority of BSEC processes and variables are running or stored in RAM. If the STOP/sleep mode your MCU looses this RAM content, then BSEC cannot operate properly. In this case, it is still possible to run BSEC, but you will need to save (respectively restore) BSEC's state after (respectively before) processing every sample. This state would therefore need to be stored in some Non-Volatile Memory.
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist