This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

eeprom reading 24c256

Hi,

I am using am335x interfaced with 24c256 eeprom. It was created the node under i2c bus. When i try to read and write the resource is busy it seems.

Please let us know, i want to write some 10 bytes data to eeprom and the same results i want to read back from memory location

root@am335x-evm:~# ls -al /sys/bus/i2c/devices/1-005*
lrwxrwxrwx 1 root root 0 Jan 1 2000 /sys/bus/i2c/devices/1-0050 -> ../../../devices/platform/omap/omap_i2c.1/i2c-1/1-0050
lrwxrwxrwx 1 root root 0 Jan 1 2000 /sys/bus/i2c/devices/1-0051 -> ../../../devices/platform/omap/omap_i2c.1/i2c-1/1-0051

root@am335x-evm:~# ls -al /sys/bus/i2c/devices/1-0050/

drwxr-xr-x 3 root root 0 Jan 1 2000 .
drwxr-xr-x 10 root root 0 Jan 1 2000 ..
lrwxrwxrwx 1 root root 0 Mar 21 15:51 driver -> ../../../../../../bus/i2c/drivers/at24
-rw------- 1 root root 32768 Mar 21 15:51 eeprom
-r--r--r-- 1 root root 4096 Mar 21 15:51 modalias
-r--r--r-- 1 root root 4096 Mar 21 15:51 name
drwxr-xr-x 2 root root 0 Mar 21 15:51 power
lrwxrwxrwx 1 root root 0 Jan 1 2000 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Jan 1 2000 uevent

Thanks,

  • Hi Lofna,

    Besides the eeprom, do you have any other slave connected to the i2c1 bus?

    Can you try to access your eeprom from u-boot?

    Best Regards,
    Yordan
  • Hi,

    Yes, we have connected the slave as AT24C256 on I2C1 bus.
    In our U-boot i have commented the EEPROM portion because I am getting the below error for identifying the board ID.
    U-Boot SPL 2013.01.01 (Feb 27 2015 - 17:38:21)
    Incorrect magic number (0xffffffff) in EEPROM
    Could not get board ID
    In our kernel we have defined the i2c slave ID and it has created the interface under the I2C as above: /sys/bus/i2c/devices/1-0050

    Thanks,
  • Hi,

    When trying to use the I2C1 device is there any debug output or is the result just a system freeze? Are you accessing the eeprom from kernel space (custom driver) or from user space?

    If you are using user space code, on which function exactly does your code hangs: ioctl() or read()?

    Best Regards,
    Yordan
  • Hi,
    I am using eeprom and connected the ic with i2c0 node.
    -------------------------------------------------------------------
    root@am335x-evm:/sys/bus/i2c/devices/0-0050#
    root@am335x-evm:/sys/bus/i2c/devices/0-0050# ls -al
    drwxr-xr-x 3 root root 0 Jan 1 2000 .
    drwxr-xr-x 10 root root 0 Jan 1 2000 ..
    lrwxrwxrwx 1 root root 0 Jan 1 2000 driver -> ../../../../../bus/i2c/drivers/at24
    -rw------- 1 root root 32768 Jan 4 11:31 eeprom
    -r--r--r-- 1 root root 4096 Jan 1 2000 modalias
    -r--r--r-- 1 root root 4096 Jan 1 2000 name
    drwxr-xr-x 2 root root 0 Jan 1 2000 power
    lrwxrwxrwx 1 root root 0 Jan 1 2000 subsystem -> ../../../../../bus/i2c
    -rw-r--r-- 1 root root 4096 Jan 1 2000 uevent
    root@am335x-evm:/sys/bus/i2c/devices/0-0050#
    50/eeprom x-evm:/sys/bus/i2c/devices/0-0050# echo 10 > /sys/bus/i2c/devices/0-005
    -sh: echo: write error: Connection timed out
    -------------------------------------------------------------------
    How to write some data in to eeprom. when i tried to write something it shows time out.
    How can i simulate my eeprom work with read and write functions.
    Regards,
    Lofna