Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

core_freq overclock and SD-card corruption.

Sun Dec 23, 2012 4:13 pm

Hi guys,

like many of us i'm having problems with sdcard corruption if i overclock the core.
I know this is being discussed in the overclock-thread on this board but perhaps it would be better to start a new thread for it.
Anyway,here are my settings:

Code: Select all

arm_freq=1000
over_voltage=8
gpu_freq=333
avoid_pwm_pll=1
core_freq=250
sdram_freq=500
over_voltage_sdram=6
force_turbo=1
gpu_mem=128
disable_overscan=1
This seems to work ok for me,however if i increase the core_freq even a little it corrupts the file system.
So i was wondering if anyone has found a solution for it?
I'm using a 256MB R-Pi and running RaspBMC on it.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5342
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: core_freq overclock and SD-card corruption.

Sun Dec 23, 2012 4:29 pm

If you want to experiment, I'd suggest playing with:
init_emmc_clock (default 100000000)
from config.txt.

and
sdhci-bcm2708.emmc_clock_freq (default 100000000)
from cmdline.txt.

They used to both be 50000000, but we increased them to 100000000 which fixed corruption for some people.
(The logic was keeping the ratio of core_freq to emmc_freq as it was before was possibly beneficial).
If you don't specify sdhci-bcm2708.emmc_clock_freq, it will default to init_emmc_clock.

You can try varying them up and down, and they can be changed independently of each other.
Keep an eye on sdcard performance (e.g. with "sudo hdparm -t /dev/mmcblk0").
Making init_emmc_clock higher than sdhci-bcm2708.emmc_clock_freq is an sdcard overclock (which should increase sdcard performance until it breaks).
Making init_emmc_clock lower than sdhci-bcm2708.emmc_clock_freq is an sdcard underclock (which should reduce sdcard performance).

I think if they are not a multiple of 50000000 then perfoemance will go down, due to an integer (possibly even) divider that needs to get 25MHz.

Reducing sdcard performance may be beneficial if it allows an increase to core_freq (for some use cases).

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Sun Dec 23, 2012 5:45 pm

Thanks for the fast reply Dom.
Actually i'd like to experiment a little,i will prepare another sdcard with raspbian on it and try.
But i'm a little confused,how are the emmc- and core-clocks related to each other or how do they impact stability?
I understand the over-/underclocking of the card but can't see the link with the core_freq.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5342
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: core_freq overclock and SD-card corruption.

Sun Dec 23, 2012 6:06 pm

Pihkal wrote:Thanks for the fast reply Dom.
Actually i'd like to experiment a little,i will prepare another sdcard with raspbian on it and try.
But i'm a little confused,how are the emmc- and core-clocks related to each other or how do they impact stability?
I understand the over-/underclocking of the card but can't see the link with the core_freq.
emmc_clock is the actual clock speed.
sdhci-bcm2708.emmc_clock_freq is what the linux sdcard driver thinks the emmc_clock is. It can then divide that down to get the desired frequency (usually 25MHz for fast cards, less for slower cards).

We believe the place where the data is corrupted when overclocking core_freq is the asynchronous bridge between the system bus (core_freq) and the sdcard peripheral (emmc_freq).

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Sun Dec 23, 2012 8:08 pm

Been doing some testing,ended up with a corrupted card.
Though i think it was caused by my own stupidity...
Here's what i did:

set init_emmc_clock to 150000000
set sdhci-bcm2708.emmc_clock_freq to 150000000 (so i thought)
Didn't change core_freq.
Hdparm showed a decrease in performance of 4MB/s

set init_emmc_clock to 200000000
Didn't change sdhci-bcm2708.emmc_clock_freq
Changed core_freq to 350Mhz.
Hdparm showed 18.5 MB/s which was the default card speed.
It booted but with lots of mmc errors

At this point i checked the sdhci-bcm2708.emmc_clock_freq and saw it wasn't in the cmdline.txt

So i was running the sdcard at twice it's speed,rebooted and no go,got a massive amount of mmc errors and failed to boot.
On an unrelated matter,i'm unable to reboot the system via ssh,i have to do it locally,weird...

Back to re-imaging the card...

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Mon Dec 24, 2012 3:14 pm

