一、配置tftp服务器
可以使用任意的tftp服务器,先编译好uboot、kernel和rootfs。将编译好的相关文件拷贝到tftp服务器目录下。
二、参数配置单板上电后,敲任意键进入u-boot。设置serverip(即tftp服务器的ip)、ipaddr(单板ip)和ethaddr(单板的MAC地址)。
setenv serverip xx.xx.xx.xx setenv ipaddr xx.xx.xx.xx setenv ethaddr xx:xx:xx:xx:xx:xx setenv netmask xx.xx.xx.xx setenv gatewayip xx.xx.xx.xx ping serverip(确保网络畅通)三、烧写映像文件到SPI Nor Flash以32MBSPI Nor Flash为例。地址空间说明:
1MB11MB19MB1MBboot_image.binkernelrootfssample.bin以下的操作均基于图示的地址空间分配。
1.烧写u-boot
sf probe 0 mw.b 0x42000000 0xff 0x100000 tftp 0x42000000 boot_image.bin sf probe 0 sf erase 0 0x100000 sf write 0x42000000 0 0x100000 rese2.烧写内核
mw.b 0x42000000 0xff 0xb00000 tftp 0x42000000 uImage_ss928v100 sf probe 0 sf erase 0x100000 0xb00000 sf write 0x42000000 0x100000 0xb000003.烧写文件系统
mw.b 0x42000000 0xff 0x1300000 tftp 0x42000000 rootfs_ss928v100_64k.jffs2 sf probe 0 sf erase 0xc00000 0x1300000 sf write 0x42000000 0xc00000 0x13000004.烧写LiteOS镜像(可选)
mw.b 0x42000000 0xff 0x100000 tftp 0x42000000 sample.bin sf probe 0 sf erase 0x1f00000 0x100000 sf write 0x42000000 0x1f00000 0x1000005.设置启动参数
setenv bootargs mem=512M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2 mtdparts=sfc:1M(boot),11M(kernel),19M(rootfs),1M(sample.bin);sa setenv bootcmd sf probe 0;sf read 0x44000000 0x1f00000 0x100000;go_riscv 0x44000000; sf read 0x50000000 0x100000 0xb00000;bootm 0x50000000;sa 无LiteOS时: setenv bootargs mem=512M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=jffs2 mtdparts=sfc:1M(boot),11M(kernel),19M(rootfs) ;sa setenv bootcmd sf probe 0; sf read 0x50000000 0x100000 0xb00000;bootm 0x50000000;sa四、烧写映像文件到NAND Flash以64MB NAND Flash为例。地址空间说明:
1
MB11MB32MB1MBboot_image.binkernelrootfssample.bin以下的操作均基于图示的地址空间分配。
1. 1.烧写u-boot
mw.b 0x42000000 0xff 0x100000 tftp 42000000 boot_image.bin nand erase 0 0x100000 nand write 0x42000000 0 0x100000 reset2.烧写内核
mw.b 0x42000000 0xff 0xb00000 tftp 0x42000000 uImage_ss928v100 nand erase 0x100000 0xb00000 nand write 0x42000000 0x100000 0xb000003.烧写文件系统
mw.b 0x42000000 0xff 0x2000000 tftp 0x42000000 rootfs_ss928v100_2k_128k_32M.ubifs nand erase 0xc00000 0x2000000 nand write 0x42000000 0xc00000 0x20000004.烧写LiteOS镜像(可选)
mw.b 0x42000000 0xff 0x100000 tftp 0x42000000 sample.bin nand erase 0x2c00000 0x100000 nandwrite 0x42000000 0x2c00000 0x1000005.设置启动参数
setenv bootargs mem=512M console=ttyAMA0,115200 clk_ignore_unused ubi.mtd=2 root=ubi0:ubifs rootfstype=ubifs rw mtdparts=nand:1M(boot),11M(kernel),32M(rootfs.ubifs),1M(sample);sa setenv bootcmd nand read 0x44000000 0x2c00000 0x100000;go_riscv 0x44000000;nand read 0x50000000 0x100000 0xb00000;bootm 0x50000000;sa 无LiteOS时: setenv bootargs mem=512M console=ttyAMA0,115200 clk_ignore_unused ubi.mtd=2 root=ubi0:ubifs rootfstype=ubifs rw mtdparts=nand:1M(boot),11M(kernel),32M(rootfs.ubifs) ;sa setenv bootcmd ;nand read 0x50000000 0x100000 0xb00000;bootm 0x50000000;sa五、烧写镜像文件到EMMC地址空间如下图所示:
1MB11MB96MB1MBboot_image.binkernelrootfssample.bin以下的操作均基于图示的地址空间分配。
1.烧写u-boot
mw.b 0x42000000 0xff 0x100000 tftp 42000000 boot_image.bin mmc write 0 0x42000000 0 0x800 reset2.烧写内核
mw.b 0x42000000 0xff 0xb00000 tftp 0x42000000 uImage_ss928v100 mmc write 0 0x42000000 0x8000x58003.烧写文件系统
mw.b 0x42000000 0xff 0x6000000 tftp 0x42000000 rootfs_ss928v100_96M.ext4 mmc write 0 0x42000000 0x60000x300004.烧写 LiteOS镜像 (可选)
mw.b 0x42000000 0xff 0x100000 tftp 0x42000000 sample.bin mmc write 0 0x42000000 0x360000x8005.设置启动参数
setenv bootargs mem=512M console=ttyAMA0,115200 clk_ignore_unused rw rootwait root=/dev/mmcblk0p3 rootfstype=ext4 blkdevparts=mmcblk0:1M(uboot.bin),11M(kernel),96M(rootfs.ext4),1M(sample);sa setenv bootcmd mmc read 0 0x44000000 0x36000 0x800;go_riscv 0x44000000;mmc read 0 0x50000000 0x800 0x5800; bootm 50000000;sa 无LiteOS时: setenv bootargs mem=512M console=ttyAMA0,115200 clk_ignore_unused rw rootwait root=/dev/mmcblk0p3 rootfstype=ext4 blkdevparts=mmcblk0:1M(uboot.bin),11M(kernel),96M(rootfs.ext4);sa setenv bootcmd mmc read 0 0x50000000 0x800 0x5800; bootm 50000000;sa六、启动新系统reset # 重启进入新系统。
免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:关于SS928评估板学习(六):烧写操作方法-关于中秋节的诗句佳句 https://www.yhzz.com.cn/a/9808.html