Skip to content

Day36 Log - IIO Triggered Buffer Integration

Summary

Successfully integrated:

  • IIO trigger
  • triggered buffer
  • IRQ-driven sampling
  • user-space controlled data flow

Achievements

  • DRDY IRQ triggers IIO pipeline
  • Buffer streaming works via /dev/iio:device0
  • Multi-channel frame validated
  • User-space control confirmed

Issues Encountered

1. Missing IIO modules

Unknown symbol iio_push_to_buffers

Fix:

modprobe industrialio-triggered-buffer
modprobe kfifo_buf

2. Duplicate scan index

Duplicate scan index 0

Fix:

  • add unique scan_index per channel

3. Module stuck (File exists)

Cause:

  • incomplete cleanup
  • refcount mismatch

Fix:

  • reboot system

4. Module in use

rmmod: module in use

Fix:

echo 0 > buffer/enable
echo "" > trigger/current_trigger

5. Trigger misuse

Cause:

  • directly calling buffer handler from IRQ

Fix:

  • use proper trigger flow

Observations

1. User-space control is critical

  • buffer must be manually enabled
  • trigger must be explicitly bound

2. Driver must remain passive

  • no auto-start
  • no hidden configuration

3. Debugging requires layered approach

IRQ → trigger → buffer → userspace

Key Insight

IIO is not just a driver API, but a data pipeline framework.


Reflection

This stage represents a major shift:

driver-centric → system-centric

The driver no longer "serves data directly", but participates in a larger pipeline controlled by user space.


Next Plan

  • add timestamp support
  • improve buffer parsing
  • explore trigger types
  • test high-frequency sampling