Skip to content

HydraFW HydraNFC v2 guide dnfc mode

Benjamin Vernoux edited this page Aug 27, 2020 · 7 revisions

HydraNFC Shield v2 must be plugged on the front side of HydraBus! (PowerOff the HydraBus before to plug HydraNFC)

This guide is updated towards firmware release HydraBus v1 HydraNFC Shield v2 firmware v0.1 Beta (HydraFW (HydraBus v1/HydraNFC Shield v2) v0.1-beta-50-g550cc50-dirty 2020-08-26)

Debug/Developer mode for NFC Shield v2 with dnfc mode, main commands

>dnfc
dnfc2>
   show           Show DNFCv2 parameters
   frequency      Set SPI Bus frequency
   trigger        Setup DNFCv2 SPI2 trigger
   set-nfc-mode   Set NFC Mode and TX/RX BitRate in kbit/s
   get-nfc-mode   Get NFC Mode
   rf-off-on      Set RF field off/on
   reqa           Send ISO 14443-A REQA
   wupa           Send ISO 14443-A WUPA
   send           Send bytes according to the selected mode
   send-auto      Send bytes according to the selected mode and add the two-bytes CRC
   nfc-transp     Enter NFC Transparent Mode
   nfc-stream     Enter NFC Stream Mode
   read           SPI Read byte (repeat with :<num>)
   hd             SPI Read byte (repeat with :<num>) and print hexdump
   write          SPI Write byte (repeat with :<num>)
   <integer>      SPI Write byte (repeat with :<num>)
   <string>       SPI Write string
   cs-on          SPI Alias for "chip-select on"
   cs-off         SPI Alias for "chip-select off"
   [              SPI Alias for "chip-select on"
   ]              SPI Alias for "chip-select off"
   &              Delay 1 usec (repeat with :<num>)
   %              Delay 1 msec (repeat with :<num>)
   ~              SPI Write a random byte (repeat with :<num>)
   A              Toggle AUX[0](PC4) high
   a              Toggle AUX[0](PC4) low
   @              Read AUX[0](PC4)
   exit           Exit DNFCv2 mode

Debug/Developer mode for NFC Shield v2 with dnfc mode using nfc-mode and doing "manual" anti-collision on NFC-A

Example usage:

>dnfc
dnfc2> set-nfc-mode nfc-mode 1
nfc-mode = 1
nfc-mode-tx_br = 0
nfc-mode-rx_br = 0
rfalSetMode OK
dnfc2> rf-off-on
dnfc2> reqa
04 00
dnfc2> send 9320
B9 CC 13 71 17 
dnfc2> send-auto 9370B9CC137117      
20 

Debug/Developer mode for NFC Shield v2 with dnfc mode SPI low level

Example SPI low level communication with HydraNFC Shield v2 ST25R3916:

>dnfc
dnfc2>
  • Write a register in Space A
    • Write register 0x00 to value 0x00
      • [0x00 0x00]
    • Write register 0x2C to value 0x84
      • [0x2C 0x84]
  • Read a register in Space A (Register OR 0x40)
    • Read register 0x00 in Space A
      • [0x40 r]
    • Read register 0x2C in Space A
      • [0x6C r]
  • Write a register in Space B
    • Write register 0x05 to value 0x00 in Space B
      • [0xFB 0x05 0x00]
    • Write register 0x33 to value 0x84 in Space B
      • [0xFB 0x33 0x84]
  • Read a register in Space B (Register OR 0x40)
    • Read register 0x05 in Space B
      • [0xFB 0x45 r]
    • Read register 0x2C in Space B
      • [0xFB 0x73 r]
  • Send direct command
    • Set Default (Puts the ST25R3916 into power-up state)
      • [0xC0]
  • Analog Test and Observation Register 1 (Test Output CSI/CSO)
    • Write Analog Test and Observation Register 1 to value 0x05 => Pin CSI = Tag demodulator analog / Pin CSO = Tag demodulator OOK digital out
      • [0xFC 0x01 0x05]
    • Read Analog Test and Observation Register 1 (Register OR 0x40)
      • [0xFC 0x41 r]