0

I have loaded the appropriate kernel modules and set them to load upon boot (i2c-dev and i2c_bcm2835). A call to lsmod confirms that they do indeed load on boot. But alas, I don't see any i2c devices appearing in /dev. There is no /boot/config.txt file in Alpine.

Has anyone else come across this problem before? What might a next step be to figuring out what's wrong? Thanks.

EDIT: I've been reading more... could this have anything to do with device tree?

0

You need to announce the I²C hardware to the i2c_bcm2835 module. It's not hardcoded, but controlled by the DTB loaded at boot. Add

dtparam=i2c_arm=on

to /boot/config.txt.

  • There is no /boot/config.txt file in Alpine. – user91215 Oct 26 '18 at 14:39
  • Then, either the boot partition /dev/mmcblk0p1 is not mounted by default, or you are running with the default configuration and simply had to create that file. But first check if it is mounted. Creating that file on the root partition will do nothing. – Janka Oct 26 '18 at 15:05
  • You're right, /dev/mmcblk0p1 is not mounted by default. Alpine is not persistent between boots--the entire system is loaded into RAM on boot. Should I just mount it anyway and make the file? – user91215 Oct 26 '18 at 15:11
  • You have to edit that file on that partition. It's only needed for the built-in bootloader of the Raspberry Pi, you don't need to have it mounted when the system is up. – Janka Oct 26 '18 at 15:20
  • Alright, so I noticed that I was probably looking the wrong place for this config file. I was looking for /media/mmcblk0p1/boot/config.txt but there actually is a config.txt alongside a start.elf and cmdline.txt in /media/mmcblk0p1/ so I imagine that's the one. Upon adding the suggested line to the top of config.txt in that directory, I indeed got /dev/i2c-1!!! Thank you! – user91215 Oct 26 '18 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy