The Raspberry Pi boot loader uses the config.txt
file to hold configuration options relevant at boot time. It is a plain text file, resident in the DOS partition of the boot SD card, alongside RISCOS.IMG etc. (for more information on other files in the DOS partition, see Software information: Raspberry Pi: Firmware)
It should not be confused with cmdline.txt (which is used to pass parameters to RISC OS at boot time).
As stated above, config.txt is in the DOS partition of the SD card. On a standard RISC OS build using a Dual-format SD card, this can be reached by double-clicking on !Boot.Loader (i.e. shift-doubleclick on !Boot and then double-click on the file called “Loader”).
The suggested contents of config.txt are as follows:
[pi4]
enable_gic=1
[all]
arm_64bit=0
fake_vsync_isr=1
framebuffer_swap=0
gpu_mem=64
init_emmc_clock=100000000
kernel=RISCOS.IMG
ramfsfile=CMOS
ramfsaddr=0x508000
Note that the list is split1 into two parts: the “pi4” section contains options for the Pi 4 only, while the “all” section contains options applicable to all versions of Raspberry Pi (including the Pi 4). Within each section, options can appear in any order: the important thing is to make sure they are in the right section!
1 The technique of splitting the list into multiple sections is explained in detail on the Conditional filters page of the Raspberry Pi documentation.
The entries on the list have the following meanings:
enable_gic=1
arm_64bit=0
fake_vsync_isr=1
framebuffer_swap=0
framebuffer_swap=1
gpu_mem=64
init_emmc_clock=100000000
kernel=RISCOS.IMG
ramfsfile=CMOS
ramfsaddr=0x508000
2 There has already been one incident where the firmware tried to boot all kernels in 64-bit mode. Better safe than sorry.
If you’re having trouble getting HDMI sound to work, the following two entries may help:
hdmi_drive=2
hdmi_force_edid_audio=1
The following two entries are useful if you want to use the 3.5mm audio output jack instead of via the HDMI cable.
hdmi_ignore_edid_audio=1
audio_pwm_mode=2
These options are used to specify the monitor’s native pixel resolution. You might need them if you are using the AnyMode utility, if your monitor does not support EDID, or if you want the Pi to run “headless” (i.e. without a monitor attached, and with all communication via VNC or similar).
Monitor type | hdmi_group | hdmi_mode | Notes |
---|---|---|---|
1080p 60Hz television | 1 | 16 | Full HD (USA) |
1080p 50Hz television | 1 | 31 | Full HD (EUR) |
1360×768 (60Hz) | 2 | 39 | e.g. Pi-Top v1 |
1680×1050 (60Hz) | 2 | 58 | |
1920×1200 (60Hz) | 2 | 69 | |
1920×1080 (60Hz) | 2 | 82 | Full HD |
For example, to specify a screen size of 1920×1080, you would use:
hdmi_group=2
hdmi_mode=82
If your monitor size is not listed above, see this documentation page for other hdmi_mode and hdmi_group values.
The largest screen size officially supported by the Pi 1/2/3 is 1920×1200. These dimensions can be increased as follows:
max_framebuffer_width, max_framebuffer_height
hdmi_pixel_freq_limit
hdmi_cvt=2560 1440 60
hdmi_group=2
hdmi_mode=87
hdmi_drive=2
hdmi_pixel_freq_limit=250000000
max_framebuffer_width=2560
max_framebuffer_height=1440
hdmi_blanking=1
hdmi_enable_4kp60=1
hdmi_force_hotplug=1
disable_overscan=1
sdtv_mode=2
3 Putting it in the “pi4” section isn’t strictly necessary (as older models of Raspberry Pi will ignore it) but it does make it clear it is for the Pi 4 only.
The following entries may also be useful in certain circumstances:
boot_delay
bootcode_delay