Skip to content

Latest commit

 

History

History
66 lines (41 loc) · 2.63 KB

what_is_config_txt.adoc

File metadata and controls

66 lines (41 loc) · 2.63 KB

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/.

Note
Prior to Raspberry Pi OS Bookworm, Raspberry Pi OS stored the boot partition at /boot/.

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, e.g. 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

Note
Not all config settings can be retrieved using vcgencmd.

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. Comments may be added, or existing config values may be commented out and disabled, 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.

Note

The bootcode.bin or EEPROM bootloaders do not support the include directive.

Settings which are handled by the bootloader will only take effect if they are specified in config.txt (rather than any additional included file):

  • bootcode_delay,

  • gpu_mem, gpu_mem_256, gpu_mem_512, gpu_mem_1024,

  • total_mem,

  • sdram_freq,

  • start_x, start_debug, start_file, fixup_file,

  • uart_2ndstage.

Conditional filtering

Conditional filters are covered in the conditionals section.