Bosch Sensortec Community

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

    BME680 with STM32L073RZ

    BME680 with STM32L073RZ

    Charlotte
    Member

    Hello,

    I'm doing a project with the BME680 with STM32L073RZ. I  have put all the .c and .h file in the project. But I can't use the function declared in bsec_interface.h, such as bsec_set_configuration and bsec_set_state, however I can use the bsec_init() without error, it's so strange.

    When I use the bsec_set_configuration :

    ret.bsec_status = bsec_set_configuration(bsec_config, bsec_config_len, work_buffer, sizeof(work_buffer));

    The error says: undefined reference to `bsec_set_configuration'

    I don't know how to make the functions and the project work. ..

    9 REPLIES 9

    Minhwan
    Community Moderator
    Community Moderator

    Hello, 

     

    I couldn't see "save_state" function, but yes all functions in bsec_interface.h are included in library. 

    Thanks, 

    Hello,

    I mean the state-save and state_load in the  bsec_iot_example.ino. And according to your answer, "all functions in bsec_interface.h are included in library", I think the state-save and state_load should be writen by myself.

    The function state_load in the bsec_iot_example.ino, it returns the "number of bytes copied to state_buffer",  but I wonder how it knows how many bytes have been copied to state_buffer? In other words, if there's no state data in my non-volatile memory, there's only 000000..... in my non-volatile memory, how can it knows this isn't a state data?

    Can you understand me? I think maybe I didn't explain clearly enough..

    Minhwan
    Community Moderator
    Community Moderator

    Hello Charlotte,

     

    Oh, I see. Now I'm clear what you are talking about. 

    Yes, state load and state save are optional functions to store status in NVM area like EEPROM. 

    We have some example with EEPROM for BSEC Library based on Arduino. 

    https://github.com/BoschSensortec/BSEC-Arduino-library/blob/master/examples/

    Hope it helps you. 

    Thanks, 

    Hello Minhwan,

    Thank you for your code! I solved the problem. 

    So the sensor works normally now and I did some test with it. I find a problem which was mentionned in this forum, but it seems not be solved.

    The present situation:

    BME starts with the state saved when IAQ accuracy=3, and at the beginning, IAQ accuracy=0. After nearly 5 min, IAQ accuracy=3. Then IAQ accuracy falls to 2 and it doesn't turn to 3 during 30min.

    The same problem mentionned here: in  6) https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BME680-state-save-state-load-problem/td-...

    I think this problem isn't solved because I use the version 1.4.8.0.

    In this case, what should I do?  Erase the saved state in EEPROM and calibrate it again? There's no another solution, is that?

    Minhwan
    Community Moderator
    Community Moderator

    Hello, 

     

    In our example code case, our example code update status once IAQ accuracy reaches to 3 and update its status regularly after that.  

    https://github.com/BoschSensortec/BSEC-Arduino-library/blob/master/examples/basic_config_state/basic...

    At the first time, around 30 mins for IAQ accuracy is acceptable. 

    Thanks, 

    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