Hello
I am using iMX 6 quad board from Phytec.
This question is regarding accessing EEPROM from user space either by using console / programming in other words How can I read from / write into EEPROM memory from user space?
AT24c32 EEPROM is connected to my iMX6 processor via I2C-2 bus. Device tree and make menu configuration are done correctly to enable EEPROM driver.
On bootup I see EEPROM is successfully detected.
[ 2.036834] at24 2-0050: 4096 byte 24c32 EEPROM, writable, 1 bytes/write
However, I don’t see EEPROM device is listed under /dev OR /sys/class, but I can see eeprom listed under sys/bus/i2c/devices/2-0050/eeprom
I tried using eeprog utility but it fails (Error at line 256: unable to open eeprom device file)
Regards
Dhanyakumar
Hi Dhanyakumar
for eeprom integration one can look at
linux/Documentation/devicetree/bindings/eeprom.txt
24c02 eeprom example:
usage
http://www.imx6rex.com/open-rex/software/how-to-use-access-openrex-peripherals/#eeprom
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Igor, Thank you for your time and response.
I understand device tree structure and usage of I2C tools to test EEPROM but my question was how can I access EEPROM using AT24 driver.
I am able to see EEPROM device at /sys/bus/i2c/devices/2-0050/eeprom
Kernel uses AT24 driver to communicate with EEPROM over I2C. I wanted to know how can I use /invoke AT24 driver to access EEPROM from user space.
The at24 driver is also a i2c driver.
Igor already provided the link, which contains the i2c user space tools/command line usage.
The sys directory operations depend on the attributions populated in the driver.
You can use the i2c user space tools, such as i2cdetect
root@imx6qdlsolo:~# i2cdetect -y -q 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- UU -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- 4a -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@imx6qdlsolo:~# i2cget -y 0 0x4a 0x9 b
0x03