天天看点

uboot新手入门

一.编译U-boot

1.通过smb服务器将uboot_tiny6410拷贝到linux下 2.解压缩  tar xvzf uboot_tiny6410.tar.gz 3.配置打开顶层makefile 搜索6410可以找到tiny6410_config.然后make tiny6410_config 4.编译 make ARCH=arm CROSS_COMPILE=arm-linux-(不需要填gcc) 5.查看是否生成uboot.bin文件 6烧写     二.U-Boot命令 1.帮助命令     help   -- 查看当前单板所支持的命令 2环境变量     printenv -- 查看当前环境变量     setenv    -- 添加、修改、删除环境变量  使用:添加、修改   setenv + 变量名 + 值   删除   setenv  变量名     saveenv  -- 保存环境变量到nandflash中 3.文件下载     tftp -- 通过网络下载文件     配置   :                         setenv ipaddr 192.168.0.3 (开发板的IP)                     setenv serverip 192.168.0.2   (tftp服务器的IP即Linux IP)                     setenv ethaddr 12:34:56:78:9A:BC  (开发板物理地址)                       ping 192.168.0.2 (检查开发板网络是否设置好)       下载:       这里的是通过MMU虚拟后的地址                     TQ210:    tftp 0xc0008000 uImage                     Smart210:  tftp 0x20000000 uImage                     OK210:     tftp 0xc0008000 uImage                     OK6410:    tftp 0xc0008000 uImage                     Tiny6410:   tftp 0xc0008000 uImage                     TQ2440:    tftp 0x31000000 uImage                     Mini2440:   tftp 0x31000000 uImage       4.执行程序     bootm {addr} {arg}  执行固定格式的2进制程序   5.内存操作     md --显示内存内容     mm -- 修改内存内容   使用: mm  addr    6.nand flash操作     nand erase {start  addr} {len}  -- 擦出nand flash  start addr -- 要擦出的起始地址 len --擦出的长度   在往内存写之前必须先擦出。       nand write {memory addr} {flash addr} {len} --向nand flash 写入内容  memory addr -- 内容的源地址   flash addr -- 内容的目的地址   len -- 写的长度       nand read     {memory addr} {flash addr} {len} --从nand flash 读取内容  memory addr -- 内容的目的地址   flash addr -- 内容的源地址   len -- 写的长度   7.设置自启动     设置从nand flash 自启动:             setenv bootcmd nand read c0008000(虚拟内存地址) 400000 (映像文件的起始地址) 500000(读取长度为5M) \; (\;前后都必须有空格)bootm c0008000             saveenv;          设置自动下载内核到内存后启动     setenv bootcmd tftp c0008000(保存下载的内核的起始地址) uImage.bin(要下载的内核文件名) \; bootm c0008000     saveenv;           

转载于:https://www.cnblogs.com/czy478475977/p/5011666.html

继续阅读