Done some more testing.
Since i've never tested for stability with Quake3 i decided to compile it and test.
Turns out the oc wasn't stable.
So i started the oc proces again,starting with the arm,next ram followed by gpu and last the core.
This is my config.txt at the moment:

Code: Select all

arm_freq=925
over_voltage=6
gpu_freq=325
avoid_pwm_pll=1
core_freq=250
force_turbo=1
gpu_mem=128
current_limit_override=0x5A000020
disable_overscan=1
decode_MPG2=0xe3dae05f
hdmi_drive=2
hdmi_group=1
hdmi_mode=31
overscan_left=60
overscan_right=60
overscan_top=30
overscan_bottom=30
Things i've learned about my Pi:
  • 1 The ram doesn't like to be overclocked at all,even overvolting didn't help much.
    SD got corrupted at 475Mhz,performance dropped at 450Mhz,so no ram ocing for me.
    2 The gpu doesn't really like ocing,it goes up to 325Mhz,any higher and i get SD corruption.
    3 The core hates ocing,any increase causes SD corruption.
Maybe i can push the arm and gpu a little further but it wont be much.
The psu is rated at 1.2A so i guess my Pi isn't the best one around.
During testing the SoC never got hotter than 55°C,it's equiped with a heatsink.

Anyway,now it's again time to start playing with the emmc clocks...

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 2:02 am

Well there's been a shocking development!
In the overclock-thread a user named Tompen suggested he got rid of the corruption by doubling the core_freq and the emmc_clock,i can confirm this,IT WORKS!
Don't know why because it sounds a little absurd but i'm not complaining.
I haven't done much testing yet but it runs stable in Quake and i haven't had any corruption or mmc errors.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5342
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 12:07 pm

Pihkal wrote:Well there's been a shocking development!
In the overclock-thread a user named Tompen suggested he got rid of the corruption by doubling the core_freq and the emmc_clock,i can confirm this,IT WORKS!
Don't know why because it sounds a little absurd but i'm not complaining.
I haven't done much testing yet but it runs stable in Quake and i haven't had any corruption or mmc errors.
Doubling to what? Based on that thread, we doubled the default emmc_clock to 100MHz (back on October 16th).
https://github.com/Hexxeh/rpi-firmware/ ... 67ad922b97

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 1:10 pm

I've doubled init_emmc_clock to 200000000 (200 Mhz) but didn't tell the linux driver,i left it at 100 Mhz in cmdline.txt .
I also doubled the core_freq to 500 Mhz,this worked great on a Transcend 4GB Class 6 card in Raspbian,it gave a massive performance boost.
The SD transfer rate also increased a little,from 18 MB/s to 20MB/s.
I've been testing for several hours,installing things through apt-get,playing Quake,browsing the web and rebooting many many times in between to see if any corruption would occur.
It didn't happen.
But,this isn't a "fix" for all cards.
Once i was sure it worked with my 4GB card,i tried it with a TakeMS 16GB Class 10 card with Raspbmc installed on it,this still corrupted the card.
So i think it all depends on the card you're using.
I'll keep experimenting with my other cards (2X Kingston 8GB Class 4) and post my results.

Merry Christmas by the way.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5342
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 1:14 pm

Pihkal wrote:I've doubled init_emmc_clock to 200000000 (200 Mhz) but didn't tell the linux driver,i left it at 100 Mhz in cmdline.txt .
I believe this means you are talking to the sdcard at 50MHz (rather than the specced 25MHz). I could well imagine sdcards not working (and am a little surpised you have one that does like it).

What is the effect if you also tell linux driver it is 200MHz?

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 1:30 pm

Yeah,i know it doesn't really makes sense but strangely it workes.
I've checked the emmc speed with vcgencmd measure_clock emmc and it reports 200 Mhz.
Anyway,i'll change the cmdline.txt and test some more,i'll report back to you within a few hours (or minutes if it gets corrupted again).

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Dec 25, 2012 2:26 pm

Well that was strange,the first time i've booted with the changed cmdline.txt Quake hanged,i had to pull the powerplug to reboot.
After rebooting everything looks ok.
So i've played a little quake and messed around in the desktop,seems to work fine.
I haven't mentioned this before but before i reboot or halt the pi i issue a sync command,i don't know if reboot or halt do this by themself.
The hdparm score is more or less the same one i had without the modified cmdline.txt .

