Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS + CLI: Command Line Editing

Posted by Roland A.I. Rosier on February 28, 2013
Hello all,

Could I ask if anyone knows of a CLI for FreeRTOS which includes some form of Command Line Editing.

By this I mean that if someone types control characters like the "Backspace" button, that this is processed correctly by the Command Line.

I suspect that I would need at a bare minimum the ability to use Backspace on a Command Line.

RE: FreeRTOS + CLI: Command Line Editing

Posted by Jerry Durand on February 28, 2013
I've wrote my own long ago and just cut, paste, and modify as needed for each new project. Some projects need to respond to special characters so I normally need to change at least something (ex: one project uses '*' to clear the buffer and abort any ongoing operation and '~' to send binary data to a background task). One thing in common with mine is when I receive a RETURN '\r' that locks the buffer and begins whatever parsing is needed for the application. All editing like backspace and other special characters is done between my incoming ring buffer and the command buffer.

It's not really that hard, just decide what you need it to do and write it to your satisfaction.

RE: FreeRTOS + CLI: Command Line Editing

Posted by Jerry Durand on February 28, 2013
Slight correction, the special characters for abort and binary data are done in the interrupt so they're pulled from the data stream as soon as they come in. They are never even put into the buffer.

RE: FreeRTOS + CLI: Command Line Editing

Posted by Richard Damon on February 28, 2013
What I have often done for cases like this is have (small) pool of buffers, and the serial interrupt builds up the line being typed into one of them (processing backspaces and clear line commands, etc) , and on the end of line character, sends the pointer to that buffer to the waiting task, and get the next buffer. When the task is done processing the buffer, it returns it to the list of available buffers. This way there isn't a "dead time" for receiving characters after the End of Line (unless you get so far ahead that you run out of buffers). This allows the command line processor to spawn copies of itself if needed to run a long command without killing the command input stream.

RE: FreeRTOS + CLI: Command Line Editing

Posted by Richard on February 28, 2013
I think most, if not actually *all* FreeRTOS+CLI examples process the backsapce character, but that is the only special character that is processed.

Regards.

RE: FreeRTOS + CLI: Command Line Editing

Posted by Roland A.I. Rosier on March 12, 2013
Thank you all for your replies.

For information I found out what the issue was; the FreeRTOS CLI as used by the Atmel A.S.F. 3.5.1 does not fully handle backspace as sent by all potential terminal emulators.

My Windows 7 Terminal Emulator is PuTTY. When I press Backspace ('\b' or 0x08), PuTTY sends Erase (0x7F).

The Atmel A.S.F. 3.5.1 does not respond to 0x7F in any special way; it only responds to '\b' in a special way and for all other characters it echoes it back to the terminal.

PuTTY responds to receiving the echoed 0x7F by performing a destructive backspace. So it looks as though everything is fine and working.

Sadly when return is pressed, the 0x7F characters in the command string are passed through to FreeRTOS CLI and mess up the command string matching.

As a result, it appears that Backspace doesn't work when FreeRTOS CLI is asked to parse the command.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists