[U-Boot] adding new command in u-boot

Haneef hawk21 haneef.hawk21 at gmail.com
Fri Mar 9 14:59:03 CET 2012


Hi,

I am trying to create a new command that would be used to do custom
tests like mm, md, mtest all at once by calling their do_** function.

So I tried to create a simple command initially to print some message
and print bdinfo in the hush:
I did the following

created a file in common/cmd_myprint.c
the file looks like this
#include <command.h>
#include <common.h>

int do_myprint(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
        printf("U-Boot Test");
        do_bdinfo(NULL, 0, 0, NULL);
        return 0;
}

U_BOOT_CMD(
        myprint,  1,      1,     do_myprint,
        "print message",
        ""
);

------------------------------

then i added this in makefile
as
COBJS-y += cmd_myprint.o

this got compiled without any problem and even  got the hush prompt
but when i gave help command i did not see my command listed there.
please help me in solving this issue.


Thanks,
haneef


More information about the U-Boot mailing list