What is config.txt?
Instead of the BIOS found on a conventional PC, Raspberry Pi devices use a configuration file called config.txt. The GPU reads config.txt before the Arm CPU and Linux initialise. Raspberry Pi OS looks for this file in the boot partition, located at /boot/firmware/.
You can edit config.txt directly from your Raspberry Pi OS installation. You can also remove the storage device and edit files in the boot partition, including config.txt, from a separate computer.
Changes to config.txt only take effect after a reboot. You can view the current active settings using the following commands:
vcgencmd get_config <config>-
displays a specific config value, for example,
vcgencmd get_config arm_freq vcgencmd get_config int-
lists all non-zero integer config options (non-zero)
vcgencmd get_config str-
lists all non-null string config options
Not all config settings can be retrieved using vcgencmd.
|
Some legacy config.txt options are no longer officially supported. These are listed in Legacy config.txt options and aren’t included in this article.
File format
The config.txt file is read by the early-stage boot firmware, so it uses a very simple file format: a single property=value statement on each line, where value is either an integer or a string. You can add comments, or comment out existing config values, by starting a line with the # character.
There is a 98-character line length limit for entries. Raspberry Pi OS ignores any characters past this limit.
Here is an example file:
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
Advanced features
include
Causes the content of the specified file to be inserted into the current file.
For example, adding the line include extraconfig.txt to config.txt will include the content of extraconfig.txt file in the config.txt file.
|
The Settings which are handled by the bootloader will only take effect if they are specified in
|
Conditional filtering
Conditional filters are covered in the conditionals section.