403 Commits
Author SHA1 Message Date
Daniel Wagner a421e99648 request hfxo 2026-03-30 15:37:29 +01:00
Kevin Yuan 9e58461f9a Potential fix: Compare glitch in PWM module 2026-03-24 17:04:18 +00:00
Kevin Yuan f5d721bbfd PAC/Stanley CLI: replace --id with --cn/--raw (PM3 parity)
Split the single --id argument into --cn (8 ASCII chars) and --raw
(32 hex char T55XX bitstream, directly compatible with PM3 raw output).
Add Python-side PAC bitstream encoder/decoder for raw format support.
Output now shows CN and Raw labels matching PM3's format.

Add NRF_LOG module registration to pac.c for debug logging,
consistent with other protocol implementations.

Reassign PAC command IDs (3014/3015) to avoid collision with ioProx
(3010/3011) after rebase onto upstream/main.
2026-03-24 15:04:41 +00:00
Kevin Yuan ccf4510c1c Improve PAC/Stanley NRZ reader reliability
Three fixes that together bring rapid-fire read reliability from ~20%
to 100%:

- Add MIN_SPIKE_CAP floor (8000) to prevent spike_cap from clipping
  NRZ high when prescan correctly captures NRZ low. Without this,
  spike_cap = raw_min*3 ≈ 2820 collapses the signal range.

- Reorder carrier-before-SAADC in pac_read(): start the 125kHz field
  and wait 10ms before enabling ADC sampling, so prescan calibration
  sees real NRZ signal levels rather than T55XX power-on-reset noise.

- Add auto-recalibration: if no valid frame is found after 20480
  Phase 3 samples (~164ms, ~5 frame periods), reset the decoder to
  Phase 1 and re-calibrate from fresh samples. This gives ~3
  calibration attempts per 500ms scan window instead of just one.

Tested with Proxmark3 sim (15 consecutive rapid-fire reads, 100%) and
T55XX tag (write-read roundtrip + 15x rapid-fire, 100%).
2026-03-24 14:38:46 +00:00
Kevin Yuan 8442bea4c1 Add PAC/Stanley T55XX write support
Add pac_t55xx_writer() for encoding PAC card data into T55XX blocks,
along with the T5577_PAC_CONFIG (NRZ/Direct, RF/32, password-protected,
4 data blocks). Wire DATA_CMD_PAC_WRITE_TO_T55XX (3011) through the
command processor, dispatch table, and Python client.
2026-03-24 14:38:46 +00:00
Kevin Yuan 17ff2abf60 Replace moving average with PM3-style per-sample thresholding and fix integer overflows
Replace the 32-sample moving average + hysteresis demodulation with
Proxmark3-inspired per-sample thresholding and dead zone. This
eliminates ~16 samples of group delay per edge, reducing timing
jitter from ~11 samples to ~2-3 samples.

The new approach:
- Prescan: track raw_min, compute spike_cap (unchanged)
- Warmup: track min/max of clipped samples directly (not averaged)
- Detection: per-sample dead zone classification — sample >= high
  threshold → 1, sample <= low threshold → 0, between → keep
  previous state. Thresholds set at 75% fuzz of signal range.

Removes the avg_buf[32] circular buffer, avg_sum, avg_idx, and
sum-unit threshold/hysteresis state. Struct is 72 bytes smaller.

Widen integer types to prevent overflow UB:
- sample_count: uint16_t -> uint32_t (overflows at 524ms)
- interval, nbits: uint16_t -> uint32_t (matching sample_count width)
2026-03-24 14:38:46 +00:00
Kevin Yuan 2fd1a260cf Add PAC/Stanley LF tag emulation support
Implements NRZ/Direct modulation at RF/32 for PAC/Stanley tag emulation.
The modulator encodes 8-byte ASCII card IDs into 128-bit NRZ frames
(0xFF sync + 12 UART frames) and generates PWM waveforms using constant
output levels (compare=counter_top for HIGH, compare=0 for LOW).

Firmware: modulator in pac.c, load/save/factory callbacks in lf_tag_em,
tag_emulation registration, SET/GET_EMU_ID commands (5006/5007).
CLI: pac_set/get_emu_id methods, 'lf pac econfig' command, hw slot list
display for PAC tags.
2026-03-24 14:38:46 +00:00
Kevin Yuan c494a2cc81 Add PAC/Stanley LF tag reading support
Implements NRZ/Direct modulation decoder for PAC/Stanley 125kHz cards
using SAADC ADC sampling with spike-aware threshold calibration.
The LC antenna produces brief high-amplitude transients at NRZ transitions
which are clipped before the moving-average filter to isolate the actual
data levels.
2026-03-24 14:37:25 +00:00
taichunmin c51051b30e Fix firmware application USB serial number 2026-03-24 00:44:36 +08:00
Jozef Bernadic e4d70d1417 fix(cmd): resolve ioProx command ID conflict with #362 2026-03-19 08:25:59 +01:00
Jozef Bernadic 202c6a677e feat(lf): integrate ioProx into LF reader, emulation and T55xx writer pipeline 2026-03-03 16:24:26 +01:00
Jozef Bernadic 36645932de feat(lf): add ioProx support (reader, emulation and T55xx writer) 2026-03-03 16:24:08 +01:00
WillyJL 4bafe186b3 Symmetric animation mode for boot, shutdown, usb 2026-02-18 20:47:56 +01:00
WillyJL 402665cd75 Minimal shutdown and post-flash boot animations 2026-02-18 20:47:55 +01:00
WillyJL 9f25debe4d Fix rgb_marquee_sweep_from_to() to the left 2026-02-18 20:47:55 +01:00
WillyJL f2225767a2 Give useful names to ledblink*() functions 2026-02-18 20:47:54 +01:00
Benjamin Moeller c7aebdf168 Fix Part2, because of multiple PR used the same ID. 2026-02-07 23:16:08 +01:00
GameTec-liveandGitHub d7ae363099 Merge pull request #343 from LupusE/main
Fix compiler error  `a label can only be part of a statement and a de…
2026-02-07 20:44:36 +01:00
GameTec-liveandGitHub 38e3567add Merge pull request #306 from merlokk/lf_read_adc
Adds generic ADC read functionality
2026-02-07 20:42:25 +01:00
Benjamin MøllerandGitHub 7a69e68b3f Update nfc_mf0_ntag.c (braces instead of simicolon)
Changed formatting of the fix for a more union layout, as suggested in the comments.
2026-02-06 22:36:02 +01:00
GameTec-liveandGitHub 3755bc24ce Merge pull request #307 from azuwis/hf-14a-config
Add `hf 14a config` to deal with badly configured cards
2026-02-06 11:19:23 +01:00
Benjamin MøllerandGitHub 5d2946ffaa Merge branch 'RfidResearchGroup:main' into main 2026-02-04 13:10:05 +01:00
Alexandru MazâluandGitHub 35192d9fc1 Merge branch 'RfidResearchGroup:main' into main 2026-02-03 12:49:45 +02:00
Benjamin Moeller 54b302356a Fix compiler error a label can only be part of a statement and a declaration is not a statement 2026-02-02 17:00:21 +01:00
Zhong Jianxin b967bdcd98 Add hf 14a config to deal with badly configured cards 2026-02-02 20:48:03 +08:00