The user-mcu shell is a fully-featured virtual UART shell exposed over the MCU’s first USB CDC-ACM interface. This shell supports both command history and line editing, and can optionally serve as an output target for driver log messages.
Command Reference
All shell commands and their help text may be enumerated with the help
command:
Please press the <Tab> button to see all available commands.
You can also use the <Tab> button to prompt or auto-complete all commands or its subcommands.
You can try to call commands with <-h> or <--help> parameter for more information.
Shell supports following meta-keys:
Ctrl + (a key from: abcdefklnpuw)
Alt + (a key from: bf)
Please refer to shell documentation for more details.
Available commands:
clear :Clear screen.
device :Device commands
devmem :Read/write physical memory: "devmem address [width [value]]"
dio :Digital Ouput Commands
flash :Flash shell commands
help :Prints the help message.
history :Command history.
hwinfo :HWINFO commands
kernel :Kernel commands
log :Commands for controlling logger
lpmcu :Command for configuring system automotive features
mcuboot :MCUboot commands
pwm :PWM shell commands
reset :Performs a cold reboot.
resize :Console gets terminal screen size or assumes default in case the
readout fails. It must be executed after each terminal width change
to ensure correct text display.
set :Set configurable perameters
shell :Useful, not Unix-like shell commands.
Command: Device
Provides information about the present system devices. A 'device' may be a lower level interface, like a GPIO controller,
but also encompasses features supported by OnLogic drivers. For instance a DIO_0
device might control the input and
output states of a block of isolated Digital IO.
In general, most devices can be safely ignored, but some devices may be passed as arguments to other commands.
Subcommand |
Description |
|
Print a list of all available MCU devices, and indicate the status of the device. |
|
Print a list of all available MCU devices, grouped by their initialization priority. |
Command: Devmem
The devmem
command supports reading and writing memory mapped IO directly;
this command is only present for developer and debug use.
Command: Dio
This command supports controlling the system’s Isolated Digital IO. All digital inputs/outputs support reading the current logical state of the pin. Digital outputs additionally support setting the output state of the pin, and digital inputs support reporting the transition count of the pin (both edges).
On some platforms, the digital ouputs may be places into 'source' mode, instead of 'open-collector' mode, in order
to provide current. This feature is not supported on the K800
. However, the K800 does support configuring digital
outputs as PWMs, and configuring the PWM output’s pulse and duty cycle.
Important
|
In most cases, the digital output state is NOT measured; any reported value reflects only the expected state according to a software-only tracking value. |
Name |
*Outputs |
*Inputs |
Description |
|
4 |
4 |
Karbon 800 front Isolated Digital IO |
|
4 |
0 |
Karbon 800 front user-controllable LEDs |
*All pin numbers are zero indexed
Subcommand |
Example |
Description |
|
|
Set the logical state of a digital output to |
|
|
Get the current logical state of a digital input or ouput |
|
|
Report the number of input/output pins available to an IO bank |
|
|
Configure digital outputs to source or sink current, when supported |
|
|
Set an output as PWM with period in microseconds, and duty in percent |
|
|
Get the number of rising and falling edges detected by a digital input |
Command: Flash
Allows reading, writing, and erasing flash memory. Some devices support a non-volatile storage partition that will be preserved across system reboots and firmware application updates.
Device |
Flash |
Storage (offset, size) |
Karbon 800 |
W25Q16JV |
|
Warning
|
This API can potentially overwrite application data; it is not recommended for general use. |
Command: Hwinfo
Provides the hwinfo devid
command, that supports reporting the unique identifier for the current MCU.
Command: Kernel
Supports reporting information about the currently running kernel.
Subcommand |
Description |
|
Report the number of hardware cycles of the system kernel since boot |
|
Reboot the system kernel |
|
Report the stack usage of all kernel threads |
|
Provide more verbose status information about system threads |
|
Report the current system uptime in milliseconds |
|
Get the running Zephyr RTOS kernel version |
Command: Log
Configure runtime features of the system logging backend. This allows resuming or halting log-output on different backends, as well as modifying the reporting level across specific modules.
Subcommand |
Description |
|
Disable logging for the specified module |
|
Enable logging at the chosen level for the specified module. Log level cannot exceed the compiled level. |
|
Run a |
|
Produce a list of the available log backends, and indicate if a backend is enabled or disabled. |
|
Resume logging to the uart terminal |
|
Pause logging to the uart terminal |
|
Provide a list of log modules and their current output level |
|
Get logger memory statistics |
Command: LPMCU
Supports configuration of system automotive features, which allows enable automotive low power modes, ignition sensing, and other features.
Subcommand |
Description |
|
Report the firmware version running on the low-power microcontroller |
|
Report the current system input voltage in the format |
|
Reports the current state of the system ignition input ( |
|
Get or set the system power state. Possible values are |
|
Get or set non-volatile, configurable, automotive settings |
Automotive configuration values can be set and reported by the same command:
-
Report a value
lpmcu config shutdown-voltage
-
Set a value
lpmcu config shutdown-voltage 6.25
Configuration |
Description |
Values |
|
Enable or disable system automotive features |
|
|
Enable entering a very low power state when the system powers off. The system can only wake from the power-button and the ignition switch when in this power state. |
|
|
The number of seconds that the ignition input must be stable before the system will power on |
|
|
The number of seconds that the ignition input can be low before the mcu will request the system powers down via a virtual power button event. |
|
|
The number of seconds that the ignition input can be low before the mcu will force the system to power down. |
|
|
The number of seconds that the measured voltage can be lower than the shutdown threshold before a forced shutdown will occur. |
|
|
The threshold voltage for triggering low-voltage shutdown events. |
|
Command: Mcuboot
Running the mcuboot
command will report information about the running and fallback firmware images:
swap type: none
confirmed: 0
primary area (2): <---------- Currently running image
version: 1.0.6+5 <--------- Current firmware version
image size: 103528
magic: unset
swap type: none
copy done: unset
image ok: unset
secondary area (3): <------- Swap/backup image version
version: 1.0.6+3 <------- Swap/backup image version
image size: 101408
magic: unset
swap type: none
copy done: unset
image ok: unset
Command: Pwm
Supports configuration of pwm
devices that are not optionally configured Digital IO. The Karbon 800 does not
support this kind of interface.
Subcommand |
Description |
|
Set the pwm period and pulse width in system cycles |
|
Set the pwm period and pulse width in microseconds |
|
Set the pwm period and pulse width in nanoseconds |
Command: Reset
Perform a cold reboot of the mcu processor. This will result in the MCU transition back through the second-stage bootloader, allowing the application boot sequence to be interrupted by a bootloader entry request.
For the first three seconds after a reset, the MCU user button qualifies as a bootloader entry request. After that period, the system will listen for smp-svr commands for up to five seconds.
Command: Set
Performs configuration on system VCAN
devices. This includes setting the CAN baudrate, and programming the CAN
message parser mode.
Device |
Description |
|
Karbon 800 on-board CAN 2.0 A/B interface |
Subcommand |
Description |
|
Set the can parser mode to |
|
Set the can baudrate within the allowable range |
Command: Shell
Provides some configuration options for the shell environment.
Subcommand |
Description |
|
Capable of forcing the delete key to act like the backspace key |
|
Enables or disables sending color-codes with shell output text |
|
Enables or disables shell character echo |
|
Provides or clears shell stats about dropped log messages |