when I do I2C detect able to detect onboard eeprom @0x50 and rtc @0x68. Not able read/write data to eeprom using i2cset and i2c get command. How to read/write data to i2c devices?
Computer on Module - Apalis iMX8
Carrier Board - Ixora Carrier Board
Computer on Module OS - Torizon
Development PC OS - Linux
A driver has control of that device. You can see the driver by looking in
/sys/bus/i2c/devices/(address)/name
You’ll either have to disable the driver or use the driver for reading/writing. For an eeprom, there should be plenty of references for doing that via userland using stuff like /sys/bus/i2c/devices/0-0050/eeprom
Hello @jeremias.tx@DaveM ,
Thank you for your help.
As @DaveM said eeprom is not accessible because driver has control over it.
1)How to unbind or disable the driver to access the eeprom?
2)How to access the eeprom without disabling the driver?
Usually hardware peripherals get binded to drivers via the device tree. I imagine in your device tree there’s something binding this EEPROM to this mystery driver. If you remove this association in the device tree then the kernel shouldn’t bind it anymore. It also might help to see dmesg and other kernel logs to see what driver is using the EEPROM to begin with, if the logs reveal this.
Hello @jeremias.tx
Thanks for your reply.
Unbind the driver worked well. Now I can access it. I am not aware of how to use driver to access the device. Can you guide to access the eeprom using driver instead of disabling it.
To simply access it using the driver you can just access the file version of the EEPROM in /sys/class. In your case the /sys/bus/i2c/devices/4-0050/eeprom file is created by the at24 driver. I believe you should be able to manipulate it like any other file as seen here: c - Reading and writing EEPROM via I2C with Linux - Stack Overflow
I’m unsure of any other features of this particular driver.