EEPROM

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"
    
Expected Output
root@phyboard-zeta-imx7d-1:~# dmesg | grep -i "eeprom"
[    1.206466] at24 0-0050: 4096 byte 24c32 EEPROM, writable, 32 bytes/write
[    1.221015] at24 3-0056: 4096 byte 24c32 EEPROM, writable, 32 bytes/write

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
    
  • Now generate a random 4kB file:

Target (Linux)
dd if=/dev/urandom of=/tmp/test1.img bs=4096 count=1
  • 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
    
  • Read the file back:

Target (Linux)
dd if=/sys/bus/i2c/devices/0-0050/eeprom of=/tmp/test2.img bs=4096 count=1
  • 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
Expected Output
root@phyboard-zeta-imx7d-1:~# md5sum /tmp/test1.img && md5sum /tmp/test2.img
d3741bed8d4c0450affe309a62f7afa4  /tmp/test1.img
d3741bed8d4c0450affe309a62f7afa4  /tmp/test2.img

Repeating the above steps with the address 3-0056 will similarly utilize the EEPROM on the Expansion Board.