BLACKSheep® V1.0.0 Command Reference

Aus BECOM Systems Support
Version vom 31. Oktober 2023, 09:03 Uhr von Peter (Diskussion | Beiträge) (1 Version importiert)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Command Reference

The commands listed below can be used with special parameters. Be aware that not all commands are available in all versions of BLACKSheep® OS.

Syntax

All commands are case sensitive.

command1 [-a][-b] means: -a or –b
command1 {filename} means: user defined value, cannot be empty
command1 {dd mm yy} means: user defined value in given format, cannot be empty
command1 <-bin> means: optional parameter
Example

The command
example <[{filename}[-a][-b]<-bin>][-h]>
can be executed in these ways:

example
example -h
example test.ldr –a
example test.ldr –b
example test.ldr –a –bin
example test.ldr –b -bin

Commands for bsboot projects

;-) <[-h][-hs]>

Prints "Hello, I am your blackfin core module" on the stdio.

Parameter Description
-h Detailed help.
-hs Short help.

cat [{filename}][[-h][-hs]]

Prints the content of the file specified to the stdio.

Parameter Description
filename File to show.
-h Detailed help.
-hs Short help.

can [-s {message}{mailbox}{interface}]
[-r {mailbox}{timeout}][-ih {mailbox}{interface}]
[-uh {mailbox}][-sh][-h][-hs]

This command provides an interface to the integrated CAN interface. Use -s to send a CAN message consisting of max. 8 characters to the mailbox. You can read a CAN message by using the switch -r and setting a read timeout[s]. If a message is received in time it is printed on stdout, otherwise an error message is printed. Further you can install a handler with -ih on the given mailboxon the given interface. Every time a CAN messages is received for the given mailbox it is printed on stdout. Execute the command with -uh to uninstall the handler. Use -sh to get a list of all installed handlers.

Parameter Description
-s Send a CAN message.
message CAN message, max 8 characters.
mailbox Mailbox number, valid numbers: 0-24.
interface CAN interface.
-r Receive a CAN message.
timeout Timeout for CAN message receive in [s].
-ih Install handler.
-uh Uninstall handler.
-sh Prints a list of all installed handlers.
-h Detailed help.
-hs Short help.

cd [{partition}:][{directory}][-h][-hs]

Changes the working directory or partition within the file system.

Parameter Description
partition Partition to be used.
directory Directory to be used.
-h Detailed help.
-hs Short help.

cp [{sourcefile}{destinationfile}<-o>][-h][-hs]

Copies a file from sourcefile to destinationfile.

Parameter Description
sourcefile Source file.
destinationfile Destination file.
-o Overwrite existing file.
-h Detailed help.
-hs Short help.

date <[{dd}{mm}{yyyy}][-h][-hs]>

Prints the current date if no parameters are set. Changes the current date if parameters are set.

Parameter Description
dd mm yyyy Date to set as current date .
-h Detailed help.
-hs Short help.

env <[-print {id}][-set {id}{variable}{value}][-save {id}]
[-clrnvm {id}][-h][-hs]>

This command provides an interface to the environment table. If the command is executed without arguments, the command prints a list of all stored environment tables. You can print a list of all declared variables in a specific environment table by executing the command with the parameter -print and the given id. Further you can change the value of a variable by using the parameter -set and then store your changes with the parameter -save. Use the parameter -clrnvm to clear a specific environment table.

Parameter Description
print Prints a list of variables stored in the given environment table e.
id ID of the environment table.
-set Sets the value of a variable in the given environment table.
variable Variable name to be changed.
value New value.
-save Save the current values for the given environment table in non volatile memory i.e. flash.
-clrnvm Clears the given environment table in non volatile memory i.e. flash.
-h Detailed help.
-hs Short help.

exec [{filename}][-h][-hs]

Loads and executes an application from a loader file compiled by VisualDSP++. The format of the file must be Intel HEX. You must consider that the processor will not reboot after loading the application and that most of the processor registers are not in reset state when your application starts! Therefore not all applications can be executed using the exec command.

