Hello.
I'm working with imx23evk and need to access to eeprom. I connect a NFC memory: M24LR04E
To memory access I'm use I2C protocol and change mx23evk.c with this options:
static struct at24_platform_data eeprom_platdata = {
.byte_len = 512,
.page_size = 4,
.flags = AT24_FLAG_ADDR16,
};
static struct i2c_board_info eeprom_i2c_device[] = {
{
I2C_BOARD_INFO("at24", 0x53), /* E0=0, E1=0, E2=0 */
.platform_data = &eeprom_platdata,
},
};
static void i2c_device_init(void)
{
i2c_register_board_info(0, &eeprom_i2c_device, 1);
}
When update the firmware and reboot imx233 appear a new directory:
root@freescale /sys/class/i2c-adapter/i2c-0/0-0053$ ls
bus eeprom name subsystem
driver modalias power uevent
But, when I try to access to memory, show this errors:
root@freescale /sys/class/i2c-adapter/i2c-0/0-0053$ i2cget 0 0x53
Error: Could not set address to 0x53: Device or resource busy
root@freescale /sys/class/i2c-adapter/i2c-0/0-0053$ hexdump eeprom
hexdump: eeprom: Remote I/O error
Why appear this error?. Is wrong configuration?. Any idea?
Thanks.
Hello.
Finally, there was a problem with the address of i2c.
This NFC memory is in 0xa6.
Thanks for the help.
Hi,
Have you checked if there is any signal in the I2C_SCL and SDA?
Best Regards,
Alejandro
In your configuration, supposing
more /sys/class/i2c-adaptor/i2c-0/0-0053/eeprom > eeprom.txt | od -x
can dump the eeprom and echo something to /sys/class/i2c-adaptor/i2c-0/0-0053/eeprom can program the eeprom.
If this does not work, could you please check why at24_read() and at24_write() at driver/misc/eeprom/at24.c return error?