Bosch Sensortec Community

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

    BMA456 initialization failure

    Minhwan
    Community Moderator

    Re: BMA456 initialization failure

    Yes, you are right, if the value of 0x2A register is 0x00, it means BMA456 isn't initialized yet. 

    I will check it once you upload it. 

    Thanks, 

    MBEonas
    Member

    Re: BMA456 initialization failure

    I found the issue while investigating the I2C.

    Our I2C driver inserted a start and stopp after writing the first byte (the register address) of the burst transfer. Once we got rid of this behaviour, the BMA456 responds correctly after initialization.

    Best Regards

    QQW
    New Poster

    Re: BMA456 initialization failure

    我使用STM32进行计步但是在对bma456写入配置时出错,在此前每一步都是成功的,但是去读0X2A的状态是0,这意味着并没有初始化,怎么回事? 我使用了IIc接口 请尽快回复 谢谢!

     附上我们的程序:

    Jayesh
    Member

    Re: BMA456 initialization failure

    @MBEonas

    Can you please suggest how to did you remove the start/stop condition after the first register write of the burst. Or how can I confirm if I am facing the same issue?

    Aisha
    Member

    Re: BMA456 initialization failure

    Hello,

    may i ask how you performed the linkage for i2c read and write functions, i have some problem linking those, i tried to copy some of the bits from the code you provided, so i have the following:

    BMA4_INTF_RET_TYPE bma4_i2c_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
    uint8_t dev_addr = *(uint8_t*)intf_ptr;

    return i2c_burst_read(intf_ptr, 0x18, reg_addr, reg_data, len);

    }

    /*!
    * I2C write function map to COINES platform
    */
    BMA4_INTF_RET_TYPE bma4_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
    uint8_t dev_addr = *(uint8_t*)intf_ptr;
    return i2c_burst_write(intf_ptr, 0x18, reg_addr, reg_data, len);
    }

    and in the init function i have:

    struct device *i2c_dev = device_get_binding("I2C_2");

    and:

    bma->intf = BMA4_I2C_INTF;
    bma->bus_read = bma4_i2c_read;
    bma->bus_write = bma4_i2c_write;
    bma->intf_ptr = i2c_dev;

    i have a bus fault possabily cased by a null pointer some where. it would be great if you showed me the steps for doing this linkage.

    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