© Warren Gay 2018
Warren GayAdvanced Raspberry Pihttps://doi.org/10.1007/978-1-4842-3948-3_18

18. vcgencmd

Warren Gay1 
(1)
St. Catharine’s, Ontario, Canada
 

Apart from the usual Linux commands that display status, the Raspberry Pi includes a custom command named vcgencmd, which can report voltages and temperatures among other Pi specific attributes. This chapter documents the known features of the command. The executable file for the command is /usr/bin/vcgencmd.

vcgencmd Commands

There is no man page for this command, but the list of all supported options can be displayed with the commands option. The example command output shown has been broken over several lines for readability:
# vcgencmd commands
commands="vcos, ap_output_control, ap_output_post_processing,
vchi_test_init, vchi_test_exit, vctest_memmap, vctest_start,
vctest_stop, vctest_set, vctest_get, pm_set_policy,
pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging,
version, commands, set_vll_dir, set_backlight, set_logging,
get_lcd_info, arbiter, cache_flush, otp_dump, test_result,
codec_enabled, get_camera, get_mem, measure_clock, measure_volts,
scaling_kernel, scaling_sharpness, get_hvs_asserts, get_throttled,
measure_temp, get_config, hdmi_ntsc_freqs, hdmi_adjust_clock,
hdmi_status_show, hvs_update_fields, pwm_speedup, force_audio,
hdmi_stream_channels, hdmi_channel_map, display_power,
read_ring_osc, memtest, dispmanx_list, get_rsts, schmoo,
render_bar, disk_notify, inuse_notify, sus_suspend, sus_status,
sus_is_enabled, sus_stop_test_thread, egl_platform_switch,
mem_validate, mem_oom, mem_reloc_stats, hdmi_cvt,
hdmi_timings, file"
#
These have been sorted and listed in Table 18-1, summarizing what is known about them.
Table 18-1

Summary of vcgencmd Command-Line Options

Command

Arguments

Description

ap_output_control

  

ap_output_post_processing

  

arbiter

  

cache_flush

 

Flushes GPU’s L1 cache

codec_enabled

codec

Reports status of codec: one of H264 MPG2 WVC1

commands

 

Lists supported commands

disk_notify

  

display_power

0 or 1

Turns the display off or on

dispmanx_list

  

egl_platform_switch

  

file

  

force_audio

  

get_camera

  

get_config

parameter

Query configuration parameter

get_hvs_asserts

  

get_lcd_info

 

LCD/monitor width, height, and pixel depth of the display framebuffer

get_mem

arm or gpu

Get memory split between CPU (ARM) or GPU

get_rsts

  

get_throttled

  

hdmi_adjust_clock

  

hdmi_channel_map

  

hdmi_cvt

  

hdmi_ntsc_freqs

  

hdmi_status_show

  

hdmi_stream_channels

  

hdmi_timings

  

hvs_update_fields

  

inuse_notify

  

measure_clock

clock name

Measure the frequency of various clocks

measure_temp

 

Measure the temperature of the SoC

measure_volts

device name

Measure the voltage of various devices

mem_oom

 

Statistics on Out of Memory events

mem_reloc_stats

 

Relocatable memory statistics

memtest

  

mem_validate

  

otp_dump

 

Dump OTP settings

pm_get_status

  

pm_set_policy

  

pm_show_stats

  

pm_start_logging

  

pm_stop_logging

  

pwm_speedup

  

read_ring_osc

  

render_bar

 

Debug function

scaling_kernel

  

scaling_sharpness

  

schmoo

  

set_backlight

 

Reserved for future use

set_logging

level=n

Change the level of the VideoCore logger

set_vll_dir

  

sus_is_enabled

  

sus_status

  

sus_stop_test_thread

  

sus_suspend

  

test_result

  

vchi_test_exit

  

vchi_test_init

  

vcos

command

Possible commands are log, help, and version

vctest_get

  

vctest_memmap

  

vctest_set

  

vctest_start

  

vctest_stop

  

version

 

Display current build version of VideoCore firmware

Option measure_clock

This firmware access option provides the user with clock rate information, according to the argument after measure_clock . Valid values for <clock> are listed in Table 18-2.
vcgencmd  measure_clock  <clock>
Table 18-2

