MelexisIO SCPI Commands
Loading...
Searching...
No Matches
Application SCPI Commands

This document describes the SCPI command interface implemented in commands_application.c for system-level operations on the Melexis IO STM32 platform.

Overview

The commands_application.c file provides SCPI-like commands for system information, help, time management, benchmarking, bootloader access, and pin layout display. These commands are accessible via a terminal or remote interface that supports the defined command patterns.

Supported Commands

Command Pattern Handler Description
?SYSTEM (none) System commands group header
:SYSTem:INFO CMD_Info System information
:SYSTem:HELP:LIST CMD_HelpList List of commands
:SYSTem:HELP CMD_Help Brief help for particular commands
:SYSTem:TIME? CMD_DateTimeQ Get Date/Time (if RTC enabled)
:SYSTem:TIME CMD_DateTime Set Date/Time (if RTC enabled)
:SYSTem:TIME:MS? CMD_TimeMsQ Get system ticks in milliseconds
:SYSTem:TIME:US? CMD_TimeUsQ Get system ticks in microseconds
:SYSTem:TIME:MSSleep CMD_TimeSleepMs Sleep for specified milliseconds
:SYSTem:TIME:USSleep CMD_TimeSleepUs Sleep for specified microseconds
:SYSTem:BenchMark CMD_Benchmark System benchmark tests
:SYSTem:DFU CMD_Bootloader Update application (DFU mode)
:SYSTem:Pins CMD_Pins Display pins layout

» Note: Some commands are only available if certain features (e.g., RTC) are enabled at compile time.

Command Details

System Information

  • :SYSTem:INFO: Prints system statistics, including runtime stats and free heap size.

Help

  • :SYSTem:HELP:LIST: Lists all available commands for auto-complete and reference.
  • :SYSTem:HELP: Prints help for all commands, including descriptions.

Time and Date

  • :SYSTem:TIME?: Gets the current date and time (if RTC is enabled).
  • :SYSTem:TIME: Sets the current date and time (if RTC is enabled).
  • :SYSTem:TIME:MS?: Gets the system tick count in milliseconds.
  • :SYSTem:TIME:US?: Gets the system tick count in microseconds.
  • :SYSTem:TIME:MSSleep «ms»: Sleeps for the specified number of milliseconds (1 ms to 30 sec).
  • :SYSTem:TIME:USSleep «us»: Sleeps for the specified number of microseconds (1 us to 30 sec).

Benchmark

  • :SYSTem:BenchMark: Runs memory, flash, and floating-point operation benchmarks and prints timing results.

Bootloader

  • :SYSTem:DFU «value»: Enters DFU (Device Firmware Update) mode if the value is 42.

Pins Layout

  • :SYSTem:Pins: Prints a diagram of the board's pin layout for reference.

Examples

Get System Information

Command sent:

:SYSTem:INFO\n

Response:

System: STM32F446
Heap: 123456 bytes free
(OK)>

List All Commands

Command sent:

:SYSTem:HELP:LIST\n

Response:

:EEPROM:INIT
:EEPROM:ERASE
:EEPROM:STRing ...
... (list continues)
(OK)>

Get System Time (RTC enabled)

Command sent:

:SYSTem:TIME?\n

Response:

2025-10-02 14:23:45
(OK)>

Set System Time (RTC enabled)

Command sent:

:SYSTem:TIME 2025-10-02 14:23:45\n

Response:

(OK)>

Run Benchmark

Command sent:

:SYSTem:BenchMark\n

Response:

RAM: 1234 us
FLASH: 5678 us
FPU: 910 us
(OK)>

Error Example (Invalid Command)

Command sent:

:SYSTem:TIME:INVALID\n

Response:

ERR: unknown command
(Some error)>

Notes

  • Commands are case-insensitive.
  • The command interface is extensible; new system commands can be added by updating the command table and implementing the corresponding handler logic.
  • Some commands require specific hardware features (e.g., RTC) to be enabled.