树莓派的/boot/config.txt详解

 原文:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=1920
framebuffer_height=1080

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=1
hdmi_mode=31
hdmi_ignore_edit=0xa5000080

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio :loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
start_x=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
dtoverlay=vc4-fkms-v3d
dtoverlay=ov5647
# Run as fast as firmware / board allows
arm_boost=1


[all]
enable_uart=1
gpu_mem=128

生效内容解释:

framebuffer_width=1920
framebuffer_height=1080

framebuffer_width、framebuffer_height:这些设置指定帧缓冲区的宽度和高度,帧缓冲区是Raspberry Pi使用的虚拟屏幕。1920和1080的值表示1920x1080像素的分辨率。

hdmi_force_hotplug=1

hdmi_force_hotplug:启用此设置可确保始终检测到hdmi显示器,即使它在启动时最初未连接。

hdmi_group=1
hdmi_mode=31
hdmi_ignore_edit=0xa5000080

hdmi_group和hdmi_mode:这些设置允许您强制使用特定的hdmi模式。在这种情况下,启用hdmi_group=1和hdmi_mode=31,这对应于60Hz下分辨率为1920x1080的DMT(计算机监视器)模式。

dtparam=i2c_arm=on,i2c_arm_baudrate=400000

dtparam=i2c_arm=on,i2c_arm_baudrate=400000:这将启用i2c接口并将波特率设置为400kHz。

dtparam=spi=on

dtparam=spi=on:这将启用spi接口。

dtparam=audio=on

启用此选项可使Raspberry Pi利用其内置的音频功能。启用音频后,如果Raspberry Pi连接到具有内置扬声器或音频输出支持的显示器,您应该能够通过3.5毫米音频插孔或HDMI播放音频。

默认情况下,“snd_bcm2835”模块处理Raspberry Pi上的音频输出,当在配置文件中设置dtparam=audio=on时,应自动加载该模块。

start_x=1

start_x=1:此设置允许加载检测到的摄像头的覆盖,允许Raspberry Pi自动配置和使用连接的摄像头。

display_auto_detect=1

display_auto_detect=1:此设置允许加载检测到的DSI显示器的覆盖,允许Raspberry Pi自动配置和使用连接的DSI显示器。

max_framebuffers=2

max_framebuffers=2:此参数指定可以创建的最大帧缓冲区数。帧缓冲区用于存储屏幕图像的内容。在这种情况下,它被设置为2,表示Raspberry Pi最多可以创建两个帧缓冲区。

arm_64bit=1

arm_64bit=1:此设置使Raspberry Pi能够在64位模式下运行,如果您使用兼容版本的操作系统,则可以充分利用64位arm架构。

disable_overscan=1

disable_overscan=1:启用此选项将禁用已启用过扫描的显示器的过扫描补偿。过扫描补偿调整显示区域,以确保整个图像在屏幕上可见。通过将其设置为1,过扫描补偿被关闭。

otg_mode=1

此部分包含仅适用于Raspberry Pi计算模块4的特定设置或配置。otg_mode=1表示启用主机模式,允许USB端口充当主机,这意味着您可以将键盘、鼠标和其他外围设备等USB设备连接到Raspberry Pi计算模块4。

dtoverlay=vc4-fkms-v3d
dtoverlay=ov5647
# Run as fast as firmware / board allows
arm_boost=1

此部分包含仅适用于Raspberry Pi 4的特定设置或配置。

dtoverlay=vc4-fkms-v3d:这一行启用了用于Raspberry Pi 4图形渲染的vc4 fkms v3d驱动程序。

dtoverlay=ov5647:此行加载ov5647相机模块的覆盖,指示其存在或使用。

arm_boost=1:启用此设置可以使Raspberry Pi以固件和主板允许的速度运行,从而提高性能。

enable_uart=1
gpu_mem=128

enable_uart=1:此设置启用uart(通用异步收发器)接口,该接口通常用于串行通信。

gpu_mem=128:此设置为gpu使用分配128MB的系统内存。根据您对GPU密集型应用程序的特定需求和要求,调整此值可能很有用。

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xiaokanshijie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值