public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] adding new command in u-boot
@ 2012-03-09 13:59 Haneef hawk21
  2012-03-09 15:19 ` Anatolij Gustschin
  0 siblings, 1 reply; 2+ messages in thread
From: Haneef hawk21 @ 2012-03-09 13:59 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] adding new command in u-boot
  2012-03-09 13:59 [U-Boot] adding new command in u-boot Haneef hawk21
@ 2012-03-09 15:19 ` Anatolij Gustschin
  0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2012-03-09 15:19 UTC (permalink / raw)
  To: u-boot

Hi,

On Fri, 9 Mar 2012 19:29:03 +0530
Haneef hawk21 <haneef.hawk21@gmail.com> wrote:

> 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.

Can't you just put needed commands in a script and run it?

...
> U_BOOT_CMD(
>         myprint,  1,      1,     do_myprint,
>         "print message",
>         ""
> );
...
> 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.

Try to pass a help string as the sixth argument of U_BOOT_CMD().

BR,
Anatolij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-09 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 13:59 [U-Boot] adding new command in u-boot Haneef hawk21
2012-03-09 15:19 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox