认识uboot

uboot案例

?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
bmode   - sd1|sd2|qspi1|normal|usb|sata|ecspi1:0|ecspi1:1|ecspi1:2|ecspi1:3|esdhc1|esdhc2|esdhc3|esdhc4 [noreset]
bmp     - manipulate BMP image data
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bootz   - boot Linux zImage image from memory
clocks  - display clocks
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dcache  - enable or disable data cache
dhcp    - boot image via network using DHCP/TFTP protocol
dm      - Driver model low level access
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
erase   - erase FLASH memory
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
ext4write- create a file in the root directory
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fatwrite- write file into a dos filesystem
fdt     - flattened device tree utility commands
flinfo  - print FLASH memory information
fstype  - Look up a filesystem type
fuse    - Fuse sub-system
go      - start application at address 'addr'
gpio    - query and control gpio pins
help    - print command description/usage
i2c     - I2C sub-system
icache  - enable or disable instruction cache
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
load    - load binary file from a filesystem
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
md      - memory display
mdio    - MDIO utility commands
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
pmic    - PMIC
printenv- print environment variables
protect - enable or disable FLASH write protection
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
save    - save file to a filesystem
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
sf      - SPI flash sub-system
showvar - print local hushshell variables
size    - determine a file's size
sleep   - delay execution for some time
source  - run script from memory
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
true    - do nothing, successfully
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version

详细解释

help

查看命令帮助信息?

bdinfo

信息查询
在这里插入图片描述

printenv

在这里插入图片描述

setenv

设置环境变量

saveenv

在这里插入图片描述

自定义环境变量

md 命令

显示内存值
md[.b,.w,.l] address [#pf objects]
在这里插入图片描述
在这里插入图片描述

nm 修改指定地址数据信息

nm[.b,.w,.l] address [#pf objects]
在这里插入图片描述

mm

内存地址会加
在这里插入图片描述

cp

内存拷贝
cp[.b,.w,.l] 源 目标 长度
在这里插入图片描述

cmp 比较内存数据

cmp[.b,.w,.l] add1 addr2 conut
在这里插入图片描述

网络操作命令

ping

主机地址设置

在这里插入图片描述

虚拟机设置

桥接模式
在这里插入图片描述
设置桥接网卡参数
在这里插入图片描述
ubuntu设置网络地址
在这里插入图片描述
开发板使用

setenv ipaddr 192.168.1.50
setenv ethaddt 00:04:9f:04:d2:35
setenv  gatewayip 192.168.1.1
setenv  netmask 255.255.255.0
setenv serverip 192.168.1.250
saveenv

然后这边就可以随便ping通了
在这里插入图片描述

dhcp

nfs

sudo apt-get install nfs-kernel-server rpcbind
sudo vi /etc/exports

打开/etc/exports 以后在后面添加如下所示内容:
/home/zuozhongkai/linux/nfs *(rw,sync,no_root_squash)
在这里插入图片描述
在这里插入图片描述

ssh

sudo apt-get install openssh-server

tftp 开发

sudo apt-get install tftp-hpa tftpd-hpa

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

emmc 和 sd卡

mmc info
在这里插入图片描述
mmc rescan
mmc list
mmc dev x 切换
mmc part
在这里插入图片描述

mmc read addr blk# cnt

mmc read 80800000 600 10
从EMMC 的第1536(0x600)个块读取 16个数据到addr处

在这里插入图片描述

mmc write addr blk# cnt

可使用升级
在这里插入图片描述
mmc 擦除一般很少用

FAT 格式文件系统操作命令

fatinfo mmc 0:1

fatls mmc 1:1
在这里插入图片描述

uboot 源码详解

在这里插入图片描述
arch\arm\cpu\u-boot.lds是整个Uboot的链接脚本
board\freescale\mx6ullevk

configs是uboot 的默认配置文件

在这里插入图片描述
在这里插入图片描述

disk 磁盘不管

drivers 驱动

dts 设备树

。。。

移植u-boot

重点关注
alientek_uboot\board\freescale
\alientek_uboot\configs

/.config
在这里插入图片描述
arch-y 是编译选项

uboot 顶层Makefile分析(太难了)

版本号

在这里插入图片描述

Makefile 编译过程

1 #!/bin/bash
2 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean

在这里插入图片描述

3 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_ddr512_emmc_de fconfig

4 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j12
在这里插入图片描述

u-boot启动过程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值