RPi 3B+的config.txt部分整理

发布于 2019-04-23  148 次阅读


提醒:本文最后更新于 1126 天前,文中所描述的信息可能已发生改变,请谨慎使用!
你似乎正在查看一篇很久远的文章。
为了你这样的访客,我特地保留了我的历史博文。不要笑话过去的我,用温柔的目光看下去吧。

Reproduced from https://www.raspberrypi.org/documentation/configuration/config-txt/

Memory options

gpu_mem
GPU memory in megabytes. This sets the memory split between the CPU and GPU; the CPU gets the remaining memory. Minimum value is 16; maximum value is 192, 448, or 944, depending on whether you are using a 256M, 512MB, or 1024MB Pi. The default value is 64.

Setting gpu_mem to low values may automatically disable certain firmware features, as there are some things the GPU cannot do if it has access to too little memory. So if a feature you are trying to use isn't working, try setting a larger GPU memory split.

Using gpu_mem_256, gpu_mem_512, and gpu_mem_1024 allows you to swap the same SD card between 256MB, 512MB, and 1024MB Pis without having to edit config.txt each time:

gpu_mem_256
The gpu_mem_256 command sets the GPU memory in megabytes for the 256MB Raspberry Pi (it is ignored if memory size is not 256MB). This overrides gpu_mem. The maximum value is 192 and the default is not set.

gpu_mem_512
The gpu_mem_512 command sets the GPU memory in megabytes for the 512MB Raspberry Pi (it is ignored if memory size is not 512MB). This overrides gpu_mem. The maximum value is 448 and the default is not set.

gpu_mem_1024
The gpu_mem_1024 command sets the GPU memory in megabytes for the 1024MB Raspberry Pi 2 (it is ignored if memory size is not 1024MB). This overrides gpu_mem. The maximum value is 944 and the default is not set.

disable_l2cache
Setting this to 1 disables the CPU's access to the GPU's L2 cache, and requires a corresponding L2 disabled kernel. Default value on BCM2835 is 0. On BCM2836 and BCM2837 the ARMs have their own L2 cache and therefore the default is 1. The standard Pi kernel.img and kernel7.img builds reflect this difference in cache setting.

Licence key and codec options

Hardware decoding of additional codecs can be enabled by purchasing a licence that is locked to the CPU serial number of your Raspberry Pi.

decode_MPG2
decode_MPG2 is a licence key to allow hardware MPEG-2 decoding, e.g. decode_MPG2=0x12345678.

decode_WVC1
decode_WVC1 is a licence key to allow hardware VC-1 decoding, e.g. decode_WVC1=0x12345678.

If you have multiple Raspberry Pis and you've bought a codec licence for each of them, you can list up to eight licence keys in a single config.txt, for example decode_MPG2=0x12345678,0xabcdabcd,0x87654321. This enables you to swap the same SD card between the different Pis without having to edit config.txt each time.

GPIO control

gpio
The gpio directive allows GPIO pins to be set to specific modes and values at boot time in a way that would previously have needed a custom dt-blob.bin file. Each line applies the same settings (or at least makes the same changes) to a set of pins, either a single pin (3), a range of pins (3-4), or a comma-separated list of either (3-4,6,8). The pin set is followed by an = and one or more comma-separated attributes from this list:

  • ip - Input
  • op - Output
  • a0-a5 - Alt0-Alt5
  • dh - Driving high (for outputs)
  • dl - Driving low (for outputs)
  • pu - Pull up
  • pd - Pull down
  • pn/np - No pull

gpio settings are applied in order, so those appearing later override those appearing earlier.

Examples:

# Select Alt2 for GPIO pins 0 to 27 (for DPI24)
gpio=0-27=a2

# Set GPIO12 to be an output set to 1
gpio=12=op,dh

# Change the pull on (input) pins 18 and 20
gpio=18,20=pu

# Make pins 17 to 21 inputs
gpio=17-21=ip

The gpio directive respects the "[...]" section headers in config.txt, so it is possible to use different settings based on the model, serial number, and EDID.
GPIO changes made through this mechanism do not have any direct effect on the kernel — they don't cause GPIO pins to be exported to the sysfs interface, and they can be overridden by pinctrl entries in the Device Tree as well as utilities like raspi-gpio.

Note also that there is a delay of a few seconds between power being applied and the changes taking effect — longer if booting over the network or from a USB mass storage device.

