win7 64位
首先,在Centos服务器215上面执行如下指令:
/srv/msc/ubiCreate/rootfs_to_ubi.sh
得到如下文件:
sama5d2x-rootfs.ubi
将sama5d2x-rootfs.ubi 拷贝到目录:
sudo rm ~/ArmProject/multi-serial/burnTool/xin02-Images/sama5d2x-rootfs.ubi
sudo cp /srv/msc/ubiCreate/sama5d2x-rootfs.ubi ~/ArmProject/multi-serial/burnTool/xin02-Images
sudo cp /srv/msc/ubiCreate/sama5d2x-rootfs.ubi ~/ArmProject/multi-serial/burnTool/xin02-Images
Z:\ArmProject\multi-serial\burnTool\xin02-Images>
启动板子,参考博客内另外一个文档
《sama5d2 开发板 使用(一)》
https://blog.csdn.net/wowocpp/article/details/79656380
进入烧录模式:
串口控制台打印如下内容:
进入如下目录:
Z:\ArmProject\multi-serial\burnTool\xin02-Images
cd /D Z:\ArmProject\multi-serial\burnTool\xin02-Images
执行如下命令:
Z:\ArmProject\multi-serial\burnTool\xin02-Images>Z:\ArmProject\multi-serial\burnTool\sam-ba_3.1.4-win32\sam-ba_3.1.4\sam-ba.exe -x multi_serial_rootfs.qml
中间有可能会出错,
多重复执行程序sam-ba.exe几次
其中:multi_serial_rootfs.qml 的内容如下:
import SAMBA 3.1
import SAMBA.Connection.Serial 3.1
import SAMBA.Device.SAMA5D2 3.1
AppletLoader {
connection: SerialConnection {
//port: "ttyACM0"
//port: "COM85"
//baudRate: 57600
}
device: SAMA5D2 {
config {
nandIoset: 2
nandBusWidth: 8
nandHeader: 0xc0902405
}
}
onConnectionOpened: {
// initialize NAND flash applet
appletInitialize("nandflash")
// erase all memory
//appletErase(0, connection.applet.memorySize)
//appletErase(0, 0x800000)
appletErase(0x800000, connection.applet.memorySize-0x800000)
// write files
//appletWrite(0x000000, "myd_ja5d2x-nandflashboot-uboot-3.8.7.bin", true)
//appletWrite(0x040000, "u-boot.bin")
//appletWrite(0x0c0000, "u-boot-env.bin")
//appletWrite(0x180000, "myd_ja5d2x.dtb")
//appletWrite(0x180000, "myd_ja5d2x_lcd7i.dtb")
//appletWrite(0x200000, "zImage")
// appletWrite(0x800000, "myd-ja5d2x-buildroot-qt5.ubi") //fsimage.ubi
appletWrite(0x800000, "sama5d2x-rootfs.ubi")
/*
// initialize boot config applet
appletInitialize("bootconfig")
// Use BUREG0 as boot configuration word
appletWriteBootCfg(BootCfg.BSCR, BSCR.fromText("VALID,BUREG0"))
// Enable external boot only on NFC IOSET2
appletWriteBootCfg(BootCfg.BUREG0,
BCW.fromText("EXT_MEM_BOOT,UART1_IOSET1,JTAG_IOSET1," +
"SDMMC1_DISABLED,SDMMC0_DISABLED,NFC_IOSET2," +
"SPI1_DISABLED,SPI0_DISABLED," +
"QSPI1_DISABLED,QSPI0_DISABLED"))
*/
}
}
板子原来的文件系统加载方式:
=> printenv
arch=arm
baudrate=115200
board=myd_ja5d2x
board_name=myd_ja5d2x
bootargs=root=/dev/nfs rw nfsroot=192.168.99.215:/srv/msc/rootfs,nfsvers=3 ip=192.168.99.43:192.168.99.1:255.255.255.0 console=ttyS0,115200
bootcmd=nand read 0x21000000 0x180000 0x80000;nand read 0x22000000 0x200000 0x600000;bootz 0x22000000 - 0x21000000
bootdelay=3
cpu=armv7
ethact=gmac0
serverip=192.168.99.205
soc=at91
stderr=serial
stdin=serial
stdout=serial
vendor=myir
Environment size: 471/131067 bytes
=>
设置从nfs服务器中的文件系统启动:
setenv bootargs root=/dev/nfs rw nfsroot=192.168.99.215:/srv/msc/rootfs,nfsvers=3 ip=192.168.99.43:192.168.99.1:255.255.255.0 console=ttyS0,115200
设置从nandflash启动:
setenv bootargs console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256K(env),256k(env_redundent),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs