[U-Boot] cli_simple_run_command results in an unknown reference to "do_bootd" or "parse_string_outer"

Hugo Heutinck heutinck.h at gmail.com
Thu Mar 24 11:44:11 CET 2016


Hello, I was attempting to create a custom u-boot command. But I am not
able to get the
"run_command" or "cli_simple_run_command" to work.

I`m building u-boot: am335x_boneblack_defconfig

Attempting to use the "run_command" function results in:

| common/built-in.o: In function `run_command':
|
/home/xxxxx/Projects/Yocto/BeagleBoneBlack/build/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/v2015.07+gitAUTOINC+33711bdd4a-r0/git/common/cli.c:43:
undefined reference to `parse_string_outer'

Attempting to use the cli_simple_run_command, see below.

/home/xxxxx/Projects/Yocto/BeagleBoneBlack/build/tmp/work/beaglebone-poky-linux-gnueabi/u-boot/v2015.07+gitAUTOINC+33711bdd4a-r0/git/common/command.c:537:
undefined reference to `do_bootd'
scripts/Makefile.spl:214: recipe for target 'spl/u-boot-spl' failed
make[2]: *** [spl/u-boot-spl] Error 1
Makefile:1263: recipe for target 'spl/u-boot-spl' failed
make[1]: *** [spl/u-boot-spl] Error 2
Makefile:457: recipe for target '__build_one_by_one' failed
make: *** [__build_one_by_one] Error 2

The small test code is added as cmd_mytestcmd.c in the common/ directory
and in the common/Makefile  "obj-y += cmd_mytestcmd.o" is added at the end
of the file.


#include <common.h>
#include <command.h>
#include <cli.h>

#define MAX_CMD_LEN (255)

static int do_mytest(cmd_tbl_t *cmdtp, int flag, int argc, char * const
argv[])
{
        int ret = 0;
        char cmd[MAX_CMD_LEN] = "load mmc 0:1 ${loadaddr} my.env";
        ret = cli_simple_run_command(cmd, 0);
        if (ret == 0) {
            printf("OK\n");
        } else {
            printf("NOK\n");
        }


        return ret;
}

U_BOOT_CMD(
        mytestcmd,      1,      0,      do_mytest,
        "my test command",
        "");


What am I missing here ?
- Is it possible to use the run_command like this ?
- Do I need to configure any special CONFIG to enable this functionality ?
- ???


More information about the U-Boot mailing list