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
Asked
Active
Viewed 4,158 times
1
-
i2c speed on what device? – drescherjm Apr 05 '19 at 12:59
-
ARM-Embedded-S5P4418-Single-Board-Computer – M.Talha Apr 05 '19 at 13:05
-
Maybe you should ask this question on [Electronics SE](https://electronics.stackexchange.com/).. – oguz ismail Apr 05 '19 at 13:24
-
ok, I will also ask in this platform.Thank you for suggestion – M.Talha Apr 05 '19 at 14:14
1 Answers
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.
- 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)
Disassemble your devicetree to dts-format (device-tree-source)
Change the i2c-speed parameter (Search for "i2c" and "clock-frequency" clock-frequency = < some_speed_in_HZ >;"
- 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
-
-
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