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

Device Tree • Adapting an overlay for AT24 EEPROM on i2c-0 for Pi 5

$
0
0
I have been trying to adapt for the Pi 5 a device tree overlay I previously used on older Raspberry Pis that enables access to an AT24C32 I2C EEPROM on the i2c-0 bus. My reason for such an overlay is to write the EEPROM using 32-byte page writes rather than the single-byte writes the at24 module uses by default. But I discovered that as-is it didn't work on the Pi 5 (dtoverlay would give a "Failed to apply overlay '...' (kernel)" error).

My previous overlay (mostly cribbed from here) was as follows:

Code:

/dts-v1/;/plugin/;/ {compatible = "brcm,bcm2835";fragment@0 {target = <&i2c0>;__overlay__ {pinctrl-names = "default";pinctrl-0 = <&i2c0_pins>;clock-frequency = <100000>;status = "okay";#address-cells = <1>;#size-cells = <0>;at24@50 {compatible = "atmel,24c32","at24";reg = <0x50>;pagesize = <32>;size = <4096>;address-width = <16>;};};};};
After some trial-and-error, I narrowed it down to the "pinctrl-*" lines that were causing the problem. I discovered that the dmesg log contained an error that said "OF: resolver: node label 'i2c0_pins' not found in live devicetree symbols table". If I comment those two lines out, I can successfully load the overlay on my Pi 5. I also changed the "compatible" line to "bcm2712", but I'm not sure that was needed.

My question is: what were these lines doing before, and why don't I need them now? Did they do anything or were even necessary before?

Statistics: Posted by HwAoRrDk — Sat Mar 02, 2024 3:51 pm



Viewing all articles
Browse latest Browse all 3552

Trending Articles