FreeRTOS_CLIRegisterCommand not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

FreeRTOS_CLIRegisterCommand not working

1,030件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

787件の閲覧回数
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...

787件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Thanks for sharing your idea.

Regards

Daniel

0 件の賞賛
返信

787件の閲覧回数
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 件の賞賛
返信