This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change I2C speed
#1
Would you please teach me how to change I2C speed?
Thanks
Reply
#2
Tongue 
Hi chobio

i don't have scope to measure clock rate, but you still can give it a try. Tongue
---------------------------------------------------------------------------------------------------
please follow up https://tinkerboarding.co.uk/wiki/index....are#Kernel to download kernel of Tinkerboard.
and push my attachment(you can modify frequency as you want) to kernel/arch/arm/boot/dts/overlays/

then, you can start to build kernel. after building, copy kernel/arch/arm/boot/dts/overlays/i2c-clock-freq.dtbo to /boot/overlays/ of tinkerboard.
and modify /boot/hw_intf.conf as below

intf:i2c1=on
intf:i2c4=on
intf:dtoverlay=i2c-clock-freq

after rebooting, check with "xxd /proc/device-tree/i2c@ff650000/clock-frequency"  

P.S. mapping table as below:
i2c@ff650000 ->I2C0
i2c@ff140000 ->I2C1
i2c@ff660000 ->I2C2
i2c@ff150000 ->I2C3
i2c@ff160000 ->I2C4
i2c@ff170000 ->I2C5


Attached Files
.gz   i2c-clock-freq-overlay.dts.tar.gz (Size: 319 bytes / Downloads: 14)
Reply
#3
Hi scorpiochang

Thank you for your advice.
Unfortunately, i have not success....

xxd /proc/device-tree/i2c@ff650000/clock-frequency
not changed value...
Reply
#4
Hi Chobio

Can you brief what steps you did,...

And
1. Please share hw_inrt.conf, i2c-clock-freq-overlay.dts and i2c-clock-freq.dtbo?
2. Please make sure i2c-clock-freq.drbo exist in /boot/overlays/ of tinkerboard.

P.S. How to build *.dtbo, refer to https://tinkerboarding.co.uk/forum/thread-998.html
Reply
#5
hello scopiochang  chobio,

I try to i2c speed up too.

> scopipchang
thank you for your dts file and infomation about how to import.

so, I will send my hw_intf.conf, dts and dtbo.
could you check it ?

and I found the file "clock-frequency" here in tinkerboad. 
> ls /sys/firmware/devicetree/base/i2c*

i2c@ff140000:
#address-cells  clock-frequency  clocks      interrupts  phandle    pinctrl-names  status
#size-cells     clock-names      compatible  name        pinctrl-0  reg


Does i2C1 become 400000bps ??

thanks


Attached Files
.zip   dtbo.zip (Size: 1.47 KB / Downloads: 8)
Reply
#6
Hi u26

cat you help to try xxd clock-frequency!

linaro@tinkerboard:/proc/device-tree/i2c@ff140000$ xxd clock-frequency
00000000: 0006 1a80
Reply
#7
Hi scopiochang,

I could check the frequency.
so I will try on real decive.

thanks.

u26
Reply
#8
Hi chobio and u26

forget to notice you, sholue add "i2c-clock-freq.dtbo" at Makefile as below:

kernel/arch/arm/boot/dts/overlays/Makefile

ds1307.dtbo \
lirc-rpi.dtbo \
lirc-toshiba.dtbo \
i2c-clock-freq.dtbo \
Reply
#9
Hi scorpiochang,

Thank you for your support.
I using TinkerOS ver.1.8 ,so this is problem for not working ovrerlays.
when using Ver.2.04, it works.
Thank you.

by the way, I looking for the way how to OS upgrade from ver.1.8 to 2.04 without sd image rewrite. (like raspberry pi rpi-update)
if you know the way, i am very happy...
Reply
#10
Hi chobio

You need to build uboot by self.
https://github.com/TinkerBoard/debian_u-boot?files=1

[Linux]
Building image:
$ cd debian_u-boot
$ make CROSS_COMPILE=arm-linux-gnueabihf- O=miniarm-rk3288 tinker-rk3288_defconfig all -j4
$ ./miniarm-rk3288/tools/mkimage -n rk3288 -T rksd -d miniarm-rk3288/spl/u-boot-spl-dtb.bin u-boot.img
$ cat miniarm-rk3288/u-boot.bin >> u-boot.img

Flash uboot image:
Prepare one sdcard which has the full Debian image inside.
then insert the sdcard into a linux based OS, and suppose the block device of the sdcard is /dev/sdx
$ sudo dd if=[path]/u-boot.img of=/dev/sdx seek=64

Please backup flash firstly, and be careful with dd operation.
How to backup sdcard: 
https://tinkerboarding.co.uk/forum/thread-900.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)