Parameter Description
filename File to be executed.
-h Detailed help.
-hs Short help.

extime [{command}][-h][-hs]

Measures the execution time of a given command.

Parameter Description
command Command to be measured. i.e. ls.
-h Detailed help.
-hs Short help.

flash [{file_to_flash}[-a][-b]<-bin><-unlock><-eaf>][-rsdev]
[-rsapp][-qry][-chkempt][-lock][-unlock][-ff]
[-rssec {sectornr}][-rsmsec {start_sector} end_sector}]
[-h][-hs]

This command is used to flash and to remove applications from flash. You can flash your file (Intel HEX or binary format) as an application or as a boot application. If you use the switch option -a the file will be flashed as an application starting at the first free flash sector. After a processor reset, BLACKSheep® searches applications in flash and after a certain timeout it tries to boot the first valid application. With the -b switch you can flash the file as a boot application. The core module then boots this application instead of BLACKSheep® OS. BE AWARE THAT FLASHING A FILE WITH THE -b SWITCH OVERWRITES THE BLACKSHEEP CODE!

If your file is in binary format you can use the switch -bin to flash your file. Further you can use the option -eaf to automatically erase the flash sectors needed for the new application. To erase the whole flash memory you can use the option -rsdev (BE AWARE THAT BLACKSHEEP WILL BE REMOVED!). To erase only the application you can use the -rsapp switch. You can also erase one specific sector with -rssec or a range of sectors with -rsmsec.

Some flash memories needs to be unlocked before you can write data on there. To do this you can execute the command with the switch -unlock. Use -lock to lock the flash memory.

Parameter Description
file_to_flash File to be flashed.
-a Flash the file as an application.
-b Flash the file as a boot application (password: bsnorsdev).
-bin File format is binary.
-eaf Automatically erase the needed sectors.
-rsdev Erase the entire flash memory (password: bsnorsdev).
-rsapp Erase the flash memory used for applications.
-rssec Erase the given sector.
sectornr Sector number to be erased.
-rsmsec Erase the given sectors.
-start_sector Start sector.
-end_sector End sector.
-qry Shows the vendor and manufacturer id of the flash memory.
-chkempt Checks if flash is empty.
-ff Shows if an application is in flash and returns the first free address in flash.
-lock Lock the flash memory.
-unlock Unlock the flash memory.
-h Detailed help.
-hs Short help.

ftp [-open {host}{port}{username}{password}][-close]
[-put {localfile}{remotefile}{remotedir}]
[-get {remotefile}{remotedir}{localfile}][-h][-hs]

This command provides a FTP client to get or put files from or to a specified server. Use -open to open a FTP connection to the server specified by host on port(use 0 for default FTP port 21) with user username and password. The connection can be closed with the option -close. Use -put to put a file to the host and -get to get a file from there. The local file is specified by localfile, the file on the host is specified by remotefile and remotedir is the directory where the file is stored on the host.

Parameter Description
-open Open a FTP connection.
host Host address (i.e. 192.168.0.108).
port Port number (use 0 for default FTP port 21).
username User name.
password Password.
-close Close the FTP connection.
-put Put a file to the host.
-get Get a file from host.
localfile Local file name.
remotefile File name on the host.
remotedir Directory on the host.
-h Detailed help.
-hs Short help.

gm [tetris][-h][-hs]

Starts the specified game.

Parameter Description
tetris Start tetris.
-h Detailed help.
-hs Short help.

gpio [[-s][-c][-i][-o][-t][-r][-rc]{bank}{flag}][-h][-hs]

With this command you can manipulate the general purpose I/Os (GPIO) of the processor. You can set the direction of a GPIO with the switches -i and -o. The value of a given GPIO can be changed by the switch -s, -c or -t. To read the value of a specific GPIO you can use -r or -rc (be aware that the GPIO must be set to input before). The GPIO is specified by bank and flag. flag is a number from 0 to 15 describing the GPIO flag. bank is a number starting from 0 that describes on which port the flag is situated: 0 means the first GPIO port of the processor.

