Skip to content

Day23 - I2C Interrupt

Summary

Implemented interrupt support for I2C sensor driver.


What I Learned

  • Difference between gpiod and interrupts
  • Importance of pinctrl
  • IRQ is hardware-level event, not just driver logic

Issues Encountered

1. IRQ registered but not triggered

  • /proc/interrupts counter = 0

Cause: - Missing pull-up - No valid edge

Fix: - Add pinctrl configuration


2. Incorrect test method

  • Used direct 3.3V / GND
  • No edge generated

Fix: - Use STM32 GPIO to generate pulse


3. PC13 button unstable

  • Mechanical bounce
  • Not suitable as direct IRQ source

Fix: - Use PA8 to generate clean signal


4. Shell script issue

  • sh does not support read -p

Fix: - Use bash or modify script


Final Result

  • IRQ works correctly
  • Counter increases on trigger
  • Driver updates via interrupt

Reflection

This lab highlights the difference between:

  • Driver logic
  • Hardware configuration
  • Device Tree responsibility

Understanding this separation is critical for Linux driver development.