uboot添加命令

来源:互联网 发布:美国硅谷软件学院 编辑:程序博客网 时间:2024/05/17 22:18

添加一个简单的命令,yinming,打印helloworld


1 common/yinming.c

/* * Command for accessing DataFlash. * * Copyright (C) 2008 Atmel Corporation */#include <common.h>static int do_yinming(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){printf("hello world\n");return 1;}U_BOOT_CMD(yinming, 2,1, do_yinming,"yinming make uboot cmd exercise","yinming make uboot cmd exercise");


2 common/Makefile

# commandCOBJS-$(CONFIG_CMD_YINMING) += cmd_yinming.o COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o


3 include/configs/配置文件.h


/*********************************************************** * Command definition ***********************************************************/#include <config_cmd_default.h>#define CONFIG_CMD_YINMING 1 #define CONFIG_CMD_PING

4 重新编译uboot


OK

0 0
原创粉丝点击