Bosch Sensortec Community

    SOLVED

    BMI270 gyro scaling incorrect if using FIFO with prefiltered data

    Highlighted
    New Poster

    Re: BMI270 gyro scaling incorrect if using FIFO with prefiltered data

    Hi etracer,

    I am also implementing  my own API, with regards to FIFO, if only gyro is used, (and this is not clear to me) what should be read offset in the FIFO.

    If AUX is enabled, then gyro offset is 8 (as in datasheet) . Sorry not starting a new thread on the FIFO here.

    Tags (1)
    Highlighted
    Established Member

    Re: BMI270 gyro scaling incorrect if using FIFO with prefiltered data


    @pr1 wrote:

    Hi etracer,

    I am also implementing  my own API, with regards to FIFO, if only gyro is used, (and this is not clear to me) what should be read offset in the FIFO.

    If AUX is enabled, then gyro offset is 8 (as in datasheet) . Sorry not starting a new thread on the FIFO here.


    If you're using headerless mode and only have gyro data in the FIFO (FIFO_CONFIG_1 = 0x80) then there is no offset. Just the 6 byte frames of the gyro axis data.

    Highlighted
    New Poster

    Re: BMI270 gyro scaling incorrect if using FIFO with prefiltered data

    Thank you, yes that is correct. I have only gyro data and bytes 0-5 have the first x,y,z of the gyro data.

    I have another question though.

    The FIFO is set in overwrite mode, and everytime I check the length it is 230.

    What is 230 ? Is it the number of frames ?

    IS this the number of frames then 230x6=1380 bytes. The FIFO is supposed to be 2 KB.

    Is the FIFO lenght correct and 230 is the number of frames (on frame is one x,y,z tuple - 6 bytes) ?

    This is the fifo len method

    #define BMI2_GET_BIT_POS0(reg_data, bitname) (reg_data & (bitname))
    u8 bosch_imu_bmi270::bmi2_get_fifo_length(uint16_t *fifo_length, int busfd)
    {
    u8 rslt;

    u8 index = 0;

    u8 data[2] = { 0 }; // MSB-1 LSB-0
     
     
    /* Read FIFO length */
    rslt = this->read_register(busfd,0x24,data,1);
     
    if (rslt==1){
     
    data[index] = BMI2_GET_BIT_POS0(data[1], UINT8_C(0x3F)); //0x3f mask
    (*fifo_length) = ((data[index] << 8) | data[index - 1]);
    printf("fifo len is %d\n",*fifo_length);
     
    }
     
    return rslt;
    }
    Highlighted
    Established Member

    Re: BMI270 gyro scaling incorrect if using FIFO with prefiltered data

    The FIFO length is the number of bytes available in the FIFO - not the number of "frames". So in the discussed example of only headerless gyro data in the FIFO one "frame" would be the FIFO length reporting 6 bytes.

    Highlighted
    New Poster

    Re: BMI270 gyro scaling incorrect if using FIFO with prefiltered data

    Thank you for the clarification. I also found the issue with the fifo length code posted above the following was incorrect

    this->read_register(busfd,0x24,data,1);
     
    //it should be
     
    this->read_register(busfd,0x24,data,2); // to read 0x25 also
    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