Conjur
Posts: 17
Joined: Wed Apr 06, 2016 8:55 pm

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

Mon May 02, 2016 7:16 pm

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

User avatar
Rive
Posts: 586
Joined: Sat Mar 26, 2016 5:21 pm
Location: USA

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

Mon May 02, 2016 7:24 pm

Core (GPU) or Arm (CPU)?

Arm:

Code: Select all

watch '(vcgencmd measure_clock arm)'
Core:

Code: Select all

watch '(vcgencmd measure_clock core)'
DNPNWO

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

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

Tue May 03, 2016 7:53 am

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
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Interfacing (DSI, CSI, I2C, etc.)”