Examples
BF533: 0->PFx
BF527, BF537: 0->PFx, 1->PGx, 2->PHx
BF561: 0->PF0-PF15, 1->PF16-PF31, 2->PF32-PF47
BF548: 0->PAx, 1->PBx, 2->PCx, 3->PDx, 4->PEx, 5->PGx, 6->PHx, 7->PIx, 8->PJx
Parameter Description
-s Set the GPIO to high.
-c Set the GPIO to low.
-t Toggle the value of the GPIO.
-i Set direction of the GPIO as input.
-o Set direction of the GPIO as output.
-r Read the value of the GPIO.
-rc Read continuously the value of the GPIO.
-bank Bank of the GPIO.
-flag Flag of the GPIO.
-h Detailed help.
-hs Short help.

help <[-d][-h][-hs]>

Prints a list of all commands with a functional description if no argument is set. Use switch -d to get the full detailed description of each command.

Parameter Description
-d Get detailed description of each command.
-h Detailed help.
-hs Short help.

i2c <-if {interface_nr}>[-s {hwaddr}{regaddr}{value}]
[-r {hwaddr}{regaddr}][-scan][-h][-hs]

Sends or receives data from an I2C interface. The processor acts as a master. Use the switch -s to set the register with the address regaddr to the value. Use -r to read the value of the register. The device is addressed by the I2C address hwaddr. The default I2C interface is 0. If you want to use another bus you can use the switch -if with the appropriate bus number. Further you can scan for devices on the I2C interface by using -scan.

Parameter Description
-if Select I2C bus.
-s Set register value.
-r Read register value.
hwaddr I2C device address.
regaddr Register address.
value New value of the register.
-scan Scan for devices.
-h Detailed help.
-hs Short help.

ifconfig <[-ip {xxx.xxx.xxx.xxx}][-gw {xxx.xxx.xxx.xxx}]
[-sm {xxx.xxx.xxx.xxx}][-mac {xx:xx:xx:xx:xx:xx}]
[-dhcp [yes][no]][-h][-hs]>

This command prints the Ethernet configuration by executing the command without arguments. The values can be set by selecting the specific configuration with the switches -ip, -gw, -sm, -mac or -dhcp and the related new value.

Parameter Description
-ip Change IP address.
-gw Change Gateway address.
-sm Change Subnet mask.
xxx.xxx.xxx.xxx New IP address.
-mac Change MAC address.
xx:xx:xx:xx:xx:xx New MAC address.
-dhcp Change DHCP configuration.
yes Activate DHCP.
no Deactivate DHCP.
-h Detailed help.
-hs Short help.

kill [{thread_id}][-h][-hs]

Kills the thread with the id thread_id. You can use the command ps to get a list of the running threads.

Parameter Description
thread_id ID of the thread to be killed.
-h Detailed help.
-hs Short help.

load [{application_nr}<-de><-sm>][-h][-hs]

This function loads and executes an application from flash. The application number application_nr stored in flash is executed (currently only application number 1 is supported). You can start an application without invoking the boot process by activate the switch -de. In this way applications that are compiled for the boot mode '00' (Direct execution from flash) can be loaded (i.e. the uboot can be loaded in this way). If the switch -sm is active, any outputs from the command on the stdio are suppressed.

Parameter Description
application_nr Application number to be loaded.
-de Start application without invoking the boot process.
-sm Silent mode.
-h Detailed help.
-hs Short help.

ls [<{directory}>][-h][-hs]

This command shows all files in current working directory or all files in the specified directory.

Parameter Description
directory Directory to be read.
-h Detailed help.
-hs Short help.

md5 [{filename}][-h][-hs]

Calculates the MD5 checksum of the given file.

Parameter Description
filename File to use to calculate the MD5 checksum.
-h Detailed help.
-hs Short help.

mkdir [<{directory}>][-h][-hs]

Creates a new directory specified by directory.

Parameter Description
directory New directory.
-h Detailed help.
-hs Short help.

pinfo [<{directory}>][-h][-hs]

Shows a list of all mounted partitions if the command is executed without any arguments. You can get information about a specific partition by setting the argument partition.

