Bosch Sensortec Community

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

    Reset BME680 over SPI after init?

    Reset BME680 over SPI after init?

    Tokamak
    Member

    I am still getting up to speed on the BME680; however the datasheet (Memory Map, Table 16) seems to be rather vauge on how to perform a reset after init.

    Specifically, I'm struggling with the register memory map limitation of the SPI implemenation.  The first call to bme680_init function suceeds after a fresh power-on, but any subsequent call into bme680_init fails to confirm chip_id, presumibly because the reset is not being performed correctly after the device is already confgured to Page 1?

    Ultimately, this comes down to ambiguity in Table 16 about the spi_mem_page register.  The table asserts this register is at 0x73 on page 1; however, it presumibly must be reachable from both pages to allow for device reset after initialization...  It is obviously available 0xF3 (page 0), but is it also available at 0x73 (page 1)?  For details see the SPI read/write traces below generated from the bme680 library.

    Tracing the library's read/write callbacks during fresh sensor power-up:
    read 1B: (R reg 73) <- 00
    write 1B: (W reg 60) -> b6
    read 1B: (R reg 73) <- 00
    read 1B: (R reg 50) <- 61
    read 25B: (R reg 09) <- 80 b0 66 03 20 31 8b 68 d7 58 00 2e 18 ba ff 1e 1e 00 00 46 fb 8f f3 1e 8b
    read 16B: (R reg 61) <- 3e 70 34 00 2d 14 78 9c 09 67 4d df d0 12 69 00
    read 1B: (R reg 73) <- 00
    write 1B: (W reg 73) -> 10
    read 1B: (R reg 02) <- 16
    read 1B: (R reg 00) <- 36
    read 1B: (R reg 04) <- e3

    Tracing the library's read/write callbacks after sensor already initalized:
    read 1B: (R reg 73) <- 10
    read 1B: (R reg 73) <- 10
    write 1B: (W reg 73) -> 00   # attempt to change spi_mem_page to page 0 seems to be ignored?
    write 1B: (W reg 60) -> b6  # reset ignored if spi_mem_page failed..?
    read 1B: (R reg 73) <- 10  # spi_mem_page still at page 1...
    read 1B: (R reg 73) <- 10
    write 1B: (W reg 73) -> 00 # another attempt to set page 0 but never confirms result?
    read 1B: (R reg 50) <- 00 # attempts to read chip_id, but comes up empy (presumibly spi_mem_page still at page 1)
    bme680_init returned -3

    The reset after initialization seems like such a fundamental feature, that I have been second guessing myself.  Please let me know if it should indeed be possible to switch to page 0 from page 1 on this sensor.  Are there any critical delays that I need to ensure are adhered to during page swtich and reset?

    Thanks,
    Luke

    5 REPLIES 5

    Vincent
    Community Moderator
    Community Moderator

    SPI only supports 7-bit address, that is the reason we separate the whole memory to page 0 and page 1. 

    So, 0xF3 is actually translate to 0x73 on page 0.  and 0x73 on page 0 and page 1 are identical same which is include the "spi_mem_page" .  So through write the 0x73,  you are able to switch between page 0 and page 1.

    Reset we introduced in code is just to make sure sensor can back to initial status when power on since the init function will be only called when sensor is re-power on.  It is not mandatory if you do not expect an reset from system point of view.

    There is no specified delay time after switch the page,  inside sensor, it will happen right after you set the 0x73 register.    You can also insert around 2 ms here to make sure everything is fine. 

     

    Hello Vincent,

    Thanks for the reply.  I'm looking to perform a softreset since I do not have the ability to toggle power to the sensor and don't always know what state the sensor is in (initalized or freshly powered on).  Specifically, if my measurement program crashes, I'd like to reset on next launch and continue in either condition.

    You mentioned that I should be able to switch from page 1 back to page 0.  I'm unable to do so, as seen in the second posted trace of the bme680_init function which tries to switch from page 1 to page 0 and fails.  Can you confirm that you have sucessfully performed a softreset of the sensor after switching to page 1?

    Vincent
    Community Moderator
    Community Moderator

    Yes, i double confirmed at my side. 

    The sensor can switch page any time when you write register 0x73 and also do soft reset when switched from page 1 to page 0. 

    Thanks Vincent -- I appreciate your help and patience in confirming expected functionality!  I located the issue; the write messages were not properly composed on my end.

    Best Regards,
    Luke

    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