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,
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
我使用STM32进行计步但是在对bma456写入配置时出错,在此前每一步都是成功的,但是去读0X2A的状态是0,这意味着并没有初始化,怎么回事? 我使用了IIc接口 请尽快回复 谢谢!
附上我们的程序:
@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?
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.