Parameter Description
partition Show informantion about this partition.
-h Detailed help.
-hs Short help.

passwd <[-h][-hs]>

Changes username and password of a given user.

Parameter Description
-h Detailed help.
-hs Short help.

ps <[<-mem><-c>][-h][-hs]>

Shows information about all running threads if no argument is set. Use -mem to get a detailed description of the memory usage of all threads. Use the switch -c to get a continuously printed list.

Parameter Description
-mem Detailed memory usage of any thread.
-c Print continuously.
-h Detailed help.
-hs Short help.

pwd <[-h][-hs]>

Shows the working directory and gives information about the partition.

Parameter Description
-h Detailed help.
-hs Short help.

reboot <[-h][-hs]>

Reboots the processor.

Parameter Description
-h Detailed help.
-hs Short help.

redio [{thread_id} <{stream}>][-h][-hs]

With this command you can redirect the standard output stream of the thread with the thread id thread_id to another output stream defined by stream. i.e. Thread A starts within the Terminal. Its stdout is set to the stdout of the Terminal. Now you use Telnet to connect a PC to your Core Module. The outputs of thread A are not visible on your Telnet client because its stdout isn't set to the same stdout of Telnet! You can execute the command ps to get the stdout handle of each thread. Now you can change the stdout of the thread A by executing redio with the thread id of thread A and the stdout handle of Telnet. The format of the stdout handle can be decimal (i.e. 1234) or hex (i.e. 55aah). Setting the stdout to 0 disables all outputs of the given thread. If no stdout value is given the stdout of the calling thread is taken.

Parameter Description
thread_id Thread ID.
stream Stream handle in decimal (i.e. 1234) or hex (i.e. 55aah).
-h Detailed help.
-hs Short help.

rm [<{path}>][-h][-hs]

Removes a file or an empty directory specified by path.

Parameter Description
path Path of the item to be removed.
-h Detailed help.
-hs Short help.

test [sdram][flash][all][tcptx {xxx.xxx.xxx.xxx}]
[tcprx {xxx.xxx.xxx.xxx}][-h][-hs]

Performs hardware tests on the Core Module to check the functionality. You can perform memory tests by checking the SDRAM with sdram or Flash with flash. Further you can use tcptx and tcprx to test your Ethernet connection performing a TCP transmit and receive test at the specified IP address on port 5555 (you can use the tool PCATTCP on your host to test the TCP throughput). Use the switch -all to perform a SDRAM, Flash, SD-Card and RTC test in succession.

Parameter Description
sdram Test SDRAM.
flash Test flash.
all Perform multiple tests successively.
tcptx Test TCP transmit.
tcprx Test TCP receive.
xxx.xxx.xxx.xxx IP address of the host.
-h Detailed help.
-hs Short help.

tftp [-put {filename}{server_ip}][-get {filename}{server_ip}][-h][-hs]

Tool to get or put files on a TFTP server. Use -put to write a file specified by filename to the server with IP server_ip or use -get to download a file from the server.

Parameter Description
-put Transfer a file to the server.
-get Receive a file from the server.
filename File name.
server_ip IP address of the server.
-h Detailed help.
-hs Short help.

time <[{hh}{mm}{ss}<-c>][-h][-hs]>

Gets the current time if no parameters are set. Changes the current time if parameters are set. With -c the time will be print continuously.

Parameter Description
hh mm ss Time to set as current time.
-c Print time continuously.
-h Detailed help.
-hs Short help.

timpwm [-start {timer}{frequency}{dutycycle}{clock_input}]
[-stop][-h][-hs]

With this command you can generate a PWM signal from a processor timer. Use -start to start generating the PWM signal and -stop to stop the timer. You can select the clock source of the timer with the argument clock_input: 0->SCLK, 1->TIMCLK.

Parameter Description
-start Start timer.
-stop Stop timer.
timer Timer number.
frequency Frequency of the PWM signal in [Hz].
dutycycle Duty cycle of the PWM signal in [%].
clock_input Clock input source.
-h Detailed help.
-hs Short help.

