Bosch Sensortec Community

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

    BHI160B BoschSensorHub library

    BHI160B BoschSensorHub library

    bgfas
    New Poster

    I am trying to bring up a board with a BHI160B. Is the library found at https://github.com/BoschSensortec/BoschSensorHub known to work for this sensor?

    The circuit involves a BHI160B with no attached secondary devices, should I be using the Bosch_PCB_7183_di03_BMI160-7183_di03.2.1.11696_170103.h firmware? The application only requires reading the accelerometer and gyroscope virtual sensors.

    26 REPLIES 26

    BSTRobin
    Community Moderator
    Community Moderator

    Hi bgfas,

    Thank for your feedback.

    We checked the I2C waveform. It looks fine from the I2C bus after I parsed the FIFO data and suddenly stopped reading FIFO data. The second reading of bytes remaining is 0x1523 while only 7*32 + 26 = 250 bytes is read out.

    Could you check why the host did not read the complete FIFO data?

    Thanks for looking over the capture. I enabled debut output and saw the following output (clipped to the relevant portion):

    Bytes waiting in sensor FIFO: 4545
    Current available buffer capacity: 256 Number of bytes to read: 250
    Buffer space available for this read: 256
    Number of bytes in this transaction: 32
    Buffer space available for this read: 224
    Number of bytes in this transaction: 32
    Buffer space available for this read: 192
    Number of bytes in this transaction: 32
    Buffer space available for this read: 160
    Number of bytes in this transaction: 32
    Buffer space available for this read: 128
    Number of bytes in this transaction: 32
    Buffer space available for this read: 96
    Number of bytes in this transaction: 32
    Buffer space available for this read: 64
    Number of bytes in this transaction: 32
    Buffer space available for this read: 32
    Number of bytes in this transaction: 26
    Buffer State: i= 0 ... 250; using 250
    Current available buffer capacity: 7 No read possible.
    Status=0

    The final line ("Status=0") is one I added to print the output of updateBuffer after the 'No read possible' message which causes updateBuffer to exit before reading the fifo. It appears that if the fifo size exceeds the buffer the code will silently fail, the fifo will not be read and the code will not recover.

    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