Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI160 watermark interrupt FIFO data being repeated

    michiels
    Member

    Re: BMI160 watermark interrupt FIFO data being repeated

    Hi,

    I have found that this issue happened always when I got a certain pattern (0x80 0x00) in my data which let me to this part in the driver code:

     

    * @brief This API checks the presence of non-valid frames in the read fifo data.
    */
    static void check_frame_validity(uint16_t *data_index, const struct bmi160_dev *dev)
    {
    if ((*data_index + 2) < dev->fifo->length)
    {
    /* Check if FIFO is empty */
    if ((dev->fifo->data[*data_index] == FIFO_CONFIG_MSB_CHECK) &&
    (dev->fifo->data[*data_index + 1] == FIFO_CONFIG_LSB_CHECK))
    {
    /*Update the data index as complete*/
    *data_index = dev->fifo->length;
    }
    }

    }

    Is this a bug in the driver or is this intentional behavior?

    Best regards,

    Michiel

    BSTRobin
    Community Moderator

    Re: BMI160 watermark interrupt FIFO data being repeated

    Hello michiels,

    It is recommended that you refer to the example code and check whether the FIFO reading data is normal according to your ODR and FIFO watermark settings. For example, if you set 100 Hz ODR, enable accel, gyro and FIFO header, and set FIFO watermark to 78(means 78*4 bytes FIFO data), then after receiving FIFO watermark interrupt, you will read 24 frames of accel and gyro data, with a time interval of about 240ms.

    First confirm that the FIFO reading is normal, and then check whether the data is correct.

    michiels
    Member

    Re: BMI160 watermark interrupt FIFO data being repeated

    Hi BSTRobin,

    Before I do the read operation I check the available data as is done in the example application (rslt = get_fifo_byte_counter(&bytes_to_read, dev);). This reads consistently 768. When I toggle a GPIO pin of my microcontroller outside to check the interrupt timings it is also consistent. Also if the PCB is laying still on the desk this issue does not appear to happen. It consistently happens when the desribed pattern appears in the data and it does not happen when I turn of the check for the data. When I for example plot the data it looks correct when I ignore this 0x80 0x00.

    Thanks and best regards,

    Michiel

    BSTRobin
    Community Moderator

    Re: BMI160 watermark interrupt FIFO data being repeated

    Hello michiels,

    Did you run reference code?

    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