Configuring UIO to handle GPIO interrupt #yocto #linux


Dear Yocto community,

I am hoping that you can provide advice on configuring UIO to handle a GPIO interrupt from user space. I found an excellent summary at and have tried to follow it as well as I can, being a newcomer to Yocto and embedded Linux.

We are using a Variscite DART-MX8M-MINI development kit, with the i.MX8M Mini processor on a System-on-Module. I have enabled spidev, which I am using to communicate with an ADS1299 EEG analog front end from TI. It generates a “data ready” interrupt DRDY# (active low). I’d like to be able to handle this falling-edge interrupt by connecting it to a GPIO (GPIO1_0) and either read() or poll() to wait for an interrupt, and can then read the acquired data using /dev/spidev0.0.

In my device tree, I have added the following under my &ecspi1 node. I am not certain this is the correct place to add this information, or if I can simply add it within the device tree “root” node “/ {“. I would appreciate your advice on the best place add this information!
// Added for DRDY# interrupt on GPIO1_0 from user space
user_io@0 {
compatible = "mydevice,generic-uio,ui_pdrv";
status = "okay";
interrupt-parent = <&gpio1>;
interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_user_io>;

Under my dts &iomuxc node, the various pinctrl groups are defined. I added the following for GPIO1_0:
// Added for DRDY# interrupt on GPIO1_0 from user space
pinctrl_user_io: user_io-0 {
fsl,pins = <
This should configure the pin to enable a pull-up.

I have modified my kernel .config file via 'bitbake -c menuconfig virtual/kernel', and it contains the following entries:

The “y” setting for CONFIG_UIO was evidently due to other dependencies in the provided configuration. I then built the SD card image using 'bitbake fsl-image-qt5', and programmed it onto my SD card.

However, when I boot the board up, I cannot see /dev/uio0 or run the modprobe command as specified in the description at the link provided above:
root@imx8mm-var-dart:~# ls /dev/u*
/dev/ubi_ctrl /dev/udev_network_queue /dev/uhid /dev/uinput /dev/urandom root@imx8mm-var-dart:~# modprobe uio_pdrv_genirq of_id="mydevice,generic-uio,ui_pdrv"
modprobe: FATAL: Module uio_pdrv_genirq not found in directory /lib/modules/4.19.35-imx8mm+ge6d3e3fefe4e

I used grep to look for “uio” in the /lib/modules directory, and only found the following:
root@imx8mm-var-dart:/lib/modules/4.19.35-imx8mm+ge6d3e3fefe4e# grep -RnI uio .

I am stumped, and think I must have something wrong in my .dts file, my .config file, or in the packages/libraries added to the Yocto image. Do you have any suggestions for how to diagnose/fix this problem? I can provide my .config file, .dts file, or any other information, but I am not sure how they should be added for access by the group.

UIO apparently is a "preferred" way to handle writing simple device drivers from user space. Do I need to add something to Yocto to enable UIO and UIO_PDRV_GENIRQ?

Thank you for your help, and kind regards,

Join to automatically receive all group messages.