Commit graph

60 commits

Author SHA1 Message Date
pwpiwi 7a53739728 fixing some fpga and iclass issues
* make fpga_version_info.c phony and delete it on 'make clean'
* wait for transfer to complete before returning from FpgaSendCommand()
* log correct tag times in iclass simulation
* shorten pulse from TC1 to TC0 in StartCountSspClk()
* shorten ssp_frame pulse in fpga/hi_reader.v
* some reformatting and whitespace fixes
2020-03-31 08:39:16 +02:00
pwpiwi 00848e096b
Hitag fixes (#887)
* don't display error message during 'lf search' when no Hitag tag is present
* remove superfluous options in 'lf hitag read'
* fix setting of default threshold when selecting FPGA_CMD_SET_EDGE_DETECT_THRESHOLD major mode
* some refactoring
2019-11-25 08:38:23 +01:00
pwpiwi cd028159be implement 'hf iclass snoop -j'
* fix long option --jam
* make room for one more bit for FPGA minor mode
* new mode FPGA_HF_READER_MODE_SEND_JAM
* implement jamming in Handle15693SampleFromReader
2019-11-13 18:03:40 +01:00
pwpiwi be09ea8603 fix 'hf iclass snoop'
* code deduplication: use ISO15693 snoop function
* speed up SnoopIso15693(), reduce DMA buffer size
* add jamming option '-j' to 'hf iclass snoop'
* fix issue #882
* whitespace fixes
2019-11-13 18:03:39 +01:00
pwpiwi c41dd5f9f6 fix 'hf iclass reader'
* code deduplication. Use functions from iso15693.c
* speedup CodeIso15693AsReader()
* invert reader command coding. 0 now means 'unmodulated' ( = field on)
* decode SOF only as a valid tag response in Handle15693SamplesFromTag()
* complete decoding of EOF in Handle15693SamplesFromTag()
* determine and write correct times to trace
* FPGA-change: generate shorter frame signal to allow proper sync in StartCountSspClk()
* modify StartCountSspClk() for 16bit SSC transfers
* whitespace in util.c
* add specific LogTrace_ISO15693() with scaled down duration. Modify cmdhflist.c accordingly.
* allow 'hf 15 raw' with single byte commands
* check for buffer overflow, card timeout and single SOF in 'hf 15 raw'
2019-10-21 21:48:08 +02:00
pwpiwi 8efd0b80f2 fix 'hf iclass sim'
* fix tag response timing. iClass differs from ISO15693 in this respect.
* speedup CodeIso15693AsTag()
* TransmitTo15693Tag(): don't send unmodulated start of SOF
* reduce modulation depth in hi_simulate.v
* calculate CRC for configuration block when simulating
* Show real response time instead of planned response time in 'hf list iclass'
2019-10-08 11:04:30 +02:00
pwpiwi 5b12974a7f fix 'hf iclass sim':
* chg to reader command decoder in iso15693.c (require no modulation before SOF)
* add 'has_been_low_for' logic to hi_simulate.v (same as in other FPGA modes, default to "no modulation")
* add simulation of chip status (IDLE, ACTIVE, SELECTED, HALTED)
* check ACSN on SELECT
* add simulation of RESELECT
* always check length of reader commands
* fix printing of NR, MAC in sim 2 mode
* fix response length to CHECK command
2019-09-24 19:23:21 +02:00
pwpiwi a66f26da18 fix 'hf iclass sim':
* add simulation of block 3 and 4 reads
* add simulation of READ4 (4 blocks read)
* fixing TransmitTo15693Reader()  (again)
* FPGA change (hi_simulate.v): avoid spp_clk phase changes
* some whitespace fixes
2019-09-11 07:54:56 +02:00
pwpiwi 5ea2a24839
FPGA changes (#803)
* merge hf_rx_xcorr and hf_tx modes into one module with common ssp_clk and ssp_frame
* get rid of most of the warnings when compiling the HF verilog sources
* refactoring the constants in Verilog sources
2019-03-24 18:11:41 +01:00
pwpiwi fc52fbd42f
Add raw HF signal plotting (#786)
* Add raw HF signal plotting
* new fpga module hi_get_trace.v - store A/D converter output to circular buffer on FPGA
* new command 'hf plot' - pull data from FPGA and display it in Graph Window
2019-02-20 19:18:12 +01:00
pwpiwi d9de20fa4b
Fix 15 snoop (#752)
* fixing hf 15: implement hf 15 snoop
* rename hf 15 record to hf 15 snoop
* speedup sampling / decoding:
*   new FPGA mode FPGA_HF_READER_RX_XCORR_AMPLITUDE implements amplitude(ci, cq) on FPGA
*   inlining the decoders in iso15693.c
*   inlining memcpy/memset in LogTrace()
*   giving up the moving correlator for SOF in Handle15693SamplesFromTag
* decode more of EOF in Handle15693SamplesFromTag()
* some refactoring
2019-01-12 13:28:26 +01:00
pwpiwi 8c6cca0ba1
Fix hf 15 sim (#696)
* added ISO15693 coding for tag messages (CodeIso15693AsTag())
* added ISO15693 decoding for reader commands (Handle15693SampleFromReader())
* send tag inventory response in either high or low speed
* some refactoring and formatting
2018-10-23 08:22:13 +02:00
pwpiwi 6a5d4e17f4
rework iso14443b device functions including FPGA I/Q signal transfer (#669)
* rework iso14443b device functions
* hf_read_rx_xcorr.v: transfer i/q pair in one 16bit frame
* hi_read_tx.v: invert ssp_dout. When nothing is transferred (ssp_dout=0), this results in no modulation (carrier on)
* adjust arm sources accordingly
* iso14443b.c: switch off carrier after hf 14b sri512read and hf 14b srix4kread
* iso14443b.c: fix DMA circular buffer handling
2018-09-16 00:53:28 +02:00
AntiCat 1b902aa01a Legic Tag Simulator (#666)
* FPGA Hi-Simulate: Formatted code
* FPGA Hi-Simulate: Fixed documantation
* FPGA Hi-Simulate: Freed up 4 LUTs
* FPGA Hi-Simulate: Added 212kHz SSP-Clock option
* Legic: Moved card simulator into separate file & cleaned interface.
Reader and card simulation have almost no common code. Moreover the sim
uses an SSP Clock at 212kHz for all timings to prevent any drifting from
the PRNG. This clock speed is not available in reader simulation mode (SSP
runs at up to 3.4MHz, and changes speed between TX and RX). For these
reasons having the code in separate files makes it significantly cleaner.
* Legic: Implemented RX and TX for card simulation
* Legic: Implemented setup phase for card simulation
* Legic: Implemented read command for card simulation
* Legic: Implemented write command for card simulation
2018-09-09 16:40:20 +02:00
AntiCat da05bc6eca Legic: rewrite reader to use xcorrelation and precise timing (#654)
* Legic: rewrite reader to use xcorrelation and precise timing
 - Even tough Legic tags transmit just AM, receiving using
   xcorrelation results in a significantly better signal
   quality.
 - Switching from bit bang to a hardware based ssc frees
   up CPU time for other tasks e.g. prng and demodulation
 - Having all times based on a fixed ts, results in perfect
   rwd-tag synchronization without magic +/- calculations.
* hi_read_tx: remove jerry-riged hysteresis based receiver
- This feature got obsolete by a x-correlation based receiver.
* Legic: adjusted sampling to new ssp clock speed
- Sampling is 4 times faster and pipeline daly reduced to 1/4.
 The new code samples each bit earyler to account for the
 shorter pipeline. That introduced bit errors by leeking the
 next bit into the current one.
* Legic: average 8 samples for better noise rejection.
* Update CHANGELOG.md
2018-08-20 22:29:34 +02:00
pwpiwi 315e18e66c
ISO15693 device side improvements (#652)
* ISO15693 device side improvements
* increase accuracy by doubling the sample frequency (hi_read_rx_xcorr.v)
* adjust armsrc/iso15693.c and client/cmdhf15.c accordingly
* use more accurate approximation for sqrt(ci^2 + cq^2)
* improve EOF detection (was often mistaken for Logic0, resulting in "error, uneven octet! (extra bits!)")
* hi_read_r_xcorr.v: avoid overflows during accumulation and truncation
* explicitely cast unsigned ADC samples to signed
2018-08-15 14:03:20 +02:00
pwpiwi 82f4955245 Merge branch 'master' into fix_hfmfsim 2017-11-02 21:37:42 +01:00
pwpiwi b35e04a7c6 fix hf mf sim:
* more timing fixes
* correctly determine correction bit (taken from iceman's fork)
* add checking of Access Conditions for Read command
* never allow reading KeyA
2017-11-02 21:29:08 +01:00
pwpiwi d372569b45 FPGA changes ISO14443B:
* slightly increase reader field strength
* increase sensitivity when reading, allowing increased reading distance
2017-10-21 10:36:01 +02:00
pwpiwi 3f7aaf24fb revert removal of quarter frequency support for hi_read_rx_xcorr.v 2017-07-13 08:48:27 +02:00
pwpiwi b535053a77 fix hf 15 commands (#293) 2017-05-26 07:10:30 +02:00
etmatrix 82d589348c - Correct little distraction on fpga/Makefile
- New patch from pwpiwi works very well for hi_sniffer.v
- Restored previous fpga_lf.bit
2015-11-02 09:08:21 +01:00
etmatrix 0472d76de4 The great work of Enio hf snoop is now ported into latest version in git
you can find original work here https://github.com/EnioArda/proxmark3
2015-10-23 15:40:35 +02:00
pwpiwi 705bfa1058 fixing iso14443b (issue #103):
- increased DMA_BUFFER_SIZE to avoid occasional circular buffer overflows.
- minor code cleanups
2015-06-22 22:03:43 +02:00
pwpiwi 467340996e fixing iso14443b (issue #103):
- fix hf 14b snoop
- fix hf 14b sim
2015-06-21 18:04:24 +02:00
pwpiwi da586b1702 fixing iso14443b (issue #103):
- revert removal of FPGA_HF_READER_RX_XCORR_848_KHZ. Need to be able to switch to 424kHz for ISO15693.
2015-06-18 15:41:30 +02:00
pwpiwi 51d4f6f114 fixing iso14443b (issue #103):
- fix: IQ demodulator (FPGA)
- fix: approximately align reader signal delay to tag response delay (FPGA)
- fix: remove deprecated RSSI calculation to improve decoder speed (iso14443b.c)
- fix: better approximation of signal amplitude to avoid false carrier detection (iso14443b.c)
- fix: remove initial power off in iso14443b raw command (iso14443b.c)
- add: enable tracing for iso14443b raw command (iso14443b.c)
- fix: client crashed when checking CRC for incomplete responses (iso14433b.c)
- speeding up snoop to avoid circular buffer overflow
- added some comments for better documentation
- rename functions (iso14443 -> iso14443b)
- remove unused code in hi_read_rx_xcorr.v
2015-06-17 20:27:36 +02:00
pwpiwi 09c66f1f09 fixing iso14443b (issue #103): fix timing issue (speeding up
the decoders)
2015-06-03 13:28:28 +02:00
pwpiwi 5b95953d42 fixing iso14443b (issue #103):
- most significant bit of tag data (which happens to be the sign bit)
had been dropped when snooping (FPGA change)
- avoid trying to decode both tag and reader data when snooping (we don't
have the time to do so).
2015-06-02 22:50:16 +02:00
pwpiwi 30364d2711 fix: broken edge detector implementation in hi_iso14443a.v resulted in decreased sensitivity 2015-03-09 20:01:37 +01:00
pwpiwi 7843130a58 fix: (issue #72) LF simulation didn't work with lo_edge_detect.v 2015-03-06 07:42:54 +01:00
pwpiwi 7554370c30 bugfix hf 14a sim / hf mf sim: polarity of tag subcarrier modulation was wrong 2015-02-11 21:14:34 +01:00
Martin Holst Swende 09b69422e2 This was resynthezised along with my hf-changes. Nothing changed though 2015-01-15 15:29:03 +01:00
Martin Holst Swende 645c960f61 Implemented new FPGA mode for iclass tag simulation. Reduces arm-side size of transfer/memory by a factor of 8. Makes for easier arm-side encoding of messages, for when we start needing to do that on the fly instead of using precalculated messages 2015-01-15 15:16:34 +01:00
iZsh 238c503c38 fpga/min_max_tracker.v: english 2014-06-27 23:28:56 +02:00
iZsh 3b2fee43ea New LF edge detection algorithm + lowpass filter
This is a new LF edge detection algorithm for the FPGA.

- It uses a low-pass IIR filter to clean the signal
(see https://fail0verflow.com/blog/2014/proxmark3-fpga-iir-filter.html)
- The algorithm is able to detect consecutive peaks in the same
  direction
- It uses an envelope follower to dynamically adjust the peak thresholds
- The main threshold used in the envelope follower can be set from the ARM side

fpga/lf_edge_detect.v,
fpga/lp20khz_1MSa_iir_filter.v,
fpga/min_max_tracker.v: New file.

fpga/lo_edge_detect.v, fpga/fpga_lf.v: Modify accordingly.

armsrc/apps.h (FPGA_CMD_SET_USER_BYTE1,
FPGA_CMD_SET_EDGE_DETECT_THRESHOLD): New FPGA command.
fpga/fpga_lf.v: Modify accordingly/Add a 8bit user register.

fpga/fpga_lf.bit: Update accordingly.

fpga/tests: New directory for testbenches

fpga/tests/Makefile: New file. It compiles the testbenches
and runs all the tests by default (comparing with the golden output)

fpga/tests/tb_lp20khz_1MSa_iir_filter.v,
fpga/tests/tb_min_max_tracker.v,
fpga/tests/tb_lf_edge_detect.v: New testbenches

fpga/tests/plot_edgedetect.py: New script to plot the results from
the edge detection tests.

fpga/tests/tb_data: New directory for data and golden outputs
2014-06-27 14:27:03 +02:00
iZsh b014c96d68 new command "lf snoop" to snoop raw ADC values
fpga/lo_read.v (lf_field): new argument.
fpga/fpga_lf.v: modify accordingly.

armsrc/apps.h (FPGA_MAJOR_MODE_LF_READER): Rename as FPGA_MAJOR_MODE_LF_ADC.
armsrc/apps.h (FPGA_LF_ADC_READER_FIELD): New LF option.
armsrc/lfops.c: Modify accordingly.

client/cmdlf.c (CmdLFSnoop): New command.
armsrc/appmain.c, armsrc/lfops.c, client/cmdlf.h, include/usb_cmd.h: Modify accordingly.
2014-06-21 21:33:54 +02:00
iZsh fa57f6e12e fpga/fpga_hf.v, fpga_lf.v, lo_edge_detect.v, lo_passthru.v, lo_read.v: copyright notice 2014-06-20 12:38:58 +02:00
iZsh 7cc204bff8 THIS REQUIRES A BOOTROM UPDATE!! To save FPGA area, split the LF and HF bitstreams and load them on-demand. 2014-06-20 01:02:59 +02:00
Martin Holst Swende 94090295a7 new fpga image for better iso15693 simulation 2014-06-07 21:44:45 +02:00
Martin Holst Swende 12401d8dbc Added 424KHz mode for iso 15693 simulation 2014-06-07 21:39:52 +02:00
pwpiwi d714d3effc Improvements/Fixes to 14443 sniffing/snooping
- fixed a circular buffer rollover bug in iso14443a.c
- fixed 7 Byte UID handling in hf mf sniff
- fixed "cannot append" error in hf mf sniff d
- fixed hint on mfkey32 in hf mf sim x
- fixed hf mf sniff sometimes showing rogue data from previous calloc
- improve snooping/sniffing by syncing modulation detector window with reader signal (hi_iso14443a.v)
- code cleanup of hi_iso14443a.v
2014-03-25 21:38:24 +01:00
micki.held@gmx.de 552cbc5890 iso14444a: minor FPGA bugfix 2014-02-25 06:49:49 +00:00
micki.held@gmx.de d7aa3739a9 More robust iso14443a sniffing/simulation functions by
- iso14443a.c: less strict Miller/Manchester decoders
- FPGA hi_iso14443a.v: syncing on external readers' clock when simulating and sniffing.
2014-02-23 15:46:19 +00:00
micki.held@gmx.de 7bc95e2e43 - fixed iso1443a ManchesterDecoder in order to fix broken Snoop/Sniff
- enhanced tracing: hf 14a list now shows meaningful timing information. With new option f it also shows the frame delay times (fdt)
- small fix for hf 14b list - it used to run into the trace trailer
- hf 14a sim now obeys iso14443 timing (fdt of 1172 or 1234 resp.)
Note: you need to flash FPGA as well.
More details in http://www.proxmark.org/forum/viewtopic.php?pid=9721#p9721
2014-02-19 20:35:04 +00:00
micki.held@gmx.de e691fc45bc - improved reader sensitivity for 14443a cards (FPGA change!)
- implemented ISO 14443A anticollision loop
See http://www.proxmark.org/forum/viewtopic.php?id=1797 further details
2013-11-19 18:52:40 +00:00
roel@libnfc.org d19929cbe8 MAJOR update, added hitag2 reader, emulation and eavesdropping, lots of new code, including FPGA tweaks, part 2 2012-09-18 13:53:17 +00:00
bushing ba06a4b694 setting svn:eol-style=native on files, part 3
(should be done now, sorry)
2010-02-22 19:29:05 +00:00
henryk@ploetzli.ch 8d40aba58b Add capability to correlate against subcarriers of 212kHz (argument FPGA_HF_READER_RX_XCORR_QUARTER_FREQ | FPGA_HF_READER_RX_XCORR_848_KHZ) and 106kHz (argument FPGA_HF_READER_RX_XCORR_QUARTER_FREQ) 2009-12-09 02:31:01 +00:00
henryk@ploetzli.ch 24fe4dffb4 Jerry-rig a simply hysteresis based receiver into hi_read_tx. Output is via SSC_DIN, which wasn't used in that mode before. 2009-11-06 15:36:57 +00:00