Debug and System Commands
Commands for system information, debugging, and remote desktop control.
Display device information.
Syntax
Section titled “Syntax”infoOutput
Section titled “Output”ch> infoBoard: NanoVNA-H2019-2025 Copyright NanoVNA.combased on @DiSlord @edy555 ... sourceLicensed under GPL.Version: 1.2.44 [p:101, IF:12k, ADC:192k, Lcd:320x240]Build Time: Jan 29 2026 - 14:30:45Architecture: ARMv6-M Core Variant: Cortex-M0Platform: STM32F072xBInformation Fields
Section titled “Information Fields”| Field | Description |
|---|---|
| Board | Hardware variant |
| Version | Firmware version with build parameters |
| p: | Maximum sweep points |
| IF: | IF frequency in kHz |
| ADC: | ADC sample rate in kHz |
| Lcd: | Display resolution |
| Architecture | CPU architecture |
| Platform | MCU part number |
version
Section titled “version”Display firmware version.
Syntax
Section titled “Syntax”versionOutput
Section titled “Output”ch> version1.2.44Shorter output than info, useful for scripts checking version.
List available commands.
Syntax
Section titled “Syntax”helpOutput
Section titled “Output”ch> helpCommands: scan scan_bin data frequencies freq sweep power bandwidthtime sd_list sd_read sd_delete saveconfig clearconfig dumptouchcal touchtest pause resume cal save recall trace markeredelay s21offset capture measure refresh touch release vbattcxo reset smooth config usart_cfg usart vbat_offset transformthreshold help info version colorReset the device.
Syntax
Section titled “Syntax”reset [dfu]Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
| (none) | Normal reset |
dfu | Reset into DFU bootloader |
Examples
Section titled “Examples”ch> reset(device resets)
ch> reset dfu(device enters DFU bootloader)DFU Mode
Section titled “DFU Mode”After reset dfu:
- Device appears as DFU device (VID:PID 0483:DF11)
- Flash new firmware using
dfu-util - Reset device to exit DFU mode
dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D firmware.binRemote Desktop Commands
Section titled “Remote Desktop Commands”These commands enable remote control and screen viewing.
refresh
Section titled “refresh”Get current screen data.
Syntax
Section titled “Syntax”refreshOutput
Section titled “Output”Binary LCD buffer data in RGB565 format.
Used by remote desktop applications to display the NanoVNA screen.
Simulate touch press.
Syntax
Section titled “Syntax”touch <x> <y>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
x | X coordinate (0-319 or 0-479) |
y | Y coordinate (0-239 or 0-319) |
Example
Section titled “Example”ch> touch 200 120release
Section titled “release”Simulate touch release.
Syntax
Section titled “Syntax”releaseExample
Section titled “Example”ch> touch 200 120ch> releaseRemote Desktop Sequence
Section titled “Remote Desktop Sequence”refresh- Get screen imagetouch x y- Send touch eventrelease- Release touchrefresh- Get updated screen
Debug Commands
Section titled “Debug Commands”These commands are typically disabled in release builds. Enable by uncommenting defines in main.c.
threads
Section titled “threads”Display ChibiOS RTOS thread information (requires ENABLE_THREADS_COMMAND, and CH_CFG_USE_REGISTRY in chconf.h).
Syntax
Section titled “Syntax”threadsOutput
Section titled “Output”ch> threadsstklimit| stack|stk free| addr|refs|prio| state| name20000200 200003F0 448 200003F8 1 128 READY sweep20000600 200007F0 320 200007F8 1 64 SLEEP mainColumn Descriptions
Section titled “Column Descriptions”| Column | Description |
|---|---|
stklimit | Stack lower bound address |
stack | Stack pointer (current position) |
stk free | Bytes of stack remaining (watch for low values) |
addr | Thread control block address |
refs | Reference count |
prio | Thread priority (higher = more urgent) |
state | ChibiOS thread state (READY, SLEEP, SUSPENDED, etc.) |
name | Thread name string |
Display system statistics (requires ENABLE_STAT_COMMAND).
Syntax
Section titled “Syntax”statOutput
Section titled “Output”Shows timing and performance statistics.
Get/set codec gain (requires ENABLE_GAIN_COMMAND).
Syntax
Section titled “Syntax”gain [value]Used for debugging audio codec signal levels.
Write to Si5351 registers directly (requires ENABLE_SI5351_REG_WRITE).
Syntax
Section titled “Syntax”si <register> <data>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
register | Si5351 register address (0–255) |
data | Byte value to write (0–255, supports hex 0x prefix) |
Examples
Section titled “Examples”ch> si 16 0x4Fch> si 3 0xFFWrite to TLV320AIC3204 audio codec registers via I2C (requires ENABLE_I2C_COMMAND).
Syntax
Section titled “Syntax”i2c <page> <register> <data>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
page | Codec register page (0–255) |
register | Register address within the page |
data | Byte value to write |
Examples
Section titled “Examples”ch> i2c 0 81 0xC0ch> i2c 1 1 0x08- The TLV320AIC3204 uses a paged register space — you must specify the page
- Calls
tlv320aic3204_write_reg(page, reg, data)internally - Useful for adjusting codec gain, input routing, and sample rates during development
Send commands to the LCD controller (requires ENABLE_LCD_COMMAND).
Syntax
Section titled “Syntax”lcd <cmd> [data...]Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
cmd | LCD command byte |
data... | Optional data bytes (variable number) |
Examples
Section titled “Examples”ch> lcd 0x04ret = 0x00858552
ch> lcd 0x28ret = 0x00000000- Sends a register read/write via
lcd_send_register() - Returns the controller response as a 32-bit hex value
- The command byte and behavior depends on the display controller (ILI9341, ST7789, or ST7796S)
- Useful for reading device ID registers or debugging display initialization
band (b)
Section titled “band (b)”Configure Si5351 frequency band parameters (requires ENABLE_BAND_COMMAND).
Syntax
Section titled “Syntax”b <band_index> <parameter> <value>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
band_index | Band configuration index |
parameter | One of the subcommands below |
value | Numeric value to set |
Band Parameter Subcommands
Section titled “Band Parameter Subcommands”| Subcommand | Description |
|---|---|
mode | Output mode for this band |
freq | Frequency boundary |
div | PLL divider |
mul | PLL multiplier |
omul | Output multiplier |
pow | Output power level |
opow | Opposite port power level |
l | Left channel configuration |
r | Right channel configuration |
lr | Both channels |
adj | Frequency adjustment |
Examples
Section titled “Examples”ch> b 0 mode 1ch> b 2 freq 300000000ch> b 1 pow 3- Calls
si5351_update_band_config()with the parsed index, parameter, and value - Used for characterizing synthesizer behavior at different frequency ranges
- Incorrect settings can degrade measurement accuracy
Run diagnostic tests (requires ENABLE_TEST_COMMAND).
Syntax
Section titled “Syntax”testRuns internal hardware tests.
Set the DAC output value (requires __VNA_ENABLE_DAC__).
Syntax
Section titled “Syntax”dac <value>Parameters
Section titled “Parameters”| Parameter | Description | Range |
|---|---|---|
value | DAC output value | 0–4095 (12-bit) |
Examples
Section titled “Examples”ch> dacusage: dac {value(0-4095)}current: 2048
ch> dac 1024- Sets channel 2 of the on-chip DAC via
dac_setvalue_ch2() - With no arguments, displays usage and the current DAC value
- Value is masked to 12 bits (
& 0xFFF) - Used for calibrating analog circuits or testing signal levels
Select the audio codec input port (requires ENABLE_PORT_COMMAND).
Syntax
Section titled “Syntax”port <channel>Parameters
Section titled “Parameters”| Value | Description |
|---|---|
0 | TX port (measurement/stimulus channel) |
1 | RX port (reference channel) |
Example
Section titled “Example”ch> port 0ch> port 1- Calls
tlv320aic3204_select()to switch the codec input multiplexer - Used for debugging signal path routing between the TX and RX channels
t (Si5351 timings)
Section titled “t (Si5351 timings)”Configure Si5351 timing parameters (requires ENABLE_SI5351_TIMINGS).
Syntax
Section titled “Syntax”t <index> <value>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
index | Timing parameter index |
value | Timing value |
Example
Section titled “Example”ch> t 0 100ch> t 1 50- Calls
si5351_set_timing()to adjust PLL settling and output timing - Used for optimizing sweep speed vs. measurement stability
- Incorrect values can cause PLL lock failures or measurement glitches
i (I2C timings)
Section titled “i (I2C timings)”Configure I2C bus timing parameters (requires ENABLE_I2C_TIMINGS).
Syntax
Section titled “Syntax”i <scldel> <sdadel> <sclh> <scll>Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
scldel | SCL delay (setup time) |
sdadel | SDA delay (hold time) |
sclh | SCL high period |
scll | SCL low period |
Example
Section titled “Example”ch> i 4 2 15 15- Directly configures the STM32 I2C
TIMINGRregister fields - Used for tuning I2C bus speed when experimenting with different clock rates
- All four parameters are required
- Applies immediately via
set_I2C_timings()
Enabling Debug Commands
Section titled “Enabling Debug Commands”To enable debug commands, edit main.c and uncomment the relevant defines:
// Enable for debug builds#define ENABLE_THREADS_COMMAND // threads#define ENABLE_STAT_COMMAND // stat#define ENABLE_GAIN_COMMAND // gain#define ENABLE_TEST_COMMAND // test#define ENABLE_I2C_COMMAND // i2c (codec register access)#define ENABLE_LCD_COMMAND // lcd (display controller access)#define ENABLE_SI5351_REG_WRITE // si (synth register write)#define ENABLE_BAND_COMMAND // b (band configuration)#define ENABLE_PORT_COMMAND // port (codec input select)#define ENABLE_SI5351_TIMINGS // t (synth timing)#define ENABLE_I2C_TIMINGS // i (I2C bus timing)#define ENABLE_SAMPLE_COMMAND // sample, gamma#define __VNA_ENABLE_DAC__ // dacThen rebuild the firmware.
System Information
Section titled “System Information”Memory Usage
Section titled “Memory Usage”Check stack usage:
// In threads output, stack column shows used stack// Compare to allocated: waThread1 = 1024 bytesPerformance
Section titled “Performance”Time domain profiling (if enabled):
START_PROFILE;// code to measureSTOP_PROFILE;Source Code Reference
Section titled “Source Code Reference”All debug commands in main.c:
| Command | Handler | Line | Compile Flag |
|---|---|---|---|
info | cmd_info | 2630 | ENABLE_INFO_COMMAND |
version | cmd_version | 2561 | (always) |
help | cmd_help | 3035 | (always) |
reset | cmd_reset | 517 | (always) |
refresh | cmd_refresh | 2774 | __REMOTE_DESKTOP__ |
touch | cmd_touch | 2785 | __REMOTE_DESKTOP__ |
release | cmd_release | 2791 | __REMOTE_DESKTOP__ |
threads | cmd_threads | 2706 | ENABLE_THREADS_COMMAND |
stat | cmd_stat | 2499 | ENABLE_STAT_COMMAND |
gain | cmd_gain | 1262 | ENABLE_GAIN_COMMAND |
si | cmd_si5351reg | 2597 | ENABLE_SI5351_REG_WRITE |
i2c | cmd_i2c | 2665 | ENABLE_I2C_COMMAND |
lcd | cmd_lcd | 2691 | ENABLE_LCD_COMMAND |
b | cmd_band | 2678 | ENABLE_BAND_COMMAND |
test | cmd_test | 2416 | ENABLE_TEST_COMMAND |
dac | cmd_dac | 690 | __VNA_ENABLE_DAC__ |
port | cmd_port | 2475 | ENABLE_PORT_COMMAND |
t | cmd_si5351time | 2587 | ENABLE_SI5351_TIMINGS |
i | cmd_i2ctime | 2619 | ENABLE_I2C_TIMINGS |