Can you please check if i used the correct syntax in the cmdline file?

Code: Select all

dwc_otg.lpm_enable=0 sdhci-bcm2708.emmc_clock_freq=200000000 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
config.txt

Code: Select all

arm_freq=1000
over_voltage=8
gpu_freq=350
avoid_pwm_pll=1
core_freq=500
init_emmc_clock=200000000
force_turbo=1
gpu_mem=128
current_limit_override=0x5A000020
disable_overscan=1
decode_MPG2=0xe3dae05f
hdmi_drive=2
hdmi_group=1
hdmi_mode=31
overscan_left=60
overscan_right=60
overscan_top=30
overscan_bottom=30

So i didn't see any differences with the non-changed cmdline.txt
This was tested with the 4GB class 6 card.

mcgyver83
Posts: 358
Joined: Fri Oct 05, 2012 11:49 am

Re: core_freq overclock and SD-card corruption.

Mon Nov 04, 2013 10:39 pm

Hi, I know that this is an old thread, but I have the same issue.
News?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23931
Joined: Sat Jul 30, 2011 7:41 pm

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 9:17 am

mcgyver83 wrote:Hi, I know that this is an old thread, but I have the same issue.
News?
Check out the Raspi github - there is some work being done and a recent test firmware is available that may help.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5342
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 10:54 am

We are testing a possible corruption fix. If you've got sdcard corruption problems then have a look at instructions here:
https://github.com/raspberrypi/linux/issues/415

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 11:42 am

I moved away from an sdcard rootfs.
The rootfs now lives on an nfs-share.
Didn't have any corruption for the past 3 months, even with multiple crashes due to high overclocks.
Downside to this is the 100mb nic the pi uses but I can live with that.
At least it boots every single time.

Regards

mcgyver83
Posts: 358
Joined: Fri Oct 05, 2012 11:49 am

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 1:05 pm

Ok, thanks to all.

I'll check Raspi github and the other link provided.

@Pihkal: please can you explain you solution?
and...what is the 100mb nic? :D

Pihkal
Posts: 52
Joined: Sun Sep 04, 2011 9:50 am

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 1:42 pm

100mb nic = 100 megabit/second network interface card, this means the theoretical maximum network throughput is limited to roughly 12 megabyte per second, which is slower then most sdcards are.
Also keep in mind the nic and usb controller share the same bus so data that comes from usb devices can slow down network traffic and vise versa.

As for the rootfs, well I have a NAS at home, on this NAS I have a NFS-share, the Pi (running raspbmc) is setup to use the NFS share as it's root filesystem.
So basically it boots the kernel from the sdcard (from the fat partition, this isn't a problem because it never got corrupted anyway), establishes a connection to the NAS and loads it rootfs over the lan.
This is actually pretty easy to setup, if you want more details please tell me the OS you're booting, it isn't supported by all OS'es and can differ between them.

Regards

mcgyver83
Posts: 358
Joined: Fri Oct 05, 2012 11:49 am

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 3:35 pm

Thank you!
I'm running raspbian on the raspberry and I use a wifi dongle to connect it to the lan, so speed is not acceptable for this purpose.
I also have an external usb hdd (with its power supply) attached to the rasp, maybe could be a solution tu use it instead of nfs-share.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23931
Joined: Sat Jul 30, 2011 7:41 pm

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 3:41 pm

mcgyver83 wrote:Thank you!
I'm running raspbian on the raspberry and I use a wifi dongle to connect it to the lan, so speed is not acceptable for this purpose.
I also have an external usb hdd (with its power supply) attached to the rasp, maybe could be a solution tu use it instead of nfs-share.
Yes, that's a common use case.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1442
Joined: Sat Sep 10, 2011 11:43 am

Re: core_freq overclock and SD-card corruption.

Tue Nov 05, 2013 4:49 pm

https://github.com/raspberrypi/linux/issues/415

Please help test this fix for the SD card corruption, I don't believe it is limited specifically to overclocking (although changing the clocks will change the probability of corruption) but it would be interesting if you still get problems with this fix

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

Return to “Advanced users”