开发阶段部署:
一:准备文件:
uboot镜像文件(TF/EMMC)
TF_A镜像文件(TF/EMMC)
linux内核镜像文件(使用tftp服务器下载程序到开发板中)
根文件系统文件
二:使用ums命令将uboot镜像文件烧写到EMMC设备中
ums命令属于uboot中的环境变量,所以一定要使用过TF卡启动方式,uboot启动成功
ums 0 mmc 0 --------将TF卡挂载到Ubuntu中
ums 0 mmc 1 ---------将EMMC挂载到ubuntu中
烧写:
1.FSMP1A核心板和ubuntu连接
2.FSMP1A: ums 0 mmc 1
3.点击弹框将EMMC设备被Ubuntu识别 ubuntu@ubuntu:ls /dev/sd*
4.进入uboot源码目录
5.烧写镜像文件到EMMC设备
./sdtools.sh /dev/sdb
6.拨码开关调到EMMC模式,查看uboot是否启动成功,启动成功代表烧写成功
三:网络ping通
1.ubuntu设置桥接模式
2.FSMP1A> setenv serverip 192.168.1.100
FSMP1A> setenv ipaddr 192.168.1.250
FSMP1A> setenv netmask 255.255.255.0
FSMP1A> setenv gatewayip 192.168.1.1
FSMP1A> saveenv
3.通过ping命令测试开发板是否连接ubuntu成功
FSMP1A>ping 192.168.1.100
(.......is alive 成功)
四:使用tftp命令下载uImage和设备树到开发板中
1.将设备树和uImage文件拷贝到~/tftpboot文件夹下
2.在串口工具使用tftp命令下载uImage文件到开发板中
FSMP1A> tftp 0xc2000000 uImage
3.在串口工具使用tftp命令下载设备树文件到开发板中
FSMP1A> tftp 0xc4000000 stm32mp157a-fsmp1a.dtb
五:设置bootargs参数
1.FSMP1A> setenv bootargs root=/dev/nfs nfsroot=192.168.1.100:/home/ubuntu/nfs/rootfs,tcp,v4 rw console=ttySTM0,115200 init=/linuxrc ip=192.168.1.250
FSMP1A> saveenv
2.启动内核:bootm 0xc2000000-0xc4000000
六:设置bootcmd参数:
FSMP1A> setenv bootcmd tftp 0xc2000000 uImage\;tftp 0xc4000000 stm32mp157a-fsmp1a.dtb\;bootm 0xc2000000-0xc4000000
FSMP1A> saveenv