Page 1 of 1

How do I read the current core clock speed from the SOC

Posted: Mon May 02, 2016 7:16 pm
by Conjur
I need the ability to read the current core frequency from C. I do not want a bloated library, nor to execute a script and scrape the output (vcgencmd), nor to read the startup value from config.txt

I have looked through the registers, and can not find anything.

I need to calculate spi dividers dynamically.

V/r,
Mike

Re: How do I read the current core clock speed from the SOC

Posted: Mon May 02, 2016 7:24 pm
by Rive
Core (GPU) or Arm (CPU)?

Arm:

Code: Select all

watch '(vcgencmd measure_clock arm)'
Core:

Code: Select all

watch '(vcgencmd measure_clock core)'

Re: How do I read the current core clock speed from the SOC

Posted: Tue May 03, 2016 7:53 am
by ghans
Is think the only stable , userspace interface you get is the virtual "cpufreq" files
in sysfs. Anything else is propably just built on top of that.

Also

Code: Select all

cat /proc/cpuinfo | grep "Mhz"
ghans