Adding FREERTOS-PLUS-CLI projects to the project using a pedestrian

Source: Internet
Author: User

freertos+cli An extensible Command line Interface FrameworkIntroduction

freertos+cli (Command line Interface) provides a simple, small, extensible and RAM efficient method of enabling your F Reertos application to process command line input. The steps required to add a command is shown in the clickable diagram below- Click each stage in the process in Dividually to is taken to a worked example.

The above is the official website about FREERTOS+CLI Simple Introduction, in the online search for a long time did not see the use of relevant personnel, so with the feeling began to add the source code to use the project, the following is my step experience. Development environment: System: Win7 Development Ide:coide_v2beta compiler: GNU Tools ARM embedded\4.7 2014q2 (ARM-NONE-EABI-GCC) embedded environment: STM32F103VET6
First step: First set up a simple FreeRTOS project, this is very simple, please refer to the online information.
Step two: Download the FreeRTOSV8.2.1 source code and unzip it.
Step three: Add the two files under "\freertosv8.2.1\freertos-plus\source\freertos-plus-cli" to the project. Where the header file "freertos_cli.h" to add an undefined data (this is when I compile the error found): #define CONFIGCOMMAND_INT_MAX_OUTPUT_SIZE 1000
The third step: in the "\freertosv8.2.1\freertos-plus\demo\common\freertos_plus_cli_demos" is a few use of the Demo, because I use the serial port, so use "        Uartcommandconsole.c "and" sample-cli-commands.c ", so the two files are also added to the project. Modify parameters in "uartcommandconsole.c": #define CMDQUEUE_LENGTH 1000 This data is the serial port output of the data size, as large as possible, so that the output can be complete, too small, the serial output may not be complete, This is what I found in my actual use.
Fourth step: Because I use the serial port interaction, then need the underlying hardware support, so is the hardware driver. The header file "#include" Serial.h "" was introduced in "uartcommandconsole.c". This file in the FreeRTOS of the stm32f10x in the demo has this header file and. c file implementation, directly copied over and then joined the project.
Fifth step: Press your own hardware to modify "serial.cFile 1:/* Library includes. *///#include "stm32f10x_lib.h" #include "stm32f10x_conf.h" in the 2:xserialportinitminimal () function to initialize the serial port used.
3: Modification of interrupt function//void vuartinterrupthandler (void) void Usart3_irqhandler (void)
4: Anyway in "serial.c" each function to modify according to their own hardware, it is best to check from beginning to finish, to prevent a function parameter and the use of the hardware interface may not be the same as the use of unsuccessful.
Sixth step: Include related initialization and CLI tasks in the main function. Vregistersampleclicommands ();//This function is an official provided example, can not join, if join note inside some function use need to open some rely on the macro. Vuartcommandconsolestart (1000, 1);
Seventh step: Compile no problem after downloading and PC communication, set the baud rate, and then use the official several examples to test. The test succeeds and you can add the interactive commands yourself later.
I provide my project documentation on GitHub. The following is a partial view of the project catalog:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Adding FREERTOS-PLUS-CLI projects to the project using a pedestrian

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.