FreeRTOS_CLIRegisterCommand not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FreeRTOS_CLIRegisterCommand not working

1,087 Views
jren68
Contributor III

 I am following this tutorial and have 

1. Implemented a Command

static BaseType_t prvTaskStatsCommand( int8_t *pcWriteBuffer,

                                          size_t xWriteBufferLen,

                                          const int8_t *pcCommandString )

{

    ( void ) xWriteBufferLen;

    return pdFALSE;

}

2.  created the mapping

static const CLI_Command_Definition_t xDelCommand =

{

    "abc",

    "del <filename>: Deletes <filename> from the disk\r\n",

      prvTaskStatsCommand,

    1

};

3.  registered with FreeRTOS+CLI 

void vRegisterCLICommands( void )

{

int a = FreeRTOS_CLIRegisterCommand( &xDelCommand );

printf("hello world %i\n", a);

}

I put vRegisterCLICommands() in main and the printout is "hello world 1", indicating the registration is successful.

Then I tried

help abc

in the debug console in MCUXpresso, but abc is not there. This is what I got

Undefined command: "abc".  Try "help".

why FreeRTOS_CLIRegisterCommand is not working?

what should I do after register the command with FreeRTOS_CLI?

0 Kudos
Reply
3 Replies

844 Views
jren68
Contributor III

I figured out what's the problem...the console is the gdb console, not a shell or UART terminal that connects directly to the board...

844 Views
danielchen
NXP TechSupport
NXP TechSupport

Thanks for sharing your idea.

Regards

Daniel

0 Kudos
Reply

844 Views
jren68
Contributor III

most of the board SDK will have a shell demo, that script can be used as a console and one can call the registered functions from the shell successfully. 

0 Kudos
Reply