1. HDMI启动树莓派
2. 打开terminal串口
输入:
cat /proc/cmdline
如果不是serial=ttyAMA0,115200
就说明问题出在此处(没有配置正确)。
3. 查看cmdline.txt配置文件
cat /boot/cmdline.txt
ls -a /dev/ttyAMA0 #查看ttyAMA0
4. 覆盖config.txt
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
#dtoverlay=vc4-fkms-v3d
dtoverlay=pi3-disable-bt //停止蓝牙,解除对串口的使用
start_x=1
gpu_mem=128
5. 修改cmdline.txt文件
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
6. HDMI启动树莓派->terminal
cat /proc/cmdline #继续查看
成功!!!