-
Notifications
You must be signed in to change notification settings - Fork 92
HydraFW console commands
I recommend Putty for terminal to be used with HydraBus(hardware) and hydrafw(firmware) connected with USB1 or 2.
-
When connected type h for help and use TAB key for completion, you can also use arrow up or down for history.
-
For microSD read performance test results (command sd_rperfo) see: https://github.com/hydrabus/hydrafw/wiki/HydraBus-microSD-read-performance
Those commands are updated towards firmware release HydraFW v0.11 and later
Note:
- All commands shall be separated by a space.
- During a blocking read or write which wait for data(for example Slave mode),
you can abort the wait by pressing HydraBus
UBTN
button. - You can use command completion by pressing
TAB
- To obtain help for a command type the command name with a space at end then press
TAB
- You can also type
help
then the command name then enter - For more details on the command-line shell interface see https://github.com/hydrabus/tokenline
- You can also type
> help
Available commands
help Available commands
history Command history
clear Clear screen
show Show information
logging Turn logging on or off
sd SD card management
adc Read analog values
dac Write analog values
pwm Write PWM
frequency Read frequency
gpio Get or set GPIO pins
spi SPI mode
i2c I2C mode
1-wire 1-wire mode
2-wire 2-wire mode
3-wire 3-wire mode
uart UART mode
nfc NFC mode
can CAN mode
sump SUMP mode
jtag JTAG mode
random Random number
flash NAND flash mode
wiegand Wiegand mode
lin LIN mode
smartcard SMARTCARD mode
debug Debug mode
-
show system
Display system Info (MCU, Flash, Kernel, Compiler ...) -
show memory
Display chibios memory informations -
show threads
Display chibios thread informations -
show sd
Display SD card informations
- Usage:
logging [sd <file>] <on/off>
Example logging all in/out text from terminal in SD card file test.txt in root dir:
-
Start logging:
logging sd test.txt on
-
Stop logging:
logging off
> help sd
SD card management
show Show SD information
mount Mount SD card
umount Unmount SD card
erase Erase and reformat SD card
cd Change SD card directory
pwd Show current SD card directory
ls List files on SD card
test-perf Test SD card performance
cat Display (ASCII) file on SD card
hd Hexdump file on SD card
rm Remove file or directory
mkdir Create new directory
script Execute script from file
It is possible to run predefined commands stored in a text file on the SD card using the command sd script <filename>
.
- Each line will be passed as a console command and its output will be displayed in the console.
- Any line beginning with a
#
will be ignored.
It is also possible to execute an autorun script. Simply create a file called initscript in the root of the SD card. This file will be executed at the console initialization.
> help adc
Usage: adc <adc1/tempsensor/vrefint/vbat> [period (nb ms)] [samples (nb sample)/continuous]
adc1 ADC1 (PA1)
tempsensor Temperature sensor
vrefint Internal reference voltage
vbat VBAT voltage
period Delay between samples (msec)
samples Number of samples
trigger Set trigger bounds
continuous Read continuously
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-ADC-guide
> help dac
Usage: dac <dac1/dac2> <raw (0 to 4095)/volt (0 to 3.3V)/triangle/noise> [exit]
help DAC1, DAC2 (12bits DAC 0 to 4095/3.3V)
dac1 DAC1 (PA4 used by ULED)
dac2 DAC2 (PA5)
raw Raw value <0 to 4095>
volt Volt <0 to 3.3v>
triangle Triangle output (5Hz and amplitude 3.3V)
noise Noise output (amplitude 3.3V)
exit Exit DAC mode (reinit DAC1&2 pins to safe mode/in)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-DAC-guide
> help pwm
Usage: pwm <frequency (1Hz to 42MHz)> [duty-cycle (0 to 100%)] [exit]
help PWM1 (PB11)
frequency PWM frequency <value 1Hz to 42MHz>
duty-cycle Duty Cycle in % <value 0 to 100>
exit Exit PWM mode (reinit PWM1 pin to safe mode/in)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-PWM-guide
Returns frequency in Hz (up to 42MHz) and duty cycle in % on PC6 pin (0V to 3V3 max)
> help frequency
Usage: frequency
help FREQ1 (PC6)
> help gpio
Configuration: gpio <"PA0-15", "PB0-11", "PC0-15", "PA*"> <mode (in/out/open-drain)> [pull (up/down/floating)]
Interaction: gpio <"PA0-15", "PB0-11", "PC0-15", "PA*"> [period (nb ms)] <read/continuous> or <on/off>
<string> One or more GPIO pins ("PA0-15", "PB0-11", "PC0-15", "PA*" ...)
mode Mode (in/out/open-drain)
pull GPIO pull (up/down/floating)
period Delay between reads, in milliseconds
read Read GPIO values
continuous Read continuously
on Set GPIO pin
off Clear GPIO pin
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-GPIO-guide
> help spi
Configuration: spi [device (1/2)] [pull (up/down/floating)] [mode (master/slave)] [frequency (value hz/khz/mhz)] [polarity 0/1] [phase 0/1] [msb-first/lsb-first]
Interaction: [cs-on/cs-off] <read/write (value:repeat)> [exit]
device SPI device (1/2)
pull GPIO pull (up/down/floating)
mode Mode (master/slave)
frequency Bus frequency
polarity Clock polarity (0/1)
phase Clock phase (0/1)
msb-first Send/receive MSB first
lsb-first Send/receive LSB first
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-SPI-guide
> help i2c
Configuration: i2c [pull (up/down/floating)] [frequency (value hz/khz/mhz)]
Interaction: [<start>] [<stop>] <read/write (value:repeat)>
pull GPIO pull (up/down/floating)
frequency Bus frequency
clock-stretch Max clock stretch tick count. (0 = Disabled, n = Ticks)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-I2C-guide
> help 1-wire
1-wire mode
pull GPIO pull (up/down/floating)
msb-first Send/receive MSB first
lsb-first Send/receive LSB first
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-1-wire-guide
> help 2-wire
2-wire mode
pull GPIO pull (up/down/floating)
msb-first Send/receive MSB first
lsb-first Send/receive LSB first
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-2wire-guide
> help 3-wire
3-wire mode
pull GPIO pull (up/down/floating)
msb-first Send/receive MSB first
lsb-first Send/receive LSB first
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-3wire-guide
> help uart
Configuration: uart [device (1/2)> [speed (value in bauds)] [parity (none/even/odd)] [stop-bits (1/2)]
Interaction: <read/write (value:repeat)>
device UART device (1/2)
speed Bus bitrate
parity Parity (none/even/odd)
stop-bits Stop bits (1/2)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-UART-guide
> nfc
NFC> help
show Show NFC parameters
typea TypeA (ISO14443A => MIFARE...)
vicinity Vicinity (ISO/IEC 15693)
scan Scan
read-mf-ul Read Mifare UltraLight write to microSD
emul-mf-ul Emul Tag Mifare Ultralight (optional read from microSD)
clone-mf-ul Clone Mifare UltraLight
sniff Sniff (default ISO14443A see options for more details)
emul-mifare Emul Tag Mifare UID
emul-3a Emul Tag ISO14443A SDD UID
dm0 Enter Direct Mode 0 (IO6/PC2=subcarrier)
dm1 Enter Direct Mode 1 (IO5/PC4=CLK, IO6/PC2=Data)
exit Exit NFC mode
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-HYDRANFC-guide
> help can
CAN mode
device CAN device (1/2)
speed Bus bitrate
ts1 Time segment 1 value (1-16)
ts2 Time segment 2 value (1-8)
sjw Resynchronisation jump width (1-4)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-CAN-guide
> help sump
SUMP mode
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-SUMP-guide
> help jtag
JTAG mode
pull GPIO pull (up/down/floating)
msb-first Send/receive MSB first
lsb-first Send/receive LSB first
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-JTAG-guide
-
random
returns a 32bit random number from the MCU TRNG -
~
command in any mode sends a random byte
> help flash
NAND flash mode
show Show flash parameters
id Displays the ID and status registers
exit Exit flash mode
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-NAND-Flash-guide
> help wiegand
Wiegand mode
pull GPIO pull (up/down/floating)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-Wiegand-guide
> help lin
Configuration: lin [device (1/2)>
Interaction: <read/write (value:repeat)>
device LIN device (1/2)
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-LIN-guide
> help smartcard
Configuration: smartcard
Interaction: <read/write (value:repeat)>
speed Bus bitrate
parity Parity (even/odd)
polarity Clock polarity (0/1)
phase Clock phase (0/1)
stop-bits Stop bits (0/1)
guardtime Guardtime value
prescaler Prescaler value
convention Communication convention
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-SMARTCARD-guide
> help debug
Debug mode
tokenline Tokenline dump for every command
timing Mysterious timing function
test-rx Test USB1 or 2 RX(read all data until UBTN+Key pressed)
on Enable
off Disable
debug test-rx can be used with python3 script https://github.com/hydrabus/hydrafw/blob/master/scripts/tx_bench.py to measure PC TX => HydraBus USB COM port performance on different packet size
For more details see https://github.com/hydrabus/hydrafw/wiki/HydraFW-Binary-mode-guide
- CHANGELOG
- Console commands
- Binary mode guide
-
NFC/HydraNFC v1 guide
- Read UID of an ISO/IEC_14443 Tag
- Read UID and data of a MIFARE Ultralight Tag
- Read UID of an ISO/IEC 15693 Tag
- Emul ISO14443a Tag
- Emul MIFARE Ultralight Tag
- Emul Mifare Classic Tag
- Unique NFC sniffer design
- Launch NFC sniffer from console
- Sniffer ISO14443A wireshark pcap
- Autonomous/stand-alone sniffer mode
- Sniffer ISO14443A real-time infinite trace mode
- HydraFW-HydraNFC-v1.x-TRF7970A-Tutorial