config.txt file description

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

Check status

Use the following command to view the current option settings:

 

file format

file format:

  1. A single statement per line, the content is an integer or a string

  2. Comment: Add # at the beginning of the line

A line of comments can be added before each statement to explain the function of the statement. The length of each line is limited to 98 characters. Content exceeding the limit will be ignored.

Common options

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

Set to disabled:

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

Set to disabled:

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

Load an overlay that enables the kernel graphics driver:

GPIO control

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

Set the same pattern of pins per line: can be a single pin, a range of pins, or a comma-separated list of pins;

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

AbbreviationFull nameMeaning
ipInputinput
opOutputoutput
a0-a5Alt0-Alt5Multiplexing
dhDriving high (for outputs)High level driving (for outputs)
dlDriving low (for outputs)Low level driving (for outputs)
puPull uppull up
pdPull downpull down
pn/npNo pullNo pull-down

Example:

illustrate

Only some of the options are listed here. For more detailed information, please go to the official website!