Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Possible bug in BMA456 driver

    Possible bug in BMA456 driver

    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?


    3 REPLIES 3

    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?


    Community Moderator
    Community Moderator