-
Notifications
You must be signed in to change notification settings - Fork 92
Bus interaction commands
This guide is updated towards firmware release HydraFW v0.10 and later
All commands have to be delimited with spaces.
Since 19c2fbdd497cc81731aa198a025d15cf8025e3dc it is possible to skip the spaces between tokens we also call that Compressed mode
Example1 Compressed mode:
spi1> [0x1 0xff 0 10 0b11 077]
/CS ENABLED
WRITE: 0x01 0xFF 0x00 0x0A 0x03 0x3F
/CS DISABLED
Example2 Compressed mode:
spi1> [0x3a:2 0x0f 0b1111 0 1][2:5][0x3b r:4]["hello"]
/CS ENABLED
WRITE: 0x3A 0x3A 0x0F 0x0F 0x00 0x01
/CS DISABLED
/CS ENABLED
WRITE: 0x02 0x02 0x02 0x02 0x02
/CS DISABLED
/CS ENABLED
WRITE: 0x3B
READ: 0x00 0x00 0x00 0x00
/CS DISABLED
/CS ENABLED
WRITE: 0x68 0x65 0x6C 0x6C 0x6F
/CS DISABLED
- Note: The "compressed" mode (multiple commands without space) is decompressed internally so it will not allow to enter more "words"
- Example with spi compressed commands:
spi1> "a"]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
- Output of the spi compressed command:
Uncompressed form too big
spi1> [ 0x1 0xff 0 10 0b11 077 ]
/CS ENABLED
WRITE: 0x01 0xFF 0x00 0x0A 0x03 0x3F
/CS DISABLED
Read one byte on the selected bus.
When applicable (in SPI mode for instance), Hydrabus will send
0xff
while reading
Suffix command with :<int>
to read <int>
bytes up to 255.
spi1> read read
READ: 0xFF
READ: 0xFF
spi1> r:5
READ: 0xFF 0xFF 0xFF 0xFF 0xFF
spi1>
Read one byte and display value in hexdump format.
When applicable (in SPI mode for instance), Hydrabus will send
0xff
while reading
Suffix command with :<int>
to read <int>
bytes up to 4294967295.
See Hexdump guide for more information.
spi1> hd:32
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ................
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF | ................
Followed by values to write byte(s).
This command is fully optional and can be omitted.
spi1> write 0xcc
WRITE: 0xCC
spi1> w 0xcc
WRITE: 0xCC
Each value can be written multiple times by using the :<int>
suffix to write <int>
bytes.
spi1> 0x55:5
WRITE: 0x55 0x55 0x55 0x55 0x55
spi1> 0xcc:0xc
WRITE: 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC 0xCC
spi1>
To write a binary value, prefix it with 0b
In any case, a full byte will be written on the bus.
Values range from 0b0 to 0b11111111
spi1> 0b1010101
WRITE: 0x55
spi1> 0b11001100
WRITE: 0xCC
To write an hexadecimal value, prefix it with 0x
Values range from 0x0 to 0xff
spi1> 0x55
WRITE: 0x55
spi1> 0xcc
WRITE: 0xCC
To write a decimal value, just write it without any leading data.
Values range from 0 to 255
spi1> 85
WRITE: 0x55
spi1> 204
WRITE: 0xCC
To write an octal value, prefix it with 0
Values range from 00 to 0377
spi1> 0125
WRITE: 0x55
spi1> 0314
WRITE: 0xCC
Repeating the command will generate a new random value, but using the repeat suffix will reuse the same byte.
spi1> ~ ~
WRITE: 0x8C 0xAE
spi1> ~:2
WRITE: 0x6B 0x6B
It is possible to write ASCII strings by enclosing them between "
.
It is also possible to include non-ASCII characters within the string by using the \x..
syntax.
spi1> "Hello"
WRITE: 0x48 0x65 0x6C 0x6C 0x6F
spi1> "Hello World"
WRITE: 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64
spi1> "Hello\x20World"
WRITE: 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64
Delay can be repeated using the :<int>
suffix
Due to timing constraints, the microseconds will not be displayed in the CLI.
spi1> 0x55 &:10 0xcc
WRITE: 0x55
WRITE: 0xCC
Delay can be repeated using the :<int>
suffix
spi1> 0x55 %:10 0xcc
WRITE: 0x55
DELAY: 10 ms
WRITE: 0xCC
Set AUX[0] to +3.3V (State '1' high) corresponding to GPIO PC4
Set AUX[0] to GND (State '0' low) corresponding to GPIO PC4
Read AUX[0] state corresponding to GPIO PC4 (0=GND or 1=+3.3V)
- 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