Hello,
I am migrating code from nrf5_SDK_17.0.2 to nrf connect sdk v1.6.1. The board i am using is nrf52dk(nrf52832) connected with adafruit LSM6DSO.
Everything works fine on nrf5_SDK which based on modified example twi_sensor. But when I run lsm6dso example from zephyr\samples\sensor\lsm6dso, it says
Cannot set sampling frequency for accelerometer. -134
I have tried manually write register to i2c address like what I does on nrf5_SDK but hard fault occurs.
//uint8_t buf[2] = {0x10, 0x10};
//int ret = i2c_write(dev, buf, 1, 0x10);
int ret = i2c_reg_write_byte(dev, 0x6a, 0x10, 0x10);
if (ret < 0){
printf("cannot i2c_burst_write");
}else {
printf("custom i2c_burst_write");
}
Any help would be appreciated.
prj.conf
CONFIG_STDOUT_CONSOLE=y CONFIG_I2C=y CONFIG_SENSOR=y CONFIG_LSM6DSO=y CONFIG_LSM6DSO_TRIGGER_NONE=y CONFIG_CBPRINTF_FP_SUPPORT=y
modified part of nrf52dk_nrf52832.dts
arduino_i2c: &i2c0 {
compatible = "nordic,nrf-twi";
status = "okay";
sda-pin = <26>;
scl-pin = <27>;
lsm6dso@6a {
compatible = "st,lsm6dso";
label = "LSM6DSO";
reg = <0x6a>;
};
};