Eeprom chip CAT24C32 is not able to read/write in U-Boot for Colibri-imx6ull module

Hi ,

I want to read/write data in to eeprom chip CAT24C32 from u-boot via i2c command or i2c channel 0.

I’m able to probe the chip and get the device id = 0x50 , but while reading data every time i’m getting random data
from chip on u-boot terminal. I’m not able to write any data into chip.

please help me.

Regards,

Hitendra Prajapati

hi @hitendra_prajapati

I want to read/write data in to eeprom chip CAT24C32 from u-boot via i2c command or i2c channel 0.
I’m able to probe the chip and get the device id = 0x50 , but while reading data every time i’m getting random data from chip on u-boot terminal. I’m not able to write any data into chip.

Which commands did you entered to get the device id and reading and writing the data?

Have you tried to do the communication in Linux instead of U-Boot?

Bsp 2.8b5 is not supported anymore, please update to Bsp 2.8b6 at your earliest convenience.

Best regards,
Jaski

hi @jaski.tx

Which commands did you entered to get
the device id and reading and writing
the data?

I used i2c dev 0 and i2c probe command from u-boot. Also use i2c md and i2c mw command .

Have you tried to do the communication
in Linux instead of U-Boot ?

yes it is working with demo code attached in text file. link text

Please try to check at your end on U-boot or on in Linux .

Regards

Hi @hitendra_prajapati

I tried to read on my end in U-boot and this is working fine.

Which i2c line are you using?
Could you share the data you are getting in Linux and U-boot in text file?

Thanks.

Linux log file : link text

U-boot log file : link text

In U-boot everytime i’m greeting the random value from reading the same location.

hi @jaski.tx

I’m using i2c 0 line (FYI : SoC pin 194,196)

@jaski.tx please share your u-boot log.

Can you share U-boot version and it’s binary for colibri-imx6ull module?

regards,
Hitendra prajapati

Thanks for the information. This is my u-boot log.

0010: 45 85 02 81 01 e1 00 bd 45 85 02 81 01 e1 00 bd    E.......E.......
Colibri iMX6ULL # i2c md 0x68 0x10 10
0010: 46 85 02 81 01 e1 00 bd 46 85 02 81 01 e1 00 bd    F.......F.......
Colibri iMX6ULL # i2c md 0x68 0x10 10
0010: 46 85 02 81 01 e1 00 bd 46 85 02 81 01 e1 00 bd    F.......F.......
Colibri iMX6ULL # i2c md 0x68 0x10 10
0010: 47 85 02 81 01 e1 00 bd 47 85 02 81 01 e1 00 bd    G.......G.......
Colibri iMX6ULL # i2c md 0x68 0x10 10
0010: 47 85 02 81 01 e1 00 bd 47 85 02 81 01 e1 00 bd    G.......G.......
Colibri iMX6ULL # i2c md 0x68 0x10 10
0010: 48 85 02 81 01 e1 00 bd 48 85 02 81 01 e1 00 bd    H.......H.......
Colibri iMX6ULL # i2c md 0x68 0x10 10

I am using the U-Boot version 2016.11-2.8.6+g83a53c1c0c which is included in this Bsp Release.

Regarding getting the random value when you read form the same location in U-Boot, you should carefully read the section Read Operations in the datasheet and handle this correctly in U-Boot.

Hi @jaski.tx

Thanks for information.

Check my attach file . I want to read/write inside U-boot code via I2C channel.
so I have done modification in file and using CONFIG_SYS_I2C.
Will it work or any other configuration need to be use.

I checked the datasheet , still not able to read correct data.

I want to read from EEPROM , after the U-boot binary start . Is there any things need to enable for that or put delay anywhere ?

@jaski.tx Please guide me for this.

Attachment file : link text

Regards,
Hitendra

@jaski.tx

any update on this ??

Hi

In your U-Boot command line log you do not specify that the chip uses two byte addressing.

E.g. What do you get when you execute

i2c dev 0
i2c probe
i2c md 0x50 0x0010.2 10
i2c md 0x50 0x0010.2 10

And writing some values

i2c mw 0x68 0x0010.1 10
i2c mw 0x68 0x0010.1 11
i2c mw 0x68 0x0010.1 12

i2c md 0x50 0x0010.2 10

Note that in your U-Boot code:

  • A write takes twr until it completes, you should wait that time after each write.
  • You disable the device model for I2C. That is not future proof as DM will be the only supported driver flavour in the future. I don’t know if you did all needed changes for switching to non DM.

Max