Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMI270 FIFO length always zero

    BMI270 FIFO length always zero

    sos
    New Poster

    Hi, I have successfully interface BMI270 using I2C protocol. Also I am able to load configuration file.

    https://github.com/BoschSensortec/BMI270-Sensor-API

    I am referring examples code from above link. I have received various activities like running, walking etc. from this example "\examples\bmi270\step_activity".

    I want these two activities "ON_BICYCLE", "IN_VEHICLE". This activity recognition is provided in "bmi270_context" folder.

    But I am getting this warning "Warning [1] : FIFO empty". I am referring this example file "activity_recognition".

    Please help me to achieve these functionalities.

    Thanks in advanced.

     

    5 REPLIES 5

    BSTRobin
    Community Moderator
    Community Moderator

    Hello sos,

    For "Warning [1] : FIFO empty", you mean your code couldn't enter this loop?

    while (rslt != BMI2_W_FIFO_EMPTY)
    {
    /* Provide the number of frames to be read */
    act_frames = 5;

    printf("Requested FIFO data frames : %d\n", act_frames);

    /* Get the activity output */
    rslt = bmi270_context_get_act_recog_output(act_recog_data, &act_frames, &fifoframe, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    printf("Parsed FIFO data frames : %d\r\n", act_frames);

    for (count = 0; count < act_frames; count++)
    {
    printf(
    "Activity Recognition output[%d]:Sensor time: %lu\t Previous activity: %s\t current: %s\n",
    count,
    act_recog_data[count].time_stamp,
    activity_reg_output[act_recog_data[count].prev_act],
    activity_reg_output[act_recog_data[count].curr_act]);
    }

    }

    Thanks for the reply!!!

    Move the board for activity recognition for 30 sec :
    Fifo length = 0
    Requested FIFO data frames : 5
    Warning [1] : FIFO empty
    Parsed FIFO data frames : 0

    I received this output on serial terminal.

    Code is entering in to while loop but not entering in below for loop because value of act_frames received is 0.

    if (rslt == BMI2_OK)
    {
    /* Update FIFO structure */
    fifoframe.data = fifo_data;
    fifoframe.length = 516;

    rslt = bmi2_get_fifo_length(&fifo_length, &bmi2_dev);
    printf("Fifo length = %d \n", fifo_length);

    /* Read FIFO data */
    rslt = bmi2_read_fifo_data(&fifoframe, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    while (rslt != BMI2_W_FIFO_EMPTY)
    {
    /* Provide the number of frames to be read */
    act_frames = 5;

    printf("Requested FIFO data frames : %d\n", act_frames);

    /* Get the activity output */
    rslt = bmi270_context_get_act_recog_output(act_recog_data, &act_frames, &fifoframe, &bmi2_dev);
    bmi2_error_codes_print_result(rslt);

    printf("Parsed FIFO data frames : %d\r\n", act_frames);

    for (count = 0; count < act_frames; count++)
    {
    printf(
    "Activity Recognition output[%d]:Sensor time: %d\t Previous activity: %s\t current: %s\n",
    count,
    act_recog_data[count].time_stamp,
    activity_reg_output[act_recog_data[count].prev_act],
    activity_reg_output[act_recog_data[count].curr_act]);
    }
    }
    }

    Please help me to resolve the issue.

    Thanks in advanced.

    BSTRobin
    Community Moderator
    Community Moderator

    Hello sos,

    Is your actual activity like "ON_BICYCLE", "IN_VEHICLE"? Output data will match with actual activity status.

    Hello Sir,

    I want these activities to detect "ON_BICYCLE", "IN_VEHICLE".  In sample code these activities are given,

    * Various Activity recognitions are listed in array. */
    const char *activity_reg_output[6] = { "OTHERS", "STILL", "WALKING", "RUNNING", "ON_BICYCLE", "IN_VEHICLE" };

    I can perform still, walking, running activity. So I was trying to get other activities like still, waking or other.

    But the code is not able to detect these activities also like still, walkin or other. Code gives warning as I posted above.

    Please suggest other solution.

    Thanks in advanced.

    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