【DIY教程】D1哪吒开发板改成HDMI输出
-
D1哪吒开发板自带的固件和官方释放的Tina D1 v1.0.1 SDK默认都是mipi显示输出,如果需要改成HDMI输出,按场景需求,有以下三种方法:
1.开发板直接命令行切换
这种方法仅限本次开机,重启设备知乎又会重新加载DTS,变回mipi输出
命令:cd /sys/kernel/debug/dispdbg echo disp0 > name; echo switch1 > command; echo 4 10 0 0 0x4 0x101 0 0 0 8 > param; echo 1 > start;
此时开发板会改成HDMI输出,使用命令cat colorbar可以进行测试是否切换成功了:
echo 1 > /sys/class/disp/disp/attr/colorbar
详见D1在线文档:https://d1.docs.aw-ol.com/study/study_5connect/#hdmi
2.烧HDMI固件
烧写官方提供的HDMI输出固件,就会变成HDMI输出,每次开机都是
详见:https://d1.docs.aw-ol.com/source/3_getimg/
固件下载地址:https://www.aw-ol.com/downloads/resources/44
3.修改源码
如果想自己制作一个HDMI输出的固件,可以按照如下方法修改源码
(1)修改DTS文件,uboot的dts和内核的dts都要改tina/device/config/chips/d1/configs/nezha$ git diff . diff --git a/configs/nezha/linux-5.4/board.dts b/configs/nezha/linux-5.4/board.dts index bfeed6c..1cef004 100755 --- a/configs/nezha/linux-5.4/board.dts +++ b/configs/nezha/linux-5.4/board.dts @@ -1128,30 +1128,25 @@ chn_cfg_mode : Hardware DE channel allocation config. 0:single display with disp_init_enable = <1>; disp_mode = <0>; - screen0_output_type = <1>; - screen0_output_mode = <4>; - - screen1_output_type = <3>; - screen1_output_mode = <10>; - - screen1_output_format = <0>; - screen1_output_bits = <0>; - screen1_output_eotf = <4>; - screen1_output_cs = <257>; - screen1_output_dvi_hdmi = <2>; - screen1_output_range = <2>; - screen1_output_scan = <0>; - screen1_output_aspect_ratio = <8>; - - dev0_output_type = <1>; - dev0_output_mode = <4>; + screen0_output_type = <3>; + screen0_output_mode = <10>; + + screen0_output_format = <0>; + screen0_output_bits = <0>; + screen0_output_eotf = <4>; + screen0_output_cs = <257>; + screen0_output_dvi_hdmi = <2>; + screen0_output_range = <2>; + screen0_output_scan = <0>; + screen0_output_aspect_ratio = <8>; + + screen1_output_type = <1>; + screen1_output_mode = <4>; + + dev0_output_type = <4>; + dev0_output_mode = <10>; dev0_screen_id = <0>; - dev0_do_hpd = <0>; - - dev1_output_type = <4>; - dev1_output_mode = <10>; - dev1_screen_id = <1>; - dev1_do_hpd = <1>; + dev0_do_hpd = <1>; def_output_dev = <0>; hdmi_mode_check = <1>; diff --git a/configs/nezha/uboot-board.dts b/configs/nezha/uboot-board.dts old mode 100644 new mode 100755 index 793dec2..a5c99a2 --- a/configs/nezha/uboot-board.dts +++ b/configs/nezha/uboot-board.dts @@ -214,30 +214,25 @@ disp_init_enable = <1>; disp_mode = <0>; - screen0_output_type = <1>; - screen0_output_mode = <4>; - - screen1_output_type = <3>; - screen1_output_mode = <10>; - - screen1_output_format = <0>; - screen1_output_bits = <0>; - screen1_output_eotf = <4>; - screen1_output_cs = <257>; - screen1_output_dvi_hdmi = <2>; - screen1_output_range = <2>; - screen1_output_scan = <0>; - screen1_output_aspect_ratio = <8>; - - dev0_output_type = <1>; - dev0_output_mode = <4>; + screen0_output_type = <3>; + screen0_output_mode = <10>; + + screen0_output_format = <0>; + screen0_output_bits = <0>; + screen0_output_eotf = <4>; + screen0_output_cs = <257>; + screen0_output_dvi_hdmi = <2>; + screen0_output_range = <2>; + screen0_output_scan = <0>; + screen0_output_aspect_ratio = <8>; + + screen1_output_type = <1>; + screen1_output_mode = <4>; + + dev0_output_type = <4>; + dev0_output_mode = <10>; dev0_screen_id = <0>; - dev0_do_hpd = <0>; - - dev1_output_type = <4>; - dev1_output_mode = <10>; - dev1_screen_id = <1>; - dev1_do_hpd = <1>; + dev0_do_hpd = <1>; def_output_dev = <0>; hdmi_mode_check = <1>;
(2)重新编译uboot
因为单独make编译的时候默认是不编译ubootd的,所以需要编译一下uboot//进入uboot代码路径 cboot //单独编译uboot,编完uboot文件会自动复制到方案下,不用管它 muboot //重新编译打包 make -j64 pack
(3)改掉启动logo(可选)
sdk自带的启动logo是适配mipi屏幕的,在HDMI屏幕上显示会异常,所以建议改掉原SDK自带那个哪吒的启动logo,改成了linux小企鹅,大家可以把tina/device/config/chips/d1/configs/nezha/config 下面的bootlogo.bmp文件替换成下面这个文件:
bootlogo.7z完成以上几步之后,插上HDMI并启动开发板,显示器上就会输出linux小企鹅的logo了
-
。
-
@xiaowenge 可以了,赞
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号