Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMX160 driver

    Established Member

    BMX160 driver

    Hi all

    I'm starting a new design and want to use the BMX160, but can't find the driver.
    I've looked on the Bosch Sensortec GitHub page, but there is no driver there.

    The BMI160 driver is available on GitHub, but doesn't seem to be compatible with the BMX160.

    Does anyone know where to download/clone the BMX160 driver?


    Tags (1)
    14 REPLIES 14
    Community Moderator

    Re: BMX160 driver

    Hi rdehart,

    At the moment we don't have a dedicated BMX160 driver released, but in the meantime you may reuse the BMI160 and BMM150 drivers.  You will have to change the chip id in the bmi160_defs.h file to 0xD8. In addition, you can refer to example code here on how to configure the device and read out data from all 3 sensors.

    Hope this helps.




    New Poster

    Re: BMX160 driver

    I found the example code in github(, but I  feel confused about the code.

    The while loop in the example:

    rslt = bmi160_set_fifo_config(fifo_config, BMI160_ENABLE, &bmi);
        /* Check rslt for any error codes */

    while(rslt != 0)

    Why the loop could run when the variable "rslt" is not zero?

    Tags (1)
    Established Member

    Re: BMX160 driver

    Thank you

    I'll try this

    Established Member

    Re: BMX160 driver


    rslt is the return result after each sensor read.

    When rslt==0, the sensor is in an error state. This allows you to handle sensor errors.

    In the WIKI example, the error is used to ensure no incorrect data is used in the program. If there are any errors, the program exits.