This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Migrating from nrf5_SDK to nrf connect sdk

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

  • Hello,

    kclauah said:

    And the suggestion from @anangl works for me.

    How can I report a bug here?

    Thanks for the feedback! I’m glad to hear you could solve the issue. I will report this internally.

    Regards,

    Markus

  • Hello again,

    I got some feedback from our development team:

    • There is a commit in Zephyr that adds a possibility to handle flash-located buffers to i2c. However, I’m not quite sure yet in which NCS release this will be included.
    • Handling DSP310 requires an extra entry in the devicetree that creates an additional buffer in RAM for a specific i2c instance: flash-buf-max-size; so still an action is required from the DPS310 driver user prior to using it

    Regards,

    Markus

Related