imx23evk eeprom access problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx23evk eeprom access problem

1,879 次查看
tonimartín
Contributor I

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.

标签 (1)
标记 (3)
0 项奖励
回复
3 回复数

1,553 次查看
tonimartín
Contributor I

Hello.

Finally, there was a problem with the address of i2c.


This NFC memory is in 0xa6.


Thanks for the help.

0 项奖励
回复

1,553 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Have you checked if there is any signal in the I2C_SCL and SDA?

Best Regards,

Alejandro

0 项奖励
回复

1,553 次查看
PeterChan
NXP Employee
NXP Employee

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?