Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 Axis Remap for "Wrist jiggle/shake"

    BMI270 Axis Remap for "Wrist jiggle/shake"

    john20394
    New Poster

    Hi,

    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

    BSTRobin
    Community Moderator
    Community Moderator

    Hi john20394

    BMI270 sensor API on github(https://github.com/boschsensortec/BMI270-Sensor-API) 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

    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