Failed to run LIS2DH sample

Hello,

Used environment: 

  • Board: nrf9151dk_nrf9151_ns
  • SDK Toolchain: v3.0.2
  • IDE: Vscode

I'm trying to test the LIS2DH sample using the nrf9151DK and the STEVAL-MKI151V1. The wiring is as follow: 

  • vdd_lis2dh        vdd_dk (configured to 3.3V using Nrf Connect Desktop)
  • vdd_io_lis2dh   vdd_dk 
  • scl_lis2dh         scl_dk (pin 28)
  • sda_lis2dh        sda_dk (pin 29)
  • gnf_lis2dh         gnd_dk

I've used this example as reference:  zephyr/samples/sensor/lis2dh.

I've modifed my prj.conf as follow: 

CONFIG_SENSOR=y
CONFIG_LOG=y
CONFIG_I2C_NRFX=y
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_BACKEND_UART=y
CONFIG_EARLY_CONSOLE=y
CONFIG_I2C_LOG_LEVEL_DBG=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y

I've added an overlay as follow: 

&i2c1 {
    status = "okay";
    clock-frequency = <I2C_BITRATE_STANDARD>;
    pinctrl-0 = <&i2c1_default>;
    pinctrl-1 = <&i2c1_sleep>;
    pinctrl-names = "default", "sleep";
    lis2dh@18 {
        compatible = "st,lis2dh";
        reg = <0x18>;
    };
};

&pinctrl {
    i2c1_default: i2c1_default {
        group1 {
            psels = <NRF_PSEL(TWIM_SCL, 0, 28)>,
                    <NRF_PSEL(TWIM_SDA, 0, 29)>;
            bias-pull-up;
        };
    };

    i2c1_sleep: i2c1_sleep {
        group1 {
            psels = <NRF_PSEL(TWIM_SCL, 0, 28)>,
                    <NRF_PSEL(TWIM_SDA, 0, 29)>;
            low-power-enable;
        };
    };
};

The build/flash are OK but in the UART0 console, I've got this error: 

[00:00:00.287,597] <dbg> os: setup_thread_stack: stack 0x2000e1f8 for thread 0x2000ccb0: obj_size=1024 buf_start=0x2000e1f8 buf_size 1024 stack_ptr=0x2000e5f8
[00:00:00.287,628] <dbg> os: setup_thread_stack: stack 0x2000e0b8 for thread 0x2000cbf8: obj_size=320 buf_start=0x2000e0b8 buf_size 320 stack_ptr=0x2000e1f8
[00:00:00.287,689] <dbg> clock_control: clkstarted_handle: lfclk: Clock started
[00:00:00.287,719] <dbg> os: setup_thread_stack: stack 0x2000d5b8 for thread 0x2000c6e0: obj_size=768 buf_start=0x2000d5b8 buf_size 768 stack_ptr=0x2000d8b8
[00:00:00.290,679] <err> os: ***** BUS FAULT *****
[00:00:00.290,679] <err> os: Precise data bus error
[00:00:00.290,679] <err> os: BFAR Address: 0x0
[00:00:00.290,710] <err> os: r0/a1: 0x0001e46c r1/a2: 0x00000001 r2/a3: 0x01980000
[00:00:00.290,710] <err> os: r3/a4: 0x40009000 r12/ip: 0x00000000 r14/lr: 0x000162e9
[00:00:00.290,740] <err> os: xpsr: 0x21000000
[00:00:00.290,740] <err> os: Faulting instruction address (r15/pc): 0x0001625e
[00:00:00.290,771] <err> os: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
[00:00:00.290,832] <err> os: Current thread: 0x2000ccb0 (main)
[00:00:00.404,052] <err> os: Halting system

I've tried: 

  • Modifiing the periph to i2c0 or i2c2 -> another issue of build (conflict with uarte0)
  • Changing the pins of SDA and SCL -> same issue

Investigating the addresses using: 
C:\nrf_exercies\lis2dh>addr2line -e build/lis2dh/zephyr/zephyr.elf 0x000162e9

I've got:
C:/ncs/v3.0.2/modules/hal/nordic/nrfx/drivers/src/nrfx_twim.c:341

So It seems like an I2C error misconfiguration error. 

Do you have any idea how can i solve this ?

Thank you in advance.

Related