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?
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...
Thanks for sharing your idea.
Regards
Daniel
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.