U-boot是在Embeded Linux的設備用來開機時boot loader (類似桌機上BIOS的角色)
一般來說公板給的U-Boot都可以把板子帶起來,並且做一些基本的測試
以下是我常會用到指令
printenv //顯示目前設定的參數
setenv ipaddr 192.168.1.99 //設定ip為192.168.1.99
saveenv //將參數存到Flash
reset //重啟設備
md 0x22000000 //顯示0x22000000記憶體的內容
mm/nm/mw //修改0xXXXXXXXX記憶體的內容
sf read 0x22000000 0x200000 0x600000
fdt addr 0x21000000 //將0x21000000的記憶體內容載入到dts中
fdt print //將device tree的內容顯示出來
gpio status -a //查看所有gpio的狀態
gpio set XX //將XX的gpio設定為high
gpio clear XX //將XX的gpio設定為low
--- 上傳DTS並寫入到SPI flash中 ---
tftp zonda_ii.dtb
sf probe 0
sf erase 0x120000 0x20000
sf write 0x22000000 0x120000 0x20000
--- sam9x60 RamDisk開機 ---
tftp xxx-uImage
sf probe 0
sf read 0x21000000 0x120000 0x20000
bootm 0x22000000-0x21000000
--- nuc980 RamDisk開機 ---
tftp nuc980.bin
bootm 0xe0000
以下是常用的UBoot的變數- ipaddr : 設備的IP address
- serverip : TFTP server的IP address
- etheraddr : 設備的MAC address
- bootcmd : 開機進linux所要執行的指令
- bootdelay : 等待進入U-Boot的時間
沒有留言:
張貼留言