// 有效记录才是获取到的知识
// 指定编译目标arm,指定交叉编译链,首次编译清除工程
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
// 指定配置文件用于编译uboot
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- (加空格)
mx6ull_14x14_ddr512_emmc_defconfig
// 编译 V=1 用于设置编译过程中信息输出级别
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j12
u-boot是裸机程序,需要添加头部数据(IVT、DCD数据)才可在I.MX6U上执行
内存操作命令
1.md用于显示内存值
md[.b,.w,.l]address[# of objects]
2.nm 用于修改内存值
nm[.b,.w,.l]address
3.mm 自增地址已修改值
4.mw 用于填充一段内存使用指定数据
mw [.b, .w, .l] address value [count]
4.cp 内存拷贝命令,将DRAM数据拷贝到另一段内存
cp [.b, .w, .l] source target count
5.cmp 比较命令,比较两端内存是否相当
cmp [.b, .w, .l] addr1 addr2 count
网络操作命令
需要设置的网络环境变量
ipaddr | 开发板IP地址 |
ethaddr | 开发板MAC地址 |
gatewayip | 网关地址 |
netmask | 子网掩码 |
serverip | 服务器IP地址 |
1.ping 只能主动其他设备,不能主动接收其他设备的ping,uboot无此处理
2.dhcp 用于获取IP
3.nfs 网络文件系统
nfs [loadAddress] [[hostIPaddr:]bootfilename]
4.tftp 和nfs相似,使用tftp协议下载数据
tftpboot [loadAddress] [[hostIPaddr:]bootfilename]
EMMC和SD卡操作
mmc info - display info of the current MMC device
mmc read addr blk# cnt
mmc write addr blk# cnt
mmc erase blk# cnt
mmc rescan //扫描MMC设备
mmc part - lists available partition on current mmc device // 列出MMC设备分区
mmc dev [dev] [part] - show or set current mmc device [partition]
// 切换MMC设备
mmc list - lists available devices
mmc hwpartition [args...] - does hardware partitioning // 设置MMC分区
arguments (sizes in 512-byte blocks):
[user [enh start cnt] [wrrel {on|off}]] - sets user data area attributes
[gp1|gp2|gp3|gp4 cnt [enh] [wrrel {on|off}]] - general purpose partition
[check|set|complete] - mode, complete set partitioning completed
WARNING: Partitioning is a write-once setting once it is set to complete.
Power cycling is required to initialize partitions after set to complete.
mmc bootbus dev boot_bus_width reset_boot_bus_width boot_mode
- Set the BOOT_BUS_WIDTH field of the specified device
mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>
- Change sizes of boot and RPMB partitions of specified device
mmc partconf dev boot_ack boot_partition partition_access
- Change the bits of the PARTITION_CONFIG field of the specified device
mmc rst-function dev value // 复位MMC设备
- Change the RST_n_FUNCTION field of the specified device
WARNING: This is a write-once field and 0 / 1 / 2 are the only valid values.
mmc setdsr <value> - set DSR register value // 设置DSR寄存器值
在uboot中更新uboot
mmc dev 1 0 //切换到 EMMC 分区 0
tftp 80800000 u-boot.imx //下载 u-boot.imx 到 DRAM
mmc write 80800000 2 32E //烧写 u-boot.imx 到 EMMC 中,前两个块储存分区表 32E为下载的u-boot.imx/512得到的块大小
mmc partconf 1 1 0 0 //分区配置,EMMC需要此步,SD卡可不用
FAT格式文件系统操作
1.fatinfo 查询指定MMC设备分区的文件系统信息
fatinfo <interface> [<dev[:part]>]
2.fatls 查询FAT格式设备的目录和文件信息
fatls <interface> [<dev[:part]>] [directory]
3.查看MMC设备某个分区的文件系统格式
fstype <interface> <dev>:<part>
=> fstype mmc 1:0
Failed to mount ext2 filesystem...
** Unrecognized filesystem type ** // 分区0 未格式化,所以系统文件未知
=> fstype mmc 1:1
fat // 存放Linux镜像和设备树
=> fstype mmc 1:2
ext4 // 存放Linux根文件系统
4.fatload 将指定的文件读取到DRAM中
fatload <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
5.fatwrite 默认没有使能,需要手动开启
fatwrite <interface> <dev[:part]> <addr> <filename> <bytes>
EXT格式文件系统操作命令
ext2load、ext2ls、ext4load、ext4ls 和 ext4write
// 参考fat相关命令用法
启动命令
bootz、bootm 和 boot