Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Handle custom relative orientation between BHI260AP and BMM150

    Handle custom relative orientation between BHI260AP and BMM150

    New Poster

    Dear Community,

    I included BHI260AP + BMM150 magnetometer in my custom PCB design. 

    Due to space constraints, I mounted the two devices in opposite layers (BHI260 AP top, BMM150 bottom)

    The relative orientation of the two devices is the following:

    Top layer (top view): you can see the BHI260AP with the pin 1 indicated in blue



    Bottom layer (top view: seen from top): you can see the BMM150 with the pin 1 indicated in green



    My question is: how to take into consideration this aspect? where can I configure it?

    Thank you very much,

    best regards







    6 REPLIES 6

    Community Moderator
    Community Moderator

    Hi Gianlucamilani,

    As you are designing PCB board, you could refer HSMI document:

    Do you mean you would like to know how to do axis mapping of BHI260AP and BMM150?

    Dear Robin,

    thanks for your reply.

    I would like to know how to take in consideration the fact that in my PCB the BMM150 has a specific relative orientation with respect to BHI260AP, that for instance is different from the one used by the BHI260AP shuttle board . 

    Should I set some parameters via firmware? Which ones in that case? Should I do anything else?

    (Actually, I think this is what you refer to with "axis mapping ", but I am not sure)


    best regards,



    I am waiting almost 2 months for an answer, this support forum is not what I expected.

    Hi Gianlucamilani,

    Sorry for the delayed reply.
    Axis mapping can be set through the following software code. In order to know the axis mapping matrix, you must also know what your target coordinates are? In this way, the physical coordinates of the sensor can be mapped to the target coordinates to generate a matrix.
    struct bhy2_orient_matrix acc_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    struct bhy2_orient_matrix gyro_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
    struct bhy2_orient_matrix mag_matrix = {1, 0, 0, 0, -1, 0, 0, 0, -1};
    bhy2_set_orientation_matrix(BHY2_SENSOR_ID_ACC, acc_matrix, &bhy2);
    bhy2_set_orientation_matrix(BHY2_SENSOR_ID_GYRO, gyro_matrix, &bhy2);
    bhy2_set_orientation_matrix(BHY2_SENSOR_ID_MAG, mag_matrix, &bhy2);