config.txt file description

config.txt is a startup configuration file unique to the Raspberry Pi system, located on the first (boot) partition of the SD card and read by the GPU before initializing the ARM CPU and Linux.

View Status

Use the following command to view the current option settings:

File Format

File Format:

  1. Single statement per line, the content is an integer or string
  2. Comment: Add # at the beginning of the line

You can add a line of comments before each statement to explain the statement function. The length of each line is limited to 98 characters. The content exceeding the limit will be ignored.

Common options

When this setting is enabled, the firmware will automatically load overlays for CSI cameras it recognizes.

Set to disabled:

When this setting is enabled, the firmware will automatically load overlays for DSI displays it recognizes.

Set to disable:

Used to load and configure device tree overlays. By configuring dtoverlay, users can add additional hardware support or features to the Raspberry Pi system.

Load an overlay that enables kernel graphics drivers:

GPIO Control

Set GPIO pins to specific modes and values at boot time without using custom files.

Each line sets pins with the same mode: can be a single pin, a pin range, or a comma-separated list of pins;

The pin settings are followed by one or more comma-separated properties.

AbbreviationFull nameMeaning
ipInput 
opOutput 
a0-a5Alt0-Alt5Multiplexing
dhDriving high (for outputs) 
dlDriving low (for outputs) 
puPull up 
pdPull down 
pn/npNo pull 

Example:

Description

Only some options are listed here, please visit the official website for more detailed information!