Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

Advanced users • load the i2c-dev automatically at boot on Yocto without using modprobe manually?

$
0
0
Hello,

I’m working on a Raspberry Pi 4b with Yocto to build an image that would use my own DTO (for an htu21 sensor over I2C) in it.
I've been creating my own layer and everything works fine but only if I manually load the i2c-dev module using modprobe, when it should work automatically at boot without needing to do that.

I have confirmed that i2c-dev is built as a module in the kernel configuration (CONFIG_I2C_DEV=m), and the module is available to be loaded, and I also added the following line to my local.conf file to try and autoload the i2c-dev module at boot:

Code:

KERNEL_MODULE_AUTOLOAD_rpi += " i2c-dev"
But nothing's happening (I don’t see i2c-dev in /dev), so I had to run

Code:

modprobe i2c-dev
manually to get the sensor being discovered and working fine and appearing in /dev/i2c-1.

I've also ensured that the I2C interface is enabled in the [color=#408000config.txt[/code] file with the following:

Code:

# Enable I2Cdtparam=i2c_arm=ondtparam=i2c1=on# My own overlaydtoverlay=htu21
What am I missing to ensure that the i2c-dev module is loaded automatically? I don’t want to manually run modprobe after each boot, is there something I need to adjust in my Yocto or is there another step in the kernel config or Device Tree setup that I should be looking at?

Thanks in advance!

Statistics: Posted by meteora — Fri Apr 04, 2025 2:18 pm



Viewing all articles
Browse latest Browse all 8082

Trending Articles