ver <[-h][-hs]>

Shows the version of BLACKSheep® OS.

Parameter Description
-h Detailed help.
-hs Short help.

view [{filename}][[-h][-hs]]

Prints the content of the file specified to the stdio.

Parameter Description
filename File to show.
-h Detailed help.
-hs Short help.

wdt [-on][-off][-check][-set {timeout}][-h][-hs]

This command is used to activate/deactivate and to set the timeout of the watchdog timer. You can set the timeout[ms] with the switch -set. Execute the command with -on to activate and -off to deactivate the watchdog timer. Use -check to get the status of the watchdog timer.

Parameter Description
-on Activate watchdog timer.
-off Deactivate watchdog timer.
-check Get status.
-set Set timeout.
timeout Timeout in [ms].
-h Detailed help.
-hs Short help.

xmr [{filename}][-h][-hs]

This command is used for an XModem transfer from the host PC to the Core Module. The file is specified by filename. First you have to start the transfer at BLACKSheep® OS and then you have to activate the XModem transmit mode on your terminal program.

Parameter Description
filename File name.
-h Detailed help.
-hs Short help.

xmt [{filename}][-h][-hs]

Used for a filetransfer via XModem protocol to the host PC. The file is specified by filename. First you have to start the transfer at BLACKSheep® OS and then you have to activate the XModem receive mode on your terminal program.

Parameter Description
filename File name.
-h Detailed help.
-hs Short help.


Additional commands for bsp projects

adm [-init [AD1836][BF525C] <{sport}>][-list][-h][-hs]

This command is used to control the Audio Device Manager (ADM). The ADM can manage a list of audio devices. You can add a new audio device by using the switch '-init' and the corresponding audio device name. The SPORT interface used by this audio device can be specified by 'sport'. You can get a list of all registered audio devices by using the switch '-list'.

Parameter Description
-init Add a new audio device to the ADM
sport SPORT interface used by the audio device
-list Print a list of all registered audio devices
-h Detailed help.
-hs Short help.

aplay <{filename}><-bg><-loop>[-h][-hs]

This command is used to plays a audio file. You can specify the file to be played by setting 'filename'. If the file is not specified all files in the current directory will be played. Further you can run the audio player in background by using the switch '-bg'. Use '-loop' to play the file(s) in loop. The background playback can be stopped by execute the command with argument '-stoploop'.

Parameter Description
filename Audio file to be played
-bg Start player in background
-loop Play file(s) in loop
-stoploop Stop playback on background
-h Detailed help.
-hs Short help.

fwupdate <[-h][-hs]>

This command is used to start the bootloader for firmware update.

Parameter Description
-h Detailed help.
-hs Short help.

sccb [[-r] [-w <-d {value}>] <-a {regaddr}> <-p {ppi}> <-xra>] [-h][-hs]

Sends or receives data from a SCCB interface. The processor acts as a master. Use the switch '-w' to set the register with the address 'regaddr' to the value 'value'. Use '-r' to read the value of the register. The device is connected to the PPI specified by 'ppi'. Use the switch '-xra' if you want to use a 16bit address.

Parameter Description
-w Write register
-r Read register value
-d Next argument is the data to be written
value New value of the register
-a Next argument is the address
regaddr Register address
-p Next argument is the used PPI
ppi PPI number
-xra Use 16bit address
-h Detailed help.
-hs Short help.

tp [-d {duration} [-s][-ms][-us] <-low><-b> {timer}] [-h][-hs]

With this command you can generate a timed pulse signal from a processor timer. Use '-d' to set the duration specified by 'duration' and the time basis ('-s', '-ms','-us'). Use '-low' to generate a low active pulse signal and -b to run the command on background. The timer used to generate the pulse is specified by 'timer'.

Parameter Description
-d Next argument is the duration
duration Duration of the pulse
-s Timebase in [s]
-ms Timebase in [ms]
-us Timebase in [us]
-low Active low pulse
-b Start command on background
timer Timer used to generate the pulse
-h Detailed help.
-hs Short help.