(轉(zhuǎn))Linkit Smart MT7688:獲取uboot、設(shè)置uboot和固件的調(diào)試打印uart端口

原貼:https://blog.csdn.net/Go_RoCo/article/details/64124263

1、獲取 MT7688 uboot

git clone https://github.com/MediaTek-Labs/linkit-smart-7688-uboot.git

參考里面說需要在linkit-smart-7688-uboot目錄下解壓buildroot-gcc342.tar.bz2文件

cd linkit-smart-7688-uboot
sudo tar jxf buildroot-gcc342.tar.bz2 -C /opt/

但是我好像不需要也是可以用的,所以看自己的使用情況吧。

2、修改uboot串口號(hào)

修改文件linkit-smart-7688-uboot\board\rt2880\serial.h

line21: #define CFG_RT2880_CONSOLE RT2880_UART3

默認(rèn)是UART3,可以字節(jié)修改為UART1/UART2.

3、uboot環(huán)境變量打印/修改(printenv,setenv,saveenv)

看的是TFTP下載uboot或者固件的時(shí)候,修改TFTP的服務(wù)器和IP地址用的,先保存下來吧。

MT7628 # printenv
bootcmd=tftp
bootdelay=1
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10" //
ipaddr=10.10.10.123   // 設(shè)備IP
serverip=10.10.10.3   // 服務(wù)器IP
stdin=serial
stdout=serial
stderr=serial

Environment size: 149/4092 bytes

MT7628 # setenv ipaddr 192.168.1.120
MT7628 # setenv serverip 192.168.1.116
MT7628 # saveenv

4、修改固件調(diào)試串口號(hào)

MT7688的openwrt固件編譯就不在這里說了,這里只是說一下修改調(diào)試串口號(hào)怎么修改。在設(shè)備樹里面修改。

MT7688:
openwrt/target/linux/ramips/dts/LINKIT7688.dts
line9:

chosen {
    bootargs = "console=ttyS2,57600";
};

MT7628:
openwrt/target/linux/ramips/dts/mt7628an.dtsi

chosen {
    bootargs = "console=ttyS0,57600";
};

看上去就知道怎么修改了吧。
ttyS2:uart3
ttyS1:uart2
ttyS0:uart1
57600就是波特率了。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容