Industrial controller
Exposing GPIO to applications on an i.MX 8M Plus carrier
A custom carrier around an i.MX 8M Plus system-on-module. The application team needed deterministic control of digital I/O — relays, interlocks, status LEDs and sensor triggers — addressed by name, running unprivileged, without sysfs workarounds.
What we did
- Authored IOMUXC pinctrl nodes in the device tree, setting MUX_MODE and pad config — drive strength, pull, hysteresis and slew — per pin against the schematic
- Mapped the signals across the GPIO1–GPIO5 banks and added I2C expanders as extra gpiochips where the module pinout ran out
- Used gpio-hog for lines that must hold state from boot: power enables, resets and fail-safe outputs
- Named every line with gpio-line-names and moved the application from sysfs to libgpiod
- Set udev rules and group ownership so the application opens /dev/gpiochipN without root
Outcome
The application addresses I/O by signal name rather than bank and offset, runs unprivileged, and the pin map is documented against the schematic rather than living in one engineer's head.
