Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 Axis Remap for "Wrist jiggle/shake"

    BMI270 Axis Remap for "Wrist jiggle/shake"

    New Poster


    I've got the wrist jiggle/shake feature working succesfully on the BMI270, however I noticed that it only seems to detect the gesture when the device is upright, ie the Z axis of the chip is facing up. So rotating the chip onto it's side (X axis lines up with gravity) and performing the same gesture, it does not trigger. I saw this behaviour but I could not find much about it in documentation.

    That's fine but I would like to swap the axis so that the gesture works when the X axis is pointing up with gravity as the chip is oriented like this in our design.

    I tried to modify the GEN_SET_1 features register but when I do this, the gesture no longer works, and also the internal status register does not log any issues with axis remapping. here is a snippet from my driver when I am trying to remap the axis after initiatlizing the feature:

    ret = i2c_reg_write_byte_dt(&i2c_, BMI270_FEAT_PAGE_ADDR, BMI2_PAGE_1);

    // Mapping: X->Z , Y->Y, Z->X
    wr16 = (0x02 << 0) | (0x01 << 3) | (0x00 < 6) | (0x01 << 9);
    ret = i2c_burst_write_dt(&i2c_, BMI270_FEATURES_REG_ADDR + BMI270_AXIS_MAP_STRT_ADDR, (uint8_t *)&wr16, 2);

    // Check INTERNAL_STATUS for invalid axis remap error?
    ret = i2c_reg_read_byte_dt(&i2c_, BMI270_INTERNAL_STATUS_ADDR, &val_read);
    LOG_DBG("Internal status 0x%x", val_read);
    if (val_read != 0x01)
    LOG_ERR("axes remap error");
















    1 REPLY 1

    Community Moderator
    Community Moderator

    Hi john20394

    BMI270 sensor API on github( had provided interface for mapping the physical coordinates of sensors to the target coordinates.

    struct bmi2_remap remapped_axis;

    rslt = bmi2_get_remap_axes(&remapped_axis, dev);
    if(rslt != BMI2_OK)
    PDEBUG("bmi270 org_axis: x=%02X, y=%02X, z=%02X\r\n", remapped_axis.x, remapped_axis.y, remapped_axis.z);

    remapped_axis.x = BMI2_X;
    remapped_axis.y = BMI2_Y;
    remapped_axis.z = BMI2_NEG_Z;

    rslt = bmi2_set_remap_axes(&remapped_axis, dev);
    if(rslt != BMI2_OK)
    PDEBUG("bmi270 remapped axis failed\r\n");

    Usually, before using these gestures, you need to first perform axis mapping based on the placement of sensors on the structure and the target coordinates.

    Smart device co-ordinate system.png