Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    BMA456 - ASIC not initialized

    BMA456 - ASIC not initialized

    Nitzan
    New Poster

    Hi,

    I'm using BMA456 accelerometer with I2C interface, with the following initialization code:

    uint16_t bma456_device_init()
    {
    uint16_t rslt = BMA4_OK;

    /* Modify the parameters */
    s_dev.dev_addr = BMA4_I2C_ADDR_PRIMARY << 1;
    s_dev.interface = BMA4_I2C_INTERFACE;
    s_dev.bus_read = bma456_access_read;
    s_dev.bus_write = bma456_access_write;
    s_dev.delay = OS_PL_Delay;
    s_dev.read_write_len = READ_WRITE_LEN_16;
    s_dev.resolution = RESOLUTION_12_BIT;
    s_dev.feature_len = BMA456_FEATURE_SIZE;

    /* a. Reading the chip id. */
    rslt |= bma456_init(&s_dev);

    if(rslt != BMA4_OK)
    {
       //ASSERT
    }

    /* b. Performing initialization sequence.
    c. Checking the correct status of the initialization sequence.
    */

    rslt |= bma456_write_config_file(&s_dev);

    if(rslt != BMA4_OK)
    {
       //ASSERT
    }

    /* Declare an accelerometer configuration structure */
    struct bma4_accel_config accel_conf;

    /* Assign the desired settings */
    accel_conf.odr = BMA4_OUTPUT_DATA_RATE_100HZ;
    accel_conf.range = BMA4_ACCEL_RANGE_16G;
    accel_conf.bandwidth = BMA4_ACCEL_NORMAL_AVG4;

    /* Set the configuration */
    rslt |= bma4_set_accel_config(&accel_conf, &s_dev);

    if(rslt != BMA4_OK)
    {
       //ASSERT
    }

    /* Enable the accelerometer */
    rslt |= bma4_set_accel_enable(1, &s_dev);

    return rslt;

    The code get into assert after "rslt |= bma456_write_config_file(&s_dev);". When I debug it I saw that the problem occure after reading the config_stream_status i.e the ASIC not initialized. When I'm running the code in Debug-Mode I don't see this problem.

    1. Can you help me understand why the ASIC not initialized?

    2. Do I have to run bma456_write_config_file? when I removing this line the code work without problems...

    Thanks

    Nitzan

    1 REPLY 1

    FAE_CA1
    Community Moderator
    Community Moderator

    Hi,

    Thanks for your inquiry.

    Yes, you need to run bma456_write_config_file in order to make many features available such as step counting, FIFO and interrupts, etc.

    Please refer to the examples online at https://github.com/BoschSensortec/BMA456-Sensor-API/commit/1f42063da36a13fe8e804bd55d4aeb681357b0c5 for more information.

    Thanks.

    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