Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    BMA456 Init Fails

    BMA456 Init Fails

    pratikyadav
    New Poster

    Hello,

     

    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 (https://github.com/BoschSensortec/BMA456-Sensor-API).

     

    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);

    }

    }

    }

    else

    {

    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 https://github.com/BoschSensortec/BMA456-Sensor-API

    5 REPLIES 5

    BSTRobin
    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.

    https://github.com/BoschSensortec/BMA456-Sensor-API/blob/master/examples/bma456/generic/acceleromete...

    Minhwan
    Community Moderator
    Community Moderator

    Hello Pratikyadav, 

     

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

    https://www.bosch-sensortec.com/media/boschsensortec/downloads/application_notes_1/bst-mas-an032-00....

    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. 

    https://github.com/BoschSensortec/BMA456-Sensor-API/blob/master/examples/bma456/generic/motion.c

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

    Please let me know if you have any questions. 

    Thanks, 

     

    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.

    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