The phyCORE-i.MX7 SOM comes equipped with an onboard 4kB EEPROM and the phyBOARD-i.MX7 development kit also features an additional EEPROM on the PEB-D-RPI Expansion Board. The devices are connected to the I2C0 interface at address 0x50 and 0x56 respectively. This guide provides instructions on how to interact with the EEPROM on board the SOM in Linux.
Step-by-Step Guide
First ensure that the EEPROM was initialized correctly by checking the boot log.
Target (Linux)
dmesg | grep -i "eeprom"
CODE
Expected Output
root@imx7d-phyboard-zeta-004:~# dmesg | grep -i "eeprom"
[ 1.318477] at24 0-0050: 4096 byte 24c32 EEPROM, writable, 32 bytes/write
CODE
This confirms that the EEPROM has 4096 bytes available at address 0x50.
Clear out the EEPROM:
Target (Linux)
dd if=/dev/zero of=/sys/bus/i2c/devices/0-0050/eeprom bs=4096 count=1
CODE
Now generate a random 4kB file:
Target (Linux)
dd if=/dev/urandom of=/tmp/test1.img bs=4096 count=1
CODE
Now write this file to the EEPROM:
Target (Linux)
dd if=/tmp/test1.img of=/sys/bus/i2c/devices/0-0050/eeprom bs=4096 count=1
CODE
Read the file back:
Target (Linux)
dd if=/sys/bus/i2c/devices/0-0050/eeprom of=/tmp/test2.img bs=4096 count=1
CODE
Now ensure that both the original file and the file that was copied back match:
Target (Linux)
md5sum /tmp/test1.img && md5sum /tmp/test2.img
CODE
Expected Output
root@imx7d-phyboard-zeta-004:~# md5sum /tmp/test1.img && md5sum /tmp/test2.img
81ad66df7f773128aef1ec7966180ebf /tmp/test1.img
81ad66df7f773128aef1ec7966180ebf /tmp/test2.img
CODE
Repeating the above steps with the address 0-0056 will similarly utilize the EEPROM on the Expansion Board.