Generic device sample streaming using Data Ready trigger Minimal Example not running on NRF52840DK

Hello all,

I´m Trying to Run the Minimal-Example of Sensor-Stream API

https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/sensor/stream_drdy#id7

HW is: NRF52840DK, SparkFun Micro 6DoF IMU - ISM330DHCX which is ST, LSM6DSV16X

Code Configuration as follows:

poj.conf

CONFIG_I2C=y
CONFIG_I2C_NRFX=y        # your &i2c1 instance
CONFIG_RTIO=y
CONFIG_I2C_RTIO=y

CONFIG_GPIO=y

CONFIG_SENSOR=y
CONFIG_SENSOR_ASYNC_API=y

CONFIG_LSM6DSV16X=y
CONFIG_LSM6DSV16X_STREAM=y

dts.overlay

&spi0 {status = "disabled";};
&spi1 {status = "disabled";};
&i2c0 {status = "disabled";};

/ {
    aliases {
                 stream0 = &lsm6dsv16x;
            };
    };

&i2c1 {
	status = "okay";
	compatible = "nordic,nrf-twim";

	pinctrl-0 = <&i2c1_default>;
	pinctrl-1 = <&i2c1_sleep>;
	pinctrl-names = "default", "sleep";
	/*enable device runtime pm for i2c */
	//zephyr,pm-device-runtime-auto;


	lsm6dsv16x: lsm6dsv16x@6b {
		compatible = "st,lsm6dsv16x";
		reg = <0x6b>;
        status = "okay";  // Ensures the device is active (not disabled)
		
        int1-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
		int2-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
		drdy-pin=<1>;
		accel-odr = <8>;
		//gyro-odr = <8>;
		fifo-watermark = <32>;
		accel-fifo-batch-rate = <8>;
		//gyro-fifo-batch-rate = <8>;
		drdy-pulsed;

		/*enable device runtime pm for bme sensor */
		//zephyr,pm-device-runtime-auto;
	};
};


&pinctrl {
	i2c1_default: i2c1_default {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
					<NRF_PSEL(TWIM_SCL, 0, 31)>;
		};
	};

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

scr/main.c  (Section. Full code see link on Top)

static int print_accels_stream(const struct device *dev, struct rtio_iodev *iodev)
{
	int rc = 0;
	const struct sensor_decoder_api *decoder;
	struct rtio_cqe *cqe;
	uint8_t *buf;
	uint32_t buf_len;
	struct rtio_sqe *handles[NUM_SENSORS];
	struct sensor_three_axis_data *accel_data = (struct sensor_three_axis_data *)accel_buf;

	/* Start the streams */
	for (int i = 0; i < NUM_SENSORS; i++) {
		printk("sensor_stream\n");
		sensor_stream(iodevs[i], &stream_ctx, NULL, &handles[i]);
	}

	while (1) {
        printk("Sanity Check Before Consume Block \n");
		cqe = rtio_cqe_consume_block(&stream_ctx);
        printk("Sanity Check Passed Consume Block \n");
		if (cqe->result != 0) {
			printk("async read failed %d\n", cqe->result);
			return cqe->result;
		}

		rc = rtio_cqe_get_mempool_buffer(&stream_ctx, cqe, &buf, &buf_len);

		if (rc != 0) {
			printk("get mempool buffer failed %d\n", rc);
			return rc;
		}

		const struct device *sensor = dev;

		rtio_cqe_release(&stream_ctx, cqe);

		rc = sensor_get_decoder(sensor, &decoder);

		if (rc != 0) {
			printk("sensor_get_decoder failed %d\n", rc);
			return rc;
		}

		/* Frame iterator values */
		uint32_t accel_fit = 0;

		/* Number of sensor data frames */
		uint16_t xl_count, frame_count;

		rc = decoder->get_frame_count(buf, accel_chan, &xl_count);

		if (rc != 0) {
			printk("sensor_get_frame failed %d\n", rc);
			return rc;
		}

		frame_count = xl_count;

		/* If a tap has occurred lets print it out */
		if (decoder->has_trigger(buf, SENSOR_TRIG_TAP)) {
			printk("Tap! Sensor %s\n", dev->name);
		}


		int8_t c = 0;

		/* decode and print Accelerometer frames */
		c = decoder->decode(buf, accel_chan, &accel_fit, 1, accel_data);

		printk("XL data for %s %lluns (%" PRIq(6) ", %" PRIq(6)
		       ", %" PRIq(6) ")\n", dev->name,
		       PRIsensor_three_axis_data_arg(*accel_data, 0));

		rtio_release_buffer(&stream_ctx, buf, buf_len);
	}

	return rc;
}
 

When running the example actually does not run into a error but it stucks into the line: 

"cqe = rtio_cqe_consume_block(&stream_ctx);"

"

Thats the output when running Program.

I checked already minimal-examples with running the sensor with

- simple sample fetch "polling" and DRDY-Callback on via INT1 GPIO --> Both works without flaws.

Has anybody have had similar cases or can explain what´s potentially causing the issus?

Thank´s already

Related