Using the console

Previous: Understanding the directory structure

A console is provided in which you can enter commands and see log messages from the application. On an embedded platform this is usually provided as a serial console over UART. On the POSIX platform, it is provided in the standard I/O of the shell in which the application is executed.

If you press return, you should see that a prompt > appears, indicating commands may be entered. If you enter the command help and press return a list of available commands is printed.

Available Console Commands

POSIX Platform

> help
can        - Can system.
  info     - print bus info
  send     - send frame: id data[8]
             [send 0x123 1 2 3 4 5 6 7 8] sends to CAN_0 Frame(CanId = 0x123)
help       - Show all commands or specific help for a command given as parameter.
lc         - lifecycle command
  reboot   - reboot the system
  poweroff - poweroff the system
  level    - switch to level
  udef     - forces an undefined instruction exception
  pabt     - forces a prefetch abort exception
  dabt     - forces a data abort exception
  assert   - forces an assert
logger     - logger settings
  level    - get/set levels. Usage: logger level [<component>] [<new_level>]
stats      - lifecycle statistics command
  cpu      - prints CPU statistics
  stack    - prints stack statistics
  all      - prints all statistics
ok

S32K148EVB Platform

> help
adc         - Adc Console
  all       - Print All Adc
  get       - startChannel ChannelNr [stopChannel ChannelNr]
  allx      - all scaled adc
can         - Can system.
  info      - print bus info
  send      - send frame: id data[8]
              [send 0x123 1 2 3 4 5 6 7 8] sends to CAN_0 Frame(CanId = 0x123)
help        - Show all commands or specific help for a command given as parameter.
in          - inputs console
  all       - print all inputs, verbose output
  get       - get input value (param: <input-id>)
  allx      - all inputs
lc          - lifecycle command
  reboot    - reboot the system
  poweroff  - poweroff the system
  level     - switch to level
  udef      - forces an undefined instruction exception
  pabt      - forces a prefetch abort exception
  dabt      - forces a data abort exception
  assert    - forces an assert
logger      - logger settings
  level     - get/set levels. Usage: logger level [<component>] [<new_level>]
out         - outputs console
  all       - print all outputs
  set       - set output value (param: <output-id> [0|1])
  get       - get output value (param: <output-id>)
pwm         - Set PWM
  all       - print all channel numbers and names
  set       - channel[0-9,0xFF=all] duty[0=off|10000=100%]
  setPeriod - channel[0-9] period[microsec]s
stats       - lifecycle statistics command
  cpu       - prints CPU statistics
  stack     - prints stack statistics
  all       - prints all statistics
ok

In the above menu printed by help, indented items are sub-commands of the unindent command above it.

Explore these commands, look at the documentation command - Command Framework and search the code for occurrences of GroupCommand to improve your understanding.

Read more about individual commands from below:

CPU Statistics

Statistics that are collected by the CPU and monitor in the console.

Logger Console

The console logger helps the user to switch between the logger level.

Digital Out

The out command controls the Digital Output Channel, while the in command reads the Digital Input Channel.

ADC Console

The adc command reads the ADC channel value.

PWM Console Command

The pwm command sets the duty cycle for a PWM channel.

Lifecycle Console

The lc command provides lifecycle commands like reboot, poweroff, etc.