M.Talha
M.Talha

Reputation: 11

Change I2C Speed in Linux

I am using linux based kits and I have a problem about changing i2c speed. Do you know how to change in linux which has the version 3.4.39

Upvotes: 1

Views: 5620

Answers (1)

Toto
Toto

Reputation: 89

Since you are using ARM, you can define the I2C speed at boot time in the devicetree. I am making some assumptions here (eg. that you are using U-boot as bootloader), but embedded systems tend to look very similar.

  1. Locate your devicetree. It is specified during boot and probably located in /boot/ (You can also type printenv in U-boot shell and look for a variable called devicetree)
  2. Disassemble your devicetree to dts-format (device-tree-source)

  3. Change the i2c-speed parameter (Search for "i2c" and "clock-frequency" clock-frequency = < some_speed_in_HZ >;"

  4. Compile it back to *.dtb (device-tree-blob) and store it as a my_devicetree.dtb in /boot/

on the next reboot, in the bootloader menu choose my_devicetree.dtb as devicetree-file and it should work.

Upvotes: 1

Related Questions