Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Possible bug in BMA456 driver

    Possible bug in BMA456 driver

    keizerr
    New Poster

    Hello everyone,

    There seems to be a bug in the BOSCH library for BMA456, exactly in the bma456h.c file. When I am trying to configure the auto low power mode settings of the accelerometer, the changes are never supposed to be applied; for example, time_out_dur and lp_odr parameters stay default.

    Here is a piece of my project source code, where the auto low power mode settings are done. Though there is an effort to set time_out_dur parameter to 3 seconds amd lp_odr to 12,5 Hz, the device still runs with settings of 2 seconds timeout and ODR of 6,25 Hz, which are the default values for the corresponding parameters.
    With another settings applied, the same issue is being faced.
    Even if I try to change an offset of this configuration BMA456H_AUTO_LOW_POWER_OFFSET to absolutely random hex values, I get the same results! How is that possible?

    /* Enable auto low power feature */
    struct bma4_dev bma = {0};
    struct bma456h_auto_low_power balp = {0};
    ...
    int8_t rslt;
    ...
    rslt = bma456h_feature_enable(BMA456H_AUTO_LOW_POWER_EN, BMA4_ENABLE, &bma);

    rslt = bma456h_get_auto_low_power_config(&balp, &bma);

    if (rslt == BMA4_OK) {

    balp.lp_odr = 3;
    balp.no_motion = 0;
    balp.time_out = 1;
    balp.time_out_dur = 150;
    balp.pwr_mgt = 1;

    rslt = bma456h_set_auto_low_power_config(&balp, &bma);
    }
    }  

      Does anyone have an idea about what could go wrong? Or did anyone face the same issue?

    Regards,
    Roman.

    3 REPLIES 3

    BSTRobin
    Community Moderator
    Community Moderator

    Hello keizerr,

    Could we know what is your application first?

    There are bma456.c(.h) and bma456h.c(.h) BMA456 driver code in github. bma456.c(.h) focus on wearable applicatoin, bma456h.c(.h) focus on hearable application. You could choose different driver code(bma456.x or bma456h.x) according your application.

    Hello BSTRobin,

    My application is the detector of whether the car is currently driving, actively parking or standing still. Seems to be quite simple, though some problems are always present. The application has to be as low-power as possible, so I need the accelerometer to be sleeping as much as possible.
    That is why I need the auto low power mode of BMA456, which I have to configure with the settings stated in the post. There is currently no ability to do that though.
    The accelerometer has to wake up when acceleration data goes over the preset threshold (any_motion feature). And has to fall asleep if no any_motion event is detected for 3 seconds (already the auto low power settings).
    Also, I need FIFO to read out the data (in both low-power and normal modes).
    And that's it! 
    So, could you please help me with my issue?

    Regards,
    Roman.

    BSTRobin
    Community Moderator
    Community Moderator
    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