命令行

一、参考例子:

  uboot-2010.06

二、uboot/include/configs/board_name.h

  增加#define CONFIG_CMD_USR

三、uboot/common/Makefile

  增加COBJS-$(CONFIG_CMD_USR) +=cmd_usr.o

四、uboot/common/

  增加cmd_usr.c

五、cmd_usr.c书写格式

  

 1 #include <common.h>
 2 #include <command.h>
 3 
 4 int do_cmdusr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 5 {
 6       //自己实现的功能:例如tftp等下载、数据校验  
 7 }
 8 
 9 U_BOOT_CMD(
10     cmdusr,    3,    0,    do_cmdusr,
11     "cmdusr- user cmd\n",
12     " - this is cmd, Contains the following steps:\n"
13     " - 1...\n"
14     " - 2...\n"
15     " - 3...\n"
16     " - 4...\n"
17 );
View Code

 

posted @ 2017-04-26 18:22  扑克face  阅读(345)  评论(0编辑  收藏  举报