cancel
Showing results for 
Search instead for 
Did you mean: 

STHS34PF80 PIR sensor continuous (buffered) mode – no samples pushed to IIO buffer

vrindar
Associate II

Dear ST,

I am working with the STHS34PF80 PIR sensor on an i.MX8MP platform, using the upstream-style IIO driver (st_sths34pf80). I am attempting to run the sensor in continuous mode (buffered streaming), but iio_readdev always times out with no samples delivered.

echo 1 > /sys/bus/iio/devices/iio:device3/algo_reset
echo 4 > /sys/bus/iio/devices/iio:device3/lpf
echo 200 > /sys/bus/iio/devices/iio:device3/threshold
echo 50 > /sys/bus/iio/devices/iio:device3/hysteresis
echo 4 > /sys/bus/iio/devices/iio:device3/sampling_frequency
echo 0 > /sys/bus/iio/devices/iio:device3/events/in_temp0_thresh_rising_en

# Enable scan elements
echo 1 > /sys/bus/iio/devices/iio:device3/scan_elements/in_proximity_object_en
echo 1 > /sys/bus/iio/devices/iio:device3/scan_elements/in_timestamp_en
echo 1 > /sys/bus/iio/devices/iio:device3/scan_elements/in_temp_x_en

# Enable buffer
echo 1 > /sys/bus/iio/devices/iio:device3/buffer0/enable

# Try to stream
iio_readdev -b 256 iio:device3

Observed behavior

  • The driver logs show that st_sths34pf80_preenable() runs, ODR is set, and st_sths34pf80_manage_interrupt_cfg() is called.

  • However, iio_readdev times out with Unable to refill buffer: Connection timed out.

  • It looks like no samples are ever pushed into the buffer.

    "Enter st_sths34pf80_preenable
    Enter st_sths34pf80_sensor_set_enable
    odr_value: 4 uodr_value: 0
    Enter st_sths34pf80_manage_interrupt_cfg
    ...
    Unable to refill buffer: Connection timed out"

  • From reviewing st_sths34pf80_core.c, the continuous mode flow is:
    preenable() → sensor_set_enable() → manage_interrupt_cfg() → IRQ → irq_thread() → iio_push_to_buffers_with_timestamp().

  •  

  • Currently, it seems that st_sths34pf80_manage_interrupt_cfg() does not program CTRL3.IEN correctly for data-ready interrupts when buffer streaming is enabled.

  •  

  • As a result, no valid data-ready interrupts are generated, so irq_thread never pushes samples to the buffer.


    Could you please clarify about this issue? Is there any steps i am missing? Is there any driver edit required?

    Thanks advance for your support.

0 REPLIES 0