将开发板部署开发阶段操作系统,重点掌握配置流程
准备阶段:
移植好trusted版本
ubuntu和开发板组网
将.将群里发的设备树文件和uImage镜像文件,拷贝到ubuntu中~/tftpboot目录下
使用tftp命令下载镜像文件
将ulmage下载到开发板内存中
FSMP1A> tftp 0xc2000000 uImage
成功现象
FSMP1A> tftp 0xc2000000 uImage
ethernet@5800a000 Waiting for PHY auto negotiation to complete... done
Using ethernet@5800a000 device
TFTP from server 192.168.1.250; our IP address is 192.168.1.100
Filename 'uImage'.
Load address: 0xc2000000
Loading: #################################################################
893.6 KiB/s
done
Bytes transferred = 7172048 (6d6fd0 hex)
将设备数文件下载到开发板内存中
FSMP1A> tftp 0xc4000000 stm32mp157a-fsmp1a.dtb
成功现象
FSMP1A> tftp 0xc4000000 stm32mp157a-fsmp1a.dtb
Using ethernet@5800a000 device
TFTP from server 192.168.1.250; our IP address is 192.168.1.100
Filename 'stm32mp157a-fsmp1a.dtb'.
Load address: 0xc4000000
Loading: ######
3.7 MiB/s
done
Bytes transferred = 77379 (12e43 hex)
1.在串口工具,设置bootargs参数
FSMP1A> setenv bootargs root=/dev/nfs nfsroot=192.168.1.250:/home/ubuntu/nfs/rootfs,tcp,v4 rw console=ttySTM0,115200 init=/linuxrc ip=192.168.1.100
FSMP1A> saveenv
成功现象
Saving Environment to MMC... Writing to MMC(1)... OK
2.解释bootargs参数:
root=/dev/nfs:使用nfs服务器挂载
nfsroot=192.168.1.250:/ubuntu/linux/nfs/rootfs:挂载的ip地址和路径,注意自己的路径和ip地址
tcp,v4:型号
rw :可读可写权限
console=ttySTM0:默认使用串口0
init=/linuxrc:默认启动1号进程
115200:波特率
ip=192.168.1.100 :板子的IP地址
3.启动内核
bootm 0xc2000000 - 0xc4000000
由于tft命令下载到内存中掉电丢失
每次重写上电都要重新下载
设置bootcmd参数
setenv bootcmd tftp 0xc2000000 uImage\;tftp 0xc4000000 stm32mp157a-fsmp1a.dtb\;bootm 0xc2000000 - 0xc4000000
saveenv
上电之后倒计时结束后自动下载 启动内核