Skip to content

vcgencmd: Document pmic_read_adc and measure_temp pmic, fix exit status - #220

Merged
pelwell merged 1 commit into
raspberrypi:masterfrom
manunicholasjacob:vcgencmd-man-pmic-exit-status
Oct 14, 2026
Merged

pelwell merged 1 commit into
raspberrypi:masterfrom
manunicholasjacob:vcgencmd-man-pmic-exit-status

Conversation

@manunicholasjacob

@manunicholasjacob manunicholasjacob commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The vcgencmd(1) man page has no entry for the Raspberry Pi 5 pmic_read_adc command or the pmic argument of measure_temp, and its EXIT STATUS section lists -1 ("Problem with VHCI") and -2, which a shell never sees.

Changes (vcgencmd/vcgencmd.1 only):

  • measure_temp [pmic]: on Raspberry Pi 5, measure_temp pmic returns the PMIC temperature.
  • New pmic_read_adc [channel] entry: what it lists, how to read one channel, what happens with an unknown name, and that USB and other loads on the 5V supply are not included (same wording as the power supplies page of the documentation).
  • mem_oom and mem_reloc_stats: not available on Raspberry Pi 5. This is the explanation given in vcgencmd mem_reloc_status: "Command not registered" #137 (Pi 5 has no relocatable heap); the man page now says so for anyone who gets "Command not registered".
  • EXIT STATUS: main() returns the firmware error value and mbox_open() calls exit(-1), so the shell sees the low 8 bits: both a mailbox open failure and an unknown command exit with 255.
  • Typos: occuring, curent.

Checked on a Raspberry Pi 5 Model B Rev 1.0, firmware 2025/03/19 cec1d3ae, raspi-utils-core 20250314-1 (exit codes captured without a pipe):

$ vcgencmd measure_temp
temp=44.4'C
$ vcgencmd measure_temp pmic
temp=42.8'C
$ vcgencmd pmic_read_adc EXT5V_V
     EXT5V_V volt(24)=5.07190000V
$ vcgencmd pmic_read_adc            # 26 lines, exit 0
$ vcgencmd pmic_read_adc bogus      # same 26 lines, exit 0
$ vcgencmd mem_oom; echo $?
vc_gencmd_read_response returned -1
error=1 error_msg="Command not registered"
255
$ vcgencmd mem_reloc_stats; echo $?     # same output
255
$ sudo -u nobody vcgencmd version; echo $?
Can't open device file: /dev/vcio
Try creating a device file with: sudo mknod /dev/vcio c 100 0
255

groff -t -man -Tascii -ww vcgencmd/vcgencmd.1 (groff 1.23.0) and man -l render it with the same single warning as master (the existing get_throttled bit table at line 80).

AI disclosure: drafted with AI assistance (Claude); each statement was checked against the vcgencmd source and the Pi 5 output above.

Add the Raspberry Pi 5 pmic_read_adc command and the pmic argument of
measure_temp, note that mem_oom and mem_reloc_stats are not available on
Raspberry Pi 5, and fix two typos.

The EXIT STATUS section listed -1 (VHCI) and -2, which a shell never sees.
vcgencmd exits with the low 8 bits of the error value, so both a mailbox
open failure and a firmware error such as "Command not registered" exit
with status 255.

Signed-off-by: Manu Nicholas Jacob <manunicholasjacob@gmail.com>
@pelwell
pelwell merged commit 7d64443 into raspberrypi:master Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants