日韩精品成人无码专区免费-国产99久久久久久免费看-国产精品丝袜久久久久久不卡-国产精品无码一区二区三区

圖像識別DM8127開發攻略——UBOOT的移植說明

發布時間:2024-01-24 點擊:181
系統運維
圖像識別dm8127開發攻略——uboot的移植說明根據前幾篇文章的介紹,想必大家對dm8127軟件架構有了全局的認識,下面我們從開發的角度進行裁剪移植最基本的boot軟件包,嵌入式開發人員拿到一個新的板子,就是要如何讓板子能跑得起自己編譯和移植的程序,這才有價值,否則直接拿別人的bin文件直接燒寫到板子上沒啥意思。
一、dm8127 uboot編譯說明
dm8127 的uboot的版本是u-boot-2010.06, uboot代碼 和 以前的dm6446-dm368-dm3730平臺稍微不同,以前的dm6446-dm368分離ubl和uboot兩個軟件包,dm3730 分離出xloadr和uboot兩個軟件包,而現在的dm8127是一個uboot軟件包,里面包含了ubootmin和uboot,通過宏來編譯得到不同的bin文件,這里有3個大的宏來區分不同的編譯模式。編譯ubootmin 和 uboot命令和腳本見《圖像識別dm8127開發攻略——rdk軟件架構淺析及編譯》提到的總makefile和u-boot文件夾對應的u-boot\\\\makefile文件第3320行開始看 ti8148_ipnc_config,同時也要結合看include/configs/ti8148_ipnc.h。
a、#define config_ti814x_min_config
編譯得到ubootmin(u-boot.min.nand 或者 mlo);
對應rdk總的makefile編譯腳本:
ubootmin:
$(make) ubootclean
$(make) ubootbuild make_target=$(platformcfg)$(system_cfg)min$(binary_mode)
$(make) ubootbuild make_target=u-boot.ti
ifeq ($(binary_mode),sd)
cp $(ubootdir)/u-boot.min.$(binary_mode) $(tftp_home)/mlo
cp $(ubootdir)/u-boot.min.$(binary_mode) $(ubootdir)/mlo
else
cp -f $(ubootdir)/u-boot.min.$(binary_mode) $(tftp_home)/u-boot.min.$(binary_mode)
cp -f $(ubootdir)/u-boot.min.$(binary_mode) $(ubootdir)/u-boot.min.$(binary_mode).bk
cp -f $(ubootdir)/u-boot.min.$(binary_mode) /tftpboot/dm8127_min.bin
endif
我們的build_1_uboot-min-nand.sh就是調用上面的腳本執行else這種模式,得到u-boot.min.nand(dm8127_min.bin),這個是針對nand flash的情況,是要燒寫到板子nand flash上面的。
而我們的build_1_uboot-min-sd.sh也是調用上面的腳本執行ifeq ($(binary_mode),sd),得到mlo,工廠生產,軟件調試,最需要這個文件,因為剛做出來的板子nand 是沒有程序的,需要把這個mlo文件和后面編譯總的u-boot得到的u-boot.bin一起copy到sd卡(tf卡)。
b、#define config_ti814x_opti_config
編譯得到u-boot.opti.nand這個也是類似ubootmin的宏編譯,只不過編譯得到的bin文件是通過串口下載到板子上啟動。
對應rdk總的makefile編譯腳本:
ubootopti:
$(make) ubootclean
$(make) ubootbuild make_target=$(platform_cfg)_ipnc_opti_nand
$(make) ubootbuild make_target=u-boot.ti
cp $(ubootdir)/u-boot.opti.nand $(tftp_home)/u-boot.opti.nand
我們的build_1_uboot-min-opt.sh就是調用到這個腳本執行,得到u-boot.opti.nand,這個是通過pc端的串口軟件下載到板子上面去,有些產品設計的時候,由于特殊原因沒有sd卡,那么可以使用這種模式去軟件調試新生產出來的板子。編譯這種模式要注意修改u-boot/include/configs/ti8148_ipnc.h這個文件,把很多沒用的功能屏蔽掉,比如:
#undef config_cmd_bdi
#undef config_gzip
#undef config_zlib
#undef config_cmd_loadb
#undef config_cmd_loads
#undef config_cmd_nfs
#undef config_cmd_setgetdcr
#undef config_cmd_ximg
#undef config_cmd_misc
#undef config_cmd_itest
#undef config_cmd_fpga
#undef config_cmd_editenv
#undef config_bootm_netbsd
#undef config_bootm_rtems
#undef config_cmd_misc
#undef config_cmd_imi
#undef config_cmd_itest
#undef config_cmd_source
#undef config_cmd_imls
#undef config_cmd_echo
使用#undef裁剪u-boot的功能,保留網絡功能和nand功能,如果不裁剪,得到的u-boot.opti.nand過大,是不能在dm8127片內的ram運行的,u-boot.opti.nand和上面提到的mlo都是在dm8127片內的ram運行,因為外存ddr3都還沒初始化!
那么軟件調試新生產出來的板子時,給板子選定串口boot模式(nand沒程序就是自動默認其他boot模式),上電,按下圖使用串口工具比如securecrt,選擇編譯得到的u-boot.opti.nand,如果串口穩定,一般下載100%%u6b63常,回車進入熟悉的u-boot命令行模式。
上圖有時使用x modem 傳輸文件不成功,可以再使用ymodem模式,波特率使用115200。
c、如果config_ti814x_min_config和config_ti814x_opti_config都沒有選上,那么就是編譯正常的uboot,得到u-boot.bin(dm8127_uboot.bin)
對應rdk總的makefile編譯腳本:
ubootbin:
$(make) ubootclean
$(make) ubootbuild make_target=$(platformcfg)$(system_cfg)config$(binary_mode)
$(make) ubootbuild make_target=u-boot.ti
cp -f $(ubootdir)/u-boot.bin $(tftp_home)/u-boot.bin
cp -f $(ubootdir)/u-boot.bin $(ubootdir)/dm8127_uboot.bin.bk
cp -f $(ubootdir)/u-boot.bin /tftpboot/dm8127_uboot.bin
我們的build_2_uboot-all.sh就是調用上面的腳本,第一次編譯正常的uboot必須使用ubootclean,還有我們的build_2_uboot-tmp.sh是上面的腳本把$(make) ubootclean去掉,在第一次編譯build_2_uboot-all.sh后,后面修改源碼某個文件,我們不需要每次都調用ubootclean,再重新對所有的文件編譯,太浪費時間。
提示:上面3種大的宏編譯模式,一定要結合rdk總makefile和u-boot文件夾對應的u-boot\\\\makefile文件第3320行開始的內容來理解。
二、uboot的裁剪和移植
1、 修改u-boot\\\\makefile
以前寫過的其他davinci平臺開發攻略都說過,第一步就是刪除不相關的文件,這樣才好理解這個dm8127平臺有哪些相關的文件和文件夾,哪些是不相關的,一目了然。
subdirs = tools \\\\
#examples/standalone \\\\ (屏蔽,不要)
#examples/api (屏蔽,不要)
…….
#libs = api/libapi.a (屏蔽)
2、回到u-boot目錄下,把nand_spl和onenand_ipl文件夾去掉。
域名隱私保護如何關閉
.vip域名可以備案了嗎
瑞數Bot管理入選華為云聯營商品,助力云上安全發展
沒收到你們的提醒就把我的主機關閉了暈死你們至少要提醒一下啊靠
干貨分享!自建站內容排版工具知多少
剛買的云服務器如何用
最新!60個信息流廣告平臺數據榜單!
小程序云服務器買多大的