zhaleksey wrote on Thursday, August 17, 2017:
I have some problem with CLI. If i have some my commands, I can call only one command.
There are some own commands.
static const CLI_Command_Definition_t TERMINAL_HAL_SPI_Commands[] = {{
.pcCommand = “HAL_SPI_Transmit”,
.pcHelpString = “HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)\n\rExample: HAL_SPI_Transmit hspi1 32 1 5\n\rHAL_OK\n\r”,
.pxCommandInterpreter = TERMINAL_HAL_SPI_Transmit,
.cExpectedNumberOfParameters = 4}
.cExpectedNumberOfParameters = 3}, {
.pcCommand = “GetSPIHandles”,
.pcHelpString = “GetSPIHandles\n\rReturn lists of the SPI handles.\n\r”,
.pxCommandInterpreter = TERMINAL_HAL_SPI_GetSPIStrHandles,
.cExpectedNumberOfParameters = 0}
};
In terminal i input:
-> GetSPIHandles
[hspi1] // Ok
-> HAL_SPI_Transmit hspi1 10 2 5
[hspi1] // Not Ok
To fix this bug I delete the “static” before “const CLI_Definition_List_Item_t *pxCommand = NULL” in function FreeRTOS_CLIProcessCommand (FreeRTOS_CLI.c).
Of course line “if( pxCommand == NULL)” can be deleted.