add

Shashi Ranjan
  1. SysCli

This utility enhances the CLI and integrates it into the HOST environment as one. All the commands of CLI become a command on the host. Therefore, all the benefits of a native host commands becomes available to the CLI commands. It can be utilized for any Command line based interface such as Linux Shell, etc.

1.1 Features

  1. All normal CLI commands become like a host command.
  2. It does so by bypassing any terminal program.
  3. All the CLI commands are treated transparently, so you can issue commands as it is.
  4. It knows when the execution of CLI command is over.
  5. It can dump the output string of the CLI command to a pipe. This pipe can be the utilized by "grep" or any pattern matching tool to find out the result of the CLI command.
  6. Any command of CLI can be scriptized and automated.
  7. SysCli can store all the output of the commands into a file. So no manual copy and paste.
  8. SYSCLI can test the target located remotely over Ethernet.
  9. Supports XMODEM protocol. (use _sxmodem argument)

1.2 Additional Features
1. It can run the test cases on a device located remotely over Ethernet link even if there is no telnet/SSH enabled CLI available in the target board.
2. It makes it possible to run a test script on multiple targets in synchronized manner.

1.3 Components

  1. SysCli.exe: the core exe.
  2. ./help: is a folder which contains any help file apart from the document you are reading.
  3. ./ini_syscli_remote.ini: is a file, if it exists and contains the text --remote (e.g. --remote 172.28.179.73:3678), then all the command of client goes the server running at the address specified listening to the port specified. This eliminates the need of giving --remote option explicitly at the command line. If no port is specified then it will use the default port.
  4. ./profile.ini: This file contains the key and the value. All the values are surrounded by a pair of ‘=’ (equal). Users are free to modify the values accordingly. It is used by the various scripts.

1.4 Pre-Requisites

  1. A Windows PC (Currently only Windows is supported).
  2. Perl installed, with MD5SUM module
  3. ARM Compiler tool chain
  4. Cygwin (With “objdump” package)
  5. cli.c/cliDebug.c with the “call” command support in the FW.

1.5 Quick Start
Download SYSCLI from http://sourceforge.net. Unzip to it.

Open a Cygwin prompt for the folder ./syscli or change directory to syscli

1.5.1 To run a CLI command from SYSCLI
1. Run ./open38400.sh. This starts a SysCli server
2. Now run any CLI command as explained in section 3 SYSCLI Commands.

1.5.2 To Automate a Test Case
1. Make sure that the target board CLI has “call” command implemented.
2. Copy the AXF file to the current folder, the FW of which is flashed.
3. Now keep the ./Test_Sandbox*.pl files as you template and write your own.

1.5.3 To Setup SYSCLI for Remote Access
1. Run ELCI on a remote server with an IP address.
2. Now set this IP address in your local ./ini_syscli_remote.ini file.
3. Now everything remains same as if it’s being executed on the local m/c.

1.5.4 To Setup SYSCLI on single server and multiple clients
1. This method is same as mentioned in above method, except that the IP address can be set same on the other computers for the client SYSCLI.

1.5.5 To Setup SYSCLI on single server with multiple serial devices
1. Run one instance of SYSCLI with “_stay ” command. Here port is the UDP ports, not serial ports.
2. Run another instance of SYSCLI with “_stay ” command.
3. Now run all the commands with the option ./syscli –remote : for one serial device.
4. Now run all the commands with the option ./syscli –remote : for another serial device.
5. E.g. to open COM1 run ./syscli –remote 172.28.179.27:PORT1 _open COM1 115200
6. E.g. to open COM2 run ./syscli –remote 172.28.179.27:PORT2 _open COM2 115200

1.5.6 To Upgrade the SYSCLI Package
Upgrade all the folders except the file ./profile.ini, if it has been personalized to your environment.

  1. SYSCLI Architecture

Figure 1 1 SYSCLI Architecture

  1. SYSCLI Commands All the commands except _stay can take one more option --remote klzzwxh:0027klzzwxh:0028. Here ipaddress and port number denotes the IP address and port number of the SYSCLI server. If no port number is specified the default port number of the server will be used. Default port number of the server is 34529, while default client port numbers are from 34530 to 34550. All the communication uses UDP. All the commands in grey have the dependency with other entity. They either depend upon the DEBUG_SERIAL code or the bootstrap code.

3.1.1 _open
Syntax:
_open Data Bits(8)

This command opens the serial port.

3.1.2 _pause
Syntax:
_pause

It releases the serial device.

3.1.3 _resume
Syntax:
_resume

It reopens the serial device.

3.1.4 _shutdown
Syntax:
_shutdown

It closes the targeted server.

3.1.5 _stay
Syntax:
_stay port number(34529)

It runs a server listening at the port port number, if specified. If port number is not specified then it listens to a default port. It is useful when multiple instances of the server have to run on the same m/c. Each instance can be opened for a different serial device.

3.1.6 _changebaud
Syntax:
_changebaud data bits(8)

3.1.7 Sending Generic Command (requiring response)
Syntax:
[cmd] generic commands
This is used to send the commands string to the target as it is. It can optionally follow _cmd command. But it is not preferred. Do not prepend _cmd unless you command is one of the syscli commands. That is, for example, if suppose, one of the CLI commands happens to be _shutdown, then in that case it can be prepended by _cmd and sent as _cmd _shutdown. But if the command is shutdown (no ‘’ underscore), then the command can be sent as it is.
After sending the generic command, SYSCLI server waits for the response from the target. In doing so it actually waits for the ‘>’ (End Of Transmission EOT) character (again configurable by _seteotchar command) as last character. This special character is sent to the host in preparation for the new command. This gives SYSCLI a hint that the target has finished executing the previous command. SYSCLI then prepares the string sent by the target and send it to the SYSCLI client. SYSCLI client then displays this string, on the screen and exits its execution.

3.1.8 Sending Generic Command (NOT requiring response)
Syntax:
_ generic command <- Preferred method
or
_cmdendquick generic command

Note the underscore usage above and followed by a space. This command is used when you are sure that no EOT char will be sent by the target as response. Example command can be the commands which trigger the XMODEM transfers. (fdl commands). In this case SYSCLI server does not wait for the EOT character. Instead it tries to read few characters any way. It sends a success response and those few characters, to SYSCLI client. The client exits after printing those few characters.

Ex: ./syscli _ fdl 0x83 y

3.1.9 _sxmodem
Syntax:
_sxmodem
This command sends a file to the target using XMODEM protocol.

3.1.10 _seteotchar
Syntax:
_seteotchar
This command sets the EOT character of SYSCLI server. 0x3E = ‘>’.
E.g.
./syscli _seteotchar 0x3E

3.1.11 _addslashr
Syntax:
_addslashr Where option = {0, 1, 2}
This command sets the default command end character. It’s similar to the CR/LF which is sent to the terminal command to indicate a command. If option is 0, then command will end with n. If option is 1, then command will end with rn. If option is 2, then command will end with r.
E.g.
./syscli _addslashr 1 # sets limiter as rn

3.1.12 _sendhex
Syntax:
_senhex hex1 hex2 hex3…..
This command sends the series of hex characters to the serial port.
E.g.
./syscli _sendhex 0x61 0x62 0x63 0x0A # sends “abcn” to serial

3.1.13 _uploadfile
Syntax:
_uploadfile
This command uploads a file to the destination memory address


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.