1、使用NFS文件系统进行开发
挂载:mount -t nfs -o nolock -o tcp -o rsize=32768,wsize=32768 192.168.2.155:/opt/rootfs_uclibc /mnt
卸载:umount /mnt
2、SPI NOR Flash烧写指令
烧写u-boot
sf probe 0
mw.b 82000000 ff 100000
tftp 0x82000000 u-boot-hi3516a.bin
sf probe 0
sf erase 0 100000
sf write 82000000 0 100000
【mw.b】mw.b表示按字节显示,内存初始化,填充内存。把内存 0x82000000 开始的 0x10000 字节设为 0xFF。
【sf probe 0】 探测并初始化SPI FLASH;
【0x82000000】内存地址
【erase】 表示从地址0擦除了1M的文件
【write】 表示从内存地址0x82000000写入1M文件
3、uboot相关参数
setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:1M(boot),3M(kernel),12M(rootfs)'
setenv bootdelay 3 /*设置启动延时为2秒*/
bootargs各参数的含义如下:
mem:设置操作系统内存大小。以上设置mem=64M表示分配给操作系统内存为64M。
console:设置控制台设备。格式为console=ttyAMA0,115200表示控制台为串口0,波特率115200。
root:设置根文件系统挂载设备。格式为root= /dev/mtdblock3表示从Flash第3个分区挂载(Flash分区编号从0开始)。
rootfstype:设置挂载文件系统类型。
mtdparts:Flash分区描述,格式为mtdparts=hi_sfc:256K(boot),3M(kernel),1M(rootfs),5M(data) //表示有4个分区,分区0大小为256用于bootloader启动,分区1大小为3M用于内核启动,分区2大小为1M用于根文件系统启动,5M为用户数据。
4、uboot指令
hisilicon # help
? - alias for 'help'
base - print or set address offset
bootm - boot application image from memory
bootp - boot image via network using BOOTP/TFTP protocol
cmp - memory compare
cp - memory copy
crc32 - checksum calculation
ddr - ddr training function
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls - list files in a directory (default /)
getinfo - print hardware information
go - start application at address 'addr'
help - print command description/usage
loadb - load binary file over serial line (kermit mode)
loady - load binary file over serial line (ymodem mode)
loop - infinite loop on address range
md - memory display
mii - MII utility commands
mm - memory modify (auto-incrementing address)
mtest - simple RAM read/write test
mw - memory write (fill)
nand - NAND sub-system
nboot - boot from NAND device
nm - memory modify (constant address)
ping - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
rarpboot- boot image via network using RARP/TFTP protocol
reset - Perform RESET of the CPU
saveenv - save environment variables to persistent storage
setenv - set environment variables
sf - SPI flash sub-system
tftp - tftp - download or upload image via network using TFTP protocol
usb - USB sub-system
usbboot - boot from USB device
version - print monitor version
hisilicon #
5、烧写类型
烧写uboot都是串口烧写方式,而tftp命令烧写为网口烧写。tftp也可以使用串口烧写,方法如下:
SecureCRT_CN 的时候 loady 0ox82000000 115200
传入-> 发送Ymodem 填写 要烧写的程序如 u-boot-nfs.bin
然后 Go 0x82000000
烧写成功
6、设置网络
ifconfig eth0 192.168.2.102 netmask 255.255.255.0
route add default gw 192.168.2.1 (会掉电丢失!)
想不掉电不丢失,则在/etc/init.d/rcS 写入:
ifconfig eth0 192.168.2.102 netmask 255.255.255.0
route add default gw 192.168.2.1
无法ping通外网
想ping通外网,则创建一个 /etc/resolv.conf
nameserver 8.8.8.8
7、tftp上传下载文件
tftp -g -r 1.mp3 192.168.151.52 从PC 传到 开发板
tftp -p -r 1.mp3 192.168.151.52 从开发板 传到 PC
8、开启telnet服务
先在开发板上开启telnetd,执行:
telnetd &
然后在虚拟机上执行:
telnet 192.168.2.102 (开发板的IP地址)
Trying 192.168.2.102...
Connected to 192.168.2.102.
Escape character is '^]'.
(none) login: root
Password:
Welcome to HiLinux.
None of nfsroot found in cmdline.
~ #
用户名为:root
密码为:空 (直接回车即可)