Overclocking options

OptionDescription
arm_freqFrequency of the ARM CPU in MHz. The default value is 1400 on the Pi 3B+.
gpu_freqSets core_freq, h264_freq, isp_freq, and v3d_freq together. on Pi 3 core_freq defaults to 400 and h264_freq, isp_freq and v3d_freqdefault to 300.
core_freqFrequency of the GPU processor core in MHz. It has an impact on CPU performance because it drives the L2 cache and memory bus. The default value is 400 for the Pi 3.Note that the L2 cache benefits only the Pi Zero/Pi Zero W and Pi 1, but there is a small benefit for SDRAM on the Pi 2/Pi 3.
h264_freqFrequency of the hardware video block in MHz. Individual override of the gpu_freq setting.
isp_freqFrequency of the image sensor pipeline block in MHz. Individual override of the gpu_freq setting.
v3d_freqFrequency of the 3D block in MHz. Individual override of the gpu_freq setting.
sdram_freqFrequency of the SDRAM in MHz. The default value is 500 on the Pi3B+.
over_voltageCPU/GPU core voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. In other words, specifying -16 will give 0.8V as the GPU/core voltage, and specifying 8 will give 1.4V. For defaults see table below. Values above 6 are only allowed when force_turbo is specified: this sets the warranty bit if over_voltage_* is also set.
over_voltage_sdramSets over_voltage_sdram_c, over_voltage_sdram_i, and over_voltage_sdram_p together.
over_voltage_sdram_cSDRAM controller voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is 0 (1.2V).
over_voltage_sdram_iSDRAM I/O voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is 0 (1.2V).
over_voltage_sdram_pSDRAM phy voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is 0 (1.2V).
force_turboForces turbo mode frequencies even when the ARM cores are not busy. Enabling this may set the warranty bit if over_voltage_* is also set.
initial_turboEnables turbo mode from boot for the given value in seconds, or until cpufreq sets a frequency. For more information see here. The default value is 0, maximum value is 60.
arm_freq_minMinimum value of arm_freq used for dynamic frequency clocking. The default value is 600 for the Pi 2/Pi 3.
core_freq_minMinimum value of core_freq used for dynamic frequency clocking. The default value is 250.
gpu_freq_minMinimum value of gpu_freq used for dynamic frequency clocking. The default value is 250.
h264_freq_minMinimum value of h264_freq used for dynamic frequency clocking. The default value is 250.
isp_freq_minMinimum value of isp_freq used for dynamic frequency clocking. The default value is 250.
v3d_freq_minMinimum value of v3d_freq used for dynamic frequency clocking. The default value is 250.
sdram_freq_minMinimum value of sdram_freq used for dynamic frequency clocking. The default value is 400.
over_voltage_minMinimum value of over_voltage used for dynamic frequency clocking. The default value is 0.
temp_limitOverheat protection. This sets the clocks and voltages to default when the SoC reaches this value in Celsius. The default value is 85. Values over 85 are clamped to 85.
temp_soft_limit3B+ only. CPU speed throttle control. This sets the temperature at which the CPU clock speed throttling system activates. At this temperature, the clock speed is reduced from 1400Mhz to 1200Mhz. Defaults to 60, can be raised to a maximum of 70, but this may cause instability.

This table describes the overvoltage settings for the various Pi models. The firmware uses Adaptive Voltage Scaling (AVS) to determine the optimum voltage to set. Note that for each integer rise in over_voltage, the voltage will be 25mV higher.

VersionDefault OvervoltageSetting
Pi 31.2-1.3125V0

force_turbo
By default (force_turbo=0) the "On Demand" CPU frequency driver will raise clocks to their maximum frequencies when the ARM cores are busy and will lower them to the minimum frequencies when the ARM cores are idle.

force_turbo=1 overrides this behaviour and forces maximum frequencies even when the ARM cores are not busy.

never_over_voltage
Sets a bit in the OTP memory (one time programmable) that prevents the device from being overvoltaged. This is intended to lock the device down so the warranty bit cannot be set either inadvertently or maliciously by using an invalid overvoltage.

disable_auto_turbo
On the Pi 2/Pi 3, setting this flag will disable the GPU from moving into turbo mode, which it can do in particular load cases.



恭喜,你成功屏蔽了广告 *这是一则由 Google AdSense 自动推荐的广告,不代表本站立场