请先登录
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 yuki 于 2017-12-7 15:07 编辑
基于MT7688模块的开发笔记8——TFTP方式烧写Uboot固件
转载出自:http://blog.csdn.net/u010480899/article/details/51346954
通过TFTP方式,烧写Uboot.bin固件需要准备tftpd、SecureCRT,还要准备网线,串口线。
一、我的MT7688开发板出厂的IP地址为:192.168.1.1/24,所以给电脑设置一个同网段的静态IP地址。然后用网线将开发板的LAN与电脑的网卡连接。如果不知道开发板的IP地址,通过SecureCRT串口登录开发板,运行ifconfig可以查看板子的IP地址。
BusyBox v1.12.1 (2015-07-14 09:33:29 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
# ifconfig
br0 Link encap:Ethernet HWaddr 00:0C:43:E1:76:28
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:43ff:fee1:7628/64 Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4492 errors:0 dropped:0 overruns:0 frame:0
TX packets:3103 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:330738 (322.9 KiB) TX bytes:278487 (271.9 KiB)
二、关于SecureCRT怎样登录开发板,这个很简单了,根据厂家的说明需要设置比特率:57600;数据位:8;奇偶校验:NOne;停止位:1;串行终端长度100毫秒。同时去掉交互窗口,去掉RTS/CTS。
三、前面提到过通过虚拟机本身的文件夹共享功能实现Windows与Ubuntu的文件共享,这样在Linux中我只要将编译生成的Uboot固件放到这个文件夹中,在Windows中就可以使用该固件。于是,我在D盘建了个文件夹tftpd32,共享该文件夹,同时我的tftpd软件的文件目录也是该目录,这样在通过tftp方式烧写固件时稍微方便点了。如果某些版本的Ubuntu系统无法使用虚拟机的文件夹共享功能,可以搭建samba服务,参考上文。
四、确保电脑与开发板的IP在同一网段,准备好后就可以开始通过tftp方式烧写固件了,按下开发板上的SW1,串口出现Uboot界面如下:
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 1 2016 Time:07:58:19
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 575 MHZ ####
estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
在烧写的过程中,不要强行中断!!!!!!
这个时候请快速按下9,要是动作慢了,系统就按照原来的系统启动了,不过可以重新再来。
下面是我的操作过程:操作的过程中,需要输入板子的IP、tftp服务器的IP、Uboot文件
在烧写的过程中,不要强行中断!!!!!!
U-Boot 1.1.3 (May 1 2016 - 07:58:19)
Board: Ralink APSoC DRAM: 64 MB
relocate_code Pointer at: 83fb8000
flash manufacture id: ef, device id 40 18
find flash: W25Q128BV
*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:May 1 2016 Time:07:58:19
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 575 MHZ ####
estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
You choosed 9
.
.
.
9: System Load Boot Loader then write to Flash via TFTP.
Warning!! Erase Boot Loader in Flash then burn new one. Are you sure?(Y/N)
Please Input new ones /or Ctrl-C to discard
Input device IP (10.10.10.123) ==:192.168.1.1 #板子IP
Input server IP (10.10.10.3) ==:192.168.1.32 #TFTP服务器IP
Input Uboot filename () ==:uboot.bin #uboot文件
netboot_common, argc= 3
NetTxPacket = 0x83FE4E00
.
.
.
##################
done
Bytes transferred = 88020 (157d4 hex)
NetBootFileXferSize= 000157d4
.
.
.
Done!
五、烧写完成后,板子也会启动起来
____ _____ _ _______ ______ _____ _ ___
| \ / || ___|| __ \ | || __ ||__ __|| ___|| | / /
| ^ || |__ | | \ \| || | | | | | | |__ | |/ /
| | | || ___|| | | || || |__| | | | | ___|| \
| | | || |___ | |__/ /| || __ | | | | |___ | |\ \
|__| |___||_____||_____/ |_||_| |_| |_| |_____||_| \__\
|