1

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

M.Talha
  • 11
  • 1
  • 5

1 Answers1

1

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.

Toto
  • 79
  • 10
  • unfortunately in my /boot/ ,there is nothing and when I type prientenv there is no such as devicetree word. – M.Talha Apr 08 '19 at 06:08
  • what about dtb_file or something similar? – Toto Apr 08 '19 at 07:27
  • in boot ,there is no file . it is empty.What do you think is it possible that dtb file would be in different location. – M.Talha Apr 08 '19 at 11:33
  • It could be on another partition or another storage device. The easiest would be to analyse the "printenv"-output from uboot. There will be some information which file is being served the kernel as devicetree and where it is located. – Toto Apr 08 '19 at 11:51