-
Notifications
You must be signed in to change notification settings - Fork 92
HydraFW binary UART mode guide
#HydraFW binary UART mode guide
This guide is updated towards development firmware
##Commands Once the UART mode has been selected, the following commands are available :
-
0b00000000
Return to main mode. ReturnsBBIO1
-
0b00000010
Start local echo. Returns0x01
-
0b00000011
Stop local echo. Returns0x01
-
0b0001xxxx
Bulk UART transfer -
0b0110xxxx
Set UART speed.
##Command details
Once the local echo is started, each received byte on the UART will be sent to the user. Local echo is stopped by default.
###Bulk UART transfer (0b0001xxxx
)
In this mode, the last 4 bits of the command define the number of bytes to write (from 1 to 16) (Command 0b00010000
will send 1 byte). Hydrabus will read the defined number of bytes, send a 0x01
(acknowledge) after each read bytes.
###Set UART speed (0b0110xxxx
)
This command sets the UART device bitrate.
The four last bits will select the speed (int bits/sec) within the following list :
-
0b0000
=> 300 -
0b0001
=> 1200 -
0b0010
=> 2400 -
0b0011
=> 4800 -
0b0100
=> 9600 -
0b0101
=> 19200 -
0b0110
=> 31250 -
0b0111
=> 38400 -
0b1010
=> 115200
This commands returns 0x01
if successful, 0x00
in case of error.
###Configure UART port (0b1000xx00
)
The following value for the `xx``bits configure the following parameters :
-
0b00
=> No parity -
0b01
=> Even parity -
0b10
=> Odd parity
See https://github.com/bvernoux/hydrafw/wiki/HydraFW-UART-guide for explanation.
This commands returns 0x01
if successful, 0x00
in case of error.
##Example script This script will enable BBIO UART mode and listen to all incoming bytes
import serial
import os
ser = serial.Serial('/dev/hydrabus', 115200)
for i in xrange(20):
ser.write("\x00")
if "BBIO1" not in ser.read(5):
print "Could not get into bbIO mode"
quit()
print "Into BBIO mode"
print "Switching to UART mode"
ser.write('\x03')
if "ART1" not in ser.read(4):
print "Cannot set UART mode"
quit()
print "Setting speed"
ser.write('\x6a')
if ser.read(1) != '\x01':
print "Error setting speed"
quit()
print "Starting reader"
ser.write('\x02')
if ser.read(1) != '\x01':
print "Error starting reader"
quit()
while 1:
print ser.read(1),
- 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