-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core_freq seems to affect I2C operation #212
Comments
Yes, I believe I2C frequency is derived from core clock. |
How do I set I2C frequency? I am using the i2c-dev kernel module. |
there is a file under /sys for that, it updates the speed the moment you write to it, let me boot my pi up and find it... /sys/module/i2c_bcm2708/parameters/baudrate mine is set to 100000 by default, giving 100khz, i think the bug is that corefreq comes into play, but the kernel isnt aware of that you can reduce the speed to any value you want by just writting a number to that path |
yep, 100khz with core_freq=300 becomes 120khz, (300/250)*100khz clearly a bug within the linux driver somewhere in this region, but i dont know how to fetch core_freq from here |
Problem solved by manually setting I2C frequency to 55kHz. 55*450/250 = 99. So clearly this is some kind of bug. |
If this is a kernel bug rather than a firmware bug, you should probably create an issue at https://github.com/raspberrypi/linux/issues |
@cleverca22 and let me know if that is good. If so I'll look at populating that with the overclocked core frequency. |
yep, if that clock matched core_freq, then the baudrate in /sys perfectly matches the SCL freq on the scope |
any update? |
The correct calculation of the i2c divisor requires knowledge of the clock the block is supplied with. Currently, there is no clock driver on the ARM side which would allow the proper use of clk_get_rate and friends. Only tangential references are made in the public datasheet to the clock distribution structure - a driver would have to know about this to implement the interface that allows clock querying. Currently the implementation is a stub (with statically defined clocks). |
Maybe we should add an interface from the ARM to the clock manager? Not sure it would actually be helpful though... Maybe one day we'll release the full spec for the manager and watch people's brains explode! Gordon |
@popcornmix is this still an issue? |
kernel: BCM270X_DT: Use clk_core for I2C interfaces See: #212 kernel: SDIO-overlay: add poll_once-boolean parameter kernel: dts: Added overlay for gpio_ir_recv driver See: raspberrypi/linux#1199 kernel: Add FBUNSUPPORTED ioctl for bcm2708_fb See: raspberrypi/linux#1200 kernel: config: Add FB_TFT_ILI9163 module See: raspberrypi/linux#1177
kernel: BCM270X_DT: Use clk_core for I2C interfaces See: raspberrypi/firmware#212 kernel: SDIO-overlay: add poll_once-boolean parameter kernel: dts: Added overlay for gpio_ir_recv driver See: raspberrypi/linux#1199 kernel: Add FBUNSUPPORTED ioctl for bcm2708_fb See: raspberrypi/linux#1200 kernel: config: Add FB_TFT_ILI9163 module See: raspberrypi/linux#1177
@fangfufu can this issue be closed? |
I sold my original Raspberry Pi. I left my weather station board in China. I don't have the means to test this problem, please close the issue. |
@fangfufu you just press the 'Close' button to close this issue... Thanks. |
Thanks, issue closed. |
kernel: BCM270X_DT: Use clk_core for I2C interfaces See: raspberrypi#212 kernel: SDIO-overlay: add poll_once-boolean parameter kernel: dts: Added overlay for gpio_ir_recv driver See: raspberrypi/linux#1199 kernel: Add FBUNSUPPORTED ioctl for bcm2708_fb See: raspberrypi/linux#1200 kernel: config: Add FB_TFT_ILI9163 module See: raspberrypi/linux#1177
Hello,
My I2C device gives strange readings when the core_freq in /boot/config.txt is set to 450.
When core_freq=450:
When core_freq is not set:
I wonder if this is related to the SD card corruption when core_freq is overclocked. Is there a fix for this problem other than not overclocking?
In case you wonder, my I2C device is one of those Web4Robot Weather Station Board (http://www.web4robot.com/PiWeather.html).
The text was updated successfully, but these errors were encountered: