Bosch Sensortec Community

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

    BHI260AB - Orientation Matrix read - problem

    BHI260AB - Orientation Matrix read - problem

    btruden_henway
    Long-established Member

    Hello,

    I'm using a BHI260AB hosted by an STM32 over SPI. I have a BMM150 also connected to the BHI and they are successfully communicating (I can use any virtual sensors that make use of the magnetometer).

    I have the following layout on my custom PCB:

    btruden_henway_0-1657805383875.png

    So I've set the orientation matrixes to the following values:

    • Accelerometer: {1,0,0 , 0,1,0 , 0,0,1}
    • Gyroscope: {1,0,0 , 0,1,0 , 0,0,1}
    • Magnetometer: {1,0,0 , 0,-1,0 , 0,0,-1}

     

    After setting the orientation matrixes of the three physical sensors, I attempt to read the "Physical Sensor Information" parameters from the Parameter Interface. I want to read back the orientation matrixes to verify that they were correctly stored into the chip. For this, I send the following command to the Command Interface (for reading the accelerometer parameters):

    btruden_henway_3-1657808137120.png

    According to the datasheet, I should get the following information on the Status and Debug FIFO (payload of 20 bytes):

    btruden_henway_1-1657807350424.png

    But instead, I'm getting the following on the Status and Debug FIFO:

    btruden_henway_4-1657808207043.png

    What could be the issue? Why I'm not getting the right information on the Status and Debug FIFO? The Status and Debug FIFO is configured in the default mode (Synchronous mode).

    BR

     

     

     

     

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi btruden_henway,

    Did you call bhy2_get_orientation_matrix() function to get matrixes value?

    btruden_henway
    Long-established Member

    Hello BSTRobin,

    I don't use the Bosch API on my microcontroller, I was not able to make it work properly. I implemented my own API.

    Do you have a logic analyzer's capture showing the SPI data exchange (between the host MCU and the BHI chip) during the execution of the bhy2_get_orientation_matrix() function?

    BR

    Hi btruden_henway,

    Sensor API is easy to be migrated to different platform with little adapter interface, like write, read, delay interface.
    It is recommended that you run the sensor API and modify it based on the sensor API after it works normally.

    btruden_henway
    Long-established Member

    Hello BSTRobin,

    The main problem is that the API adapter interface uses blocking functions. And that's not acceptable in our application. 

    However, I've found the problem. There's a mistake in the datasheet. Please notify the corresponding sector in the company to do the correction.

    btruden_henway_0-1660244957708.png

    The parameter 0x0121 (and 0x1121 for writing) corresponds to the Physical sensor ID = 1, not 0. The sensor ID = 1 corresponds to the accelerometer. So the parameter 0x0121 corresponds to the accelerometer, the 0x0123 to the gyroscope and the 0x0125 to the magnetometer.

    Best regards.

     

     

    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