Valid Arguments for the measure_clock Option

Clock

Description

arm

ARM CPU

core

Core

dpi

Display Pixel Interface

emmc

External MMC device

h264

h.264 encoder

hdmi

HDMI clock

isp

Image Sensor Pipeline

pixel

Pixel clock

pwm

Pulse Width Modulation

uart

UART clock

v3d

Video 3D

vec

 
The following shell script fragment can be used to list all available clocks:
for src in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi ; do
     echo −e "$src : $(vcgencmd measure_clock $src)" ;
done
An example from the Raspberry Pi 3 B+ is shown below:
arm : frequency(45)=600000000
core : frequency(1)=250000000
h264 : frequency(28)=250000000
isp : frequency(42)=250000000
v3d : frequency(43)=250000000
uart : frequency(22)=47999000
pwm : frequency(25)=0
emmc : frequency(47)=200000000
pixel : frequency(29)=146250000
vec : frequency(10)=0
hdmi : frequency(9)=163683000
dpi : frequency(4)=0

Option measure_volts

The measure_volts option allows the various subsystem voltages to be reported:
# for id in core sdram_c sdram_i sdram_p ; do
    echo -e "$id: $(vcgencmd measure_volts $id)" ;
done
core: volt=1.2000V
sdram_c: volt=1.2500V
sdram_i: volt=1.2500V
sdram_p: volt=1.2250V
#
Table 18-3 provides a legend for the output report lines.
Table 18-3

Valid Device Names for measure_volts

Device

Description

core

Core

sdram_c

SDRAM controller

sdram_i

SDRAM I/O

sdram_p

SDRAM physical

Option measure_temp

The measure_temp option allows the user to retrieve the SoC temperature, in degrees Celsius.
$ vcgencmd measure_temp
temp=43.5 °C

In this example, the relatively idle core was reported to be 43.5°C.

Option codec_enabled

The codec_enabled option reports the operational status of the codecs supported by the Raspberry Pi. Valid codec names are listed in Table 18-4. The codec support can be summarized with the following command:
# for id in H264 MPG2 WCV1 ; do
   echo -e "$id: $(vcgencmd codec_enabled $id)";
done
H264: H264=enabled
MPG2: MPG2=disabled
WCV1: WCV1=disabled
Table 18-4

vcgencmd CODEC Names

Name

Description

H264

h.264 CODEC

MPG2

MPEG-2 CODEC

WVC1

VC1 CODEC

Option version

The version option reports the GPU firmware version:
# vcgencmd version
Apr 16 2018 18:16:56
Copyright (c) 2012 Broadcom
version af8084725947aa2c7314172068f79dad9be1c8b4 (clean) (release)

Option get_lcd_info

The get_lcd_info command provides the LCD/monitor width and height, and pixel depth of the frame buffer:
# vcgencmd get_lcd_info
1680 1050 24

Option get_config

The get_config option is useful in scripts that need to query the Raspberry Pi’s configuration, as found in /boot/config.txt. For example, a script can query whether the uart is enabled:
# vcgencmd get_config enable_uart
enable_uart=1

otp_dump

The otp_dump command will list your OTP (one time programmable) settings found within your Pi. This session is taken from a Raspberry Pi 3 B+:
# vcgencmd otp_dump
08:00000000
09:00000000
10:00000000
11:00000000
12:00000000
13:00000000
14:00000000
15:00000000
16:00280000
17:3020000a
18:3020000a
19:ffffffff
20:ffffffff
21:ffffffff
22:ffffffff
23:ffffffff
24:ffffffff
25:ffffffff
26:ffffffff
27:00001f1f
28:d4b81de4
29:2b47e21b
30:00a020d3
31:00000000
32:00000000
33:00000000
34:00000000
35:00000000
36:00000000
37:00000000
38:00000000
39:00000000
40:00000000
41:00000000
42:00000000
43:00000000
44:00000000
45:00000000
46:00000000
47:00000000
48:00000000
49:00000000
50:00000000
51:00000000
52:00000000
53:00000000
54:00000000
55:00000000
56:00000000
57:00000000
58:00000000
59:00000000
60:00000000
61:00000000
62:00000000
63:00000000
64:00000000
65:00000000
66:02009eaa
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.109.141