Skip to content

Day35 Log - DRDY IRQ Integration

Summary

Extended IIO I2C driver with DRDY GPIO interrupt support.

Achieved:

  • STM32-driven data-ready signaling
  • Linux GPIO interrupt handling
  • verified interrupt flow end-to-end

Issues Encountered

1. IRQ triggered only once

Cause:

  • DRDY not enabled in sensor config

Fix:

CONFIG = ENABLE | DRDY_EN

2. DRDY edge not re-triggered

Cause:

  • signal remained LOW (no new falling edge)

Fix:

  • switch to pulse model (LOW → HIGH)

3. Module reload error

Cannot allocate memory

Cause:

  • incorrect working directory / module state

Fix:

  • ensure proper unload
  • reinsert module correctly

Observations

1. IRQ flow confirmed

STM32 → GPIO → Linux IRQ → driver

2. DRDY pulse works

  • no IRQ storm
  • stable edge trigger

3. IIO still uses read_raw()

  • IRQ does not replace read path yet
  • still direct mode

Key Learning

  • Sensor must explicitly enable DRDY behavior
  • Edge-triggered IRQ requires proper signal toggling
  • Interrupt is a trigger, not data transport
  • Proper layering simplifies debugging

Reflection

This stage bridges:

  • firmware signal design (GPIO)
  • Linux interrupt handling
  • IIO framework integration

It transforms the system from polling-based to event-driven.


Next Step

Day36:

  • implement IIO trigger
  • push data to buffer
  • enable streaming interface