Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    BMA456 Init Fails

    BMA456 Init Fails

    New Poster



    I am facing an issue while initializing BMA456, I am using PN7462 as a master.


    I have the following doubts.

    1) BMA456 init sequence required configuration file to load. As there is no documentation regarding how to load the configuration file. Some of the details of the register are not mentioned in the datasheet which is used in its driver file (


    2) As the 0x5E FEATURES_IN register is one byte how can we load the feature register?

    As per the application note “Wearable feature set” we can load feature configuration on ) 0x5E.

    How 0x5E register data will be mapped with which feature.

    Ex: if we load 0xE005 in 0X5E, then data will be used for "any motion" or "no motion"?


    3) I have tried to load the configuration file which is located in the “bma456.c” file, but still after loading the file INIT status is message shows not initialize. To load the configuration file I have used the following API.


    * @brief This API writes the config stream data in memory using burst mode

    * @note index value should be even number.


    static int8_t stream_transfer_write(const uint8_t *stream_data, uint16_t index, struct bma4_dev *dev)


    int8_t rslt = -1;

    uint8_t asic_msb = (uint8_t)((index / 2) >> 4);

    uint8_t asic_lsb = ((index / 2) & 0x0F);


    /* Check the dev structure as NULL */


    if ((rslt == BMA4_OK) && (stream_data != NULL))


    rslt = bma4_write_regs(0x5B, &asic_lsb, 1);

    if (rslt == BMA4_OK)


    rslt = bma4_write_regs(0x5C, &asic_msb, 1);

    if (rslt == BMA4_OK)


    rslt = bma4_write_regs(0x5E, (uint8_t *)stream_data, dev->read_write_len);






    rslt = -1;



    return rslt;



    where read_write_len = 127, because at a time I am able to send 127  byte.  it’s call is as below:

    /* Write the config stream */

    for (index = 0; index < dev.config_size; index += dev.read_write_len)


    stream_transfer_write((bma456_config_file + index), index, &dev);


    I have written custom code based on

    5 REPLIES 5

    Community Moderator
    Community Moderator

    Hello pratikyadav,

    There was BMA456 initialization sequence description in data sheet. You could refer it.

    BMA456 reading chip id.pngBMA456 initialization.png

    The configuration file needs to be continuously written to the register address of 0x5e.

    For BMA456 initialization, there was reference example code in accelerometer.c in github.

    Community Moderator
    Community Moderator

    Hello Pratikyadav, 


    You can find more information about 0x5E in this datasheet.

    But, as far as you are using our github API, you can simply debug it. 

    Register 0x5E is kind of paging offset value register. 

    Therefore, for example, if you want to read some any motion configuration, you have to call like below. 

    rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456_ANY_MOT_LEN, dev);

    My recommendation is to follow our motion example, and reduce write and read length as 8 for test. 

    In below code, you can find how to read and set any motion or no motion confiugration.

    And also please check rslt whenever you call some function as example code. 

    Please let me know if you have any questions. 



    BTW, it worked for some time when i was tracing this problem,  but fails again without any change from software.

    Since there is no error from the i2c programming, i'm wondering which kind of problem could stop it from setting the status register. 

    Pls ignore it, sorry for posting on the wrong thread.