430 Commits
Author SHA1 Message Date
GameTec-live fe56e7e231 Merge branch 'main' into fix/ble-adv-while-connected 2026-10-31 14:56:49 +01:00
GameTec-live a7dfe434ef Merge branch 'main' into fix-iso14443-4-rx-frame-truncation 2026-10-30 17:45:55 +01:00
Matthew Carroll f8951e5f21 Merge branch 'main' into fix/ble-adv-while-connected 2026-10-25 14:56:11 -07:00
GameTec-live 7de5b1b0b2 Merge branch 'main' into feat/farpointe-pyramid 2026-10-24 11:35:19 +02:00
GameTec-live 22f2c7125f Merge branch 'main' into feat/fsk-dc-robustness 2026-10-24 11:22:13 +02:00
GameTec-live b39623279c Merge branch 'main' into feature/battery-health-ui 2026-10-24 11:18:27 +02:00
Matthew Carroll 57faad7feb fix: don't start BLE advertising while connected 2026-10-20 23:52:46 -07:00
GameTec-live 14c42544ad Merge branch 'main' into main 2026-10-04 21:26:32 +02:00
GameTec-live 68c1e72e81 Merge pull request #458 from naaraxi/fix/435-sleep-timeout
#435 - Setting sleep timeout was broken
2026-10-04 21:02:57 +02:00
GameTec-live dcd0d57d37 Merge branch 'main' into feat/farpointe-pyramid 2026-10-04 11:05:31 +02:00
GameTec-live 156324b1b6 Merge branch 'main' into hfsniff-fix 2026-10-04 10:41:56 +02:00
GameTec-live 39a597b5ea Merge branch 'main' into ulc 2026-10-04 10:37:12 +02:00
alexl83 a9e05945f5 refactor(battery): make health hint capacity-driven 2026-09-14 18:50:06 +02:00
alexl83 3ab5adc919 docs(firmware): clarify battery condition hint 2026-09-14 18:50:06 +02:00
alexl83 6c9d38e883 feat(ui): reuse startup animation after battery view 2026-09-14 18:50:06 +02:00
alexl83 62d621bbb3 fix(ui): auto-restore slot leds after battery view 2026-09-14 18:50:06 +02:00
alexl83 cdc0b8c501 feat(battery): show health on-device 2026-09-14 18:50:06 +02:00
alexl83 bee0f044be feat(battery): expose battery condition in protocol 2026-09-14 18:50:06 +02:00
alexl83 76d396c208 fix(battery): calibrate full-charge reference 2026-09-14 18:50:06 +02:00
whitewhidow 49ce714743 Fix ISO14443-4 RX truncation of frames >=32 bytes (unwrap_frame uint8_t return)
nfc_tag_14a_unwrap_frame() computes the de-parity'd data-bit count in a size_t
but returns uint8_t. For any received frame of 32 bytes or more the data-bit
count exceeds 255, so the uint8_t return wraps it modulo 256, silently
truncating the frame the caller (nfc_tag_14a_data_process) then processes.

Concretely a 44-byte reader->tag command is 352 data bits; 352 & 0xFF = 96 bits
= 12 bytes, so only the first 12 bytes reach the tag/APDU layer. This breaks any
ISO14443-4 (T=CL) tag emulation that receives a command of 32+ bytes -- e.g. an
EMV GET PROCESSING OPTIONS carrying a full PDOL, where the card then answers
6700 (wrong length).

Verified on nRF52840 hardware: the NFCT RXD.AMOUNT register reports the correct
length at every frame size (396 for a 44-byte frame); only the truncated return
value was wrong. Changing the return type to uint16_t makes large commands
arrive intact.

Reproduced deterministically by having one Chameleon (RC522 reader) send
commands of increasing size to another (NFCT emulator): received length was
(frame length mod 32) before the fix, full length after.
2026-09-09 15:39:16 +02:00
DidierA 6019973929 merge master 2026-09-08 12:56:48 +02:00
Alexandru Mazalu 3c5551a4fa Merge branch 'main' into fix/435-sleep-timeout 2026-08-28 19:08:51 +03:00
Curious, aren't we? 549e4457f0 Merge branch 'main' into main 2026-08-07 23:17:24 +02:00
Alexandru Mazalu 3d405b0468 Merge branch 'RfidResearchGroup:main' into fix/435-sleep-timeout 2026-07-29 18:31:58 +03:00
Aaron Tulino (Aaronjamt) 1f99ddd4db SEOS emulation support 2026-07-28 11:18:18 -07:00
GameTec-live 3d1ffe9b47 Merge pull request #451 from wereii/perf/fsk-demod-sqrt
Deploy wiki to GitHub Pages with Jekyll / build (push) Canceled after 0s
Deploy wiki to GitHub Pages with Jekyll / deploy (push) Canceled after 0s
Firmware build / Build and push fw-builder Docker image (push) Canceled after 0s
Firmware build / Build firmware (lite) (push) Canceled after 0s
Firmware build / Build firmware (ultra) (push) Canceled after 0s
Push handler / Build Firmware (push) Canceled after 0s
Client build / Build client ((cd software/dist && zip -r "$OLDPWD/client-linux.zip" .) , linux, ubuntu-latest, true ) (push) Canceled after 0s
Client build / Build client ((cd software/dist && zip -r "$OLDPWD/client-macos.zip" .) , macos, macos-latest, true ) (push) Canceled after 0s
Client build / Build client (Compress-Archive -Path software\dist\* -DestinationPath client-windows.zip , windows, windows-latest, ? . ) (push) Canceled after 0s
Push handler / Create dev pre-release with artifacts (push) Canceled after 0s
Push handler / Create tagged release with artifacts (push) Canceled after 0s
perf(lf): drop double-precision sqrt from FSK demod hot path
2026-07-28 19:40:40 +02:00
Aaron Tulino ac63dbdac8 Merge branch 'main' into patch-iso14443-4-blockvals 2026-07-28 10:32:47 -07:00
naaraxi 42d06ad383 #435 - Setting sleep timeout was broken 2026-07-10 18:34:50 +03:00
Aaron Tulino d0b2df564b Merge branch 'main' into patch-iso14443-4-blockvals 2026-07-07 02:01:17 -07:00
Aaron Tulino d562549b5d Merge branch 'main' into patch-14443-4 2026-07-07 02:01:15 -07:00
GameTec-live 2d9c8bcc9f Merge pull request #274 from unkernet/acl
Fix state machine behavior and access bits verification in MF1 emulation
2026-07-04 13:14:59 +02:00
wereiiandClaude Opus 4.8 5c03d3253a feat(lf): DC-block FSK demod for weak-coupling robustness (HID, ioProx)
The FSK demod (fsk_feed) ran the Goertzel tone detection directly on the
raw ADC samples. Their large DC offset leaks into the fc/8 bin and biases
every decision toward bit 0; on a weakly-coupled card the AC signal is too
small to overcome it, so the whole bitstream collapses to zeros and nothing
decodes. Strong signals overrode the bias, which is why this went unnoticed.

Adds an opt-in running DC baseline tracker to the demod (fsk_t.dc_block):
a slow per-sample IIR estimate (~64-sample time constant) subtracted before
the Goertzel. Unlike a per-window mean it doesn't distort fc/8's non-integer
cycle count. Enabled for the HID Prox and ioProx modems.

Validated on hardware (HID H10301, FC 12 / CN 3456 on a T55xx clone):
  - well coupled  (std 25): stock reads;        with fix 5/5
  - weak coupled  (std 15): stock fails 4/4;     with fix 4/5 correct
  - very weak     (std 11): stock fails;         with fix reads (occasional
    misread — HID 26-bit has only parity, no CRC, so marginal bit errors can
    pass; this is an HID format limitation, not introduced here)
ioProx uses the identical demod path; enabled by analogy (no card to test).

The same dc_block path is reused by the Farpointe/Pyramid reader, which is
stacked on top of this commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:40:03 +02:00
wereiiandClaude Opus 4.8 09de8d75d9 feat(lf): add Farpointe/Pyramid tag emulation and reader
Adds full Farpointe/Pyramid (FSK2a, RF/50, 128-bit frame) LF support to
the Chameleon Ultra firmware: emulation, reading/decoding, and the
T55x7-equivalent on-air frame handling.

Emulation (modulator):
- New protocols/pyramid.c/.h replays the raw 128-bit frame. FSK2a needs
  exact RF/50 bit-period alignment (unlike HID/ioProx which emit a fixed
  integer cycle count per bit): the 15-bit all-fc/8 preamble run drifts
  if each bit is a fixed 6 cycles (48 ticks) instead of 50, dropping a
  preamble bit so fixed-clock readers fail. A phase accumulator keeps
  every bit boundary on its exact (i+1)*50-tick mark.
- TAG_TYPE_FARPOINTE_PYRAMID registered in tag_base_type.h /
  tag_emulation.c, with load/save/factory callbacks in lf_tag_em.c.

Reader (decoder):
- Streaming FSK demod -> 256-bit ring -> scan for the 24-bit preamble,
  then triple-gate a candidate frame: 24-bit preamble + odd parity on
  every 8-bit group + CRC-8/Maxim trailer. A read returns the raw 16-byte
  frame (same layout as emulation, so a read can be written to a slot).
- lf_pyramid_data.c (pyramid_read), scan_pyramid in lf_reader_main, and
  DATA_CMD_PYRAMID_SCAN (3021) in app_cmd.c.

Weak-coupling demod:
- The Pyramid tag couples poorly on this antenna, so reading relies on the
  opt-in DC-block demod added in the preceding commit and enables it for
  the Pyramid modem (pyramid.c, fsk_t.dc_block). Without it the raw 14-bit
  SAADC DC offset leaks into the fc/8 Goertzel bin and pins every decision
  to bit 0, so nothing decodes.

Build hygiene:
- Drop the temporary -Wno-error from application/Makefile and fix the
  pre-existing unused-but-set 'blk_num' warning (newer GCC) so the tree
  builds clean under -Werror again.

Validated on hardware against a physical Farpointe tag: emulation reads
back on Proxmark and `lf pyramid` reading decodes it (len 82, Card 11231,
Raw 0001014a3e0101010101014ae35e7f4f).

Note: tag type 202 and command 3021 are local IDs pending upstream
coordination.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:40:03 +02:00
wereiiandClaude Opus 4.8 ab59e7af00 perf(lf): drop double-precision sqrt from FSK demod hot path
The build targets the Cortex-M4F single-precision FPU (-mfpu=fpv4-sp-d16),
which has no double-precision hardware. goertzel_mag() used sqrt() (double):
the float result was promoted to double for the call and converted back, and
a software double-sqrt routine ran -- twice per decoded bit.

The bit decision only compares the two Goertzel outputs, and power is
monotonic with magnitude, so the sqrt is unnecessary. goertzel_power()
returns the squared magnitude and fsk_feed() compares that directly. This
also removes a latent sqrt(NaN): the magnitude argument can round slightly
negative near zero signal, which sqrt() turned into NaN (and NaN comparisons
make the bit decision unreliable); comparing the raw power is well-defined.

The old goertzel_mag() had no callers anywhere and was not declared in the
header, so it is removed rather than kept.

Shared by all FSK readers (HID Prox, ioProx, Pyramid): bit decisions are
identical, the soft-float double dependency is gone, and the time-sensitive
demod loop is slightly faster.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:06:18 +02:00
DidierA 2239acdd06 nfc_tag_14a_event_callback: remove wrong parity bit computation, which failed when there was more than 7 parity bits. Fixes #444 2026-06-18 20:09:12 +02:00
DidierA c3b08be5df blk_num is unused, which caused build to fail. 2026-06-18 20:06:34 +02:00
Aaron Tulino (Aaronjamt) 81ce26a15b Fix CID and add PPS 2026-06-17 01:47:31 -07:00
Aaron Tulino (Aaronjamt) 4b2c29fa0b nfc_tag_14a_4_reset_state function needs passed pointer 2026-06-16 21:48:13 -07:00
Aaron Tulino (Aaronjamt) 909a7e7eda Fix ISO14443-4 block values 2026-06-16 15:14:27 -07:00
Aaron Tulino (Aaronjamt) f7350ce11e send_* functions need passed pointers 2026-06-16 12:14:22 -07:00
Aaron Tulino (Aaronjamt) 976ee266b7 Pass by reference, not value 2026-06-13 21:51:45 -07:00
Aaron Tulino (Aaronjamt) c0477cd961 Export low-level ISO14443-4 handling 2026-06-13 16:49:12 -07:00
Foxushka d8e85d53dc feat: add change key command 2026-06-13 13:01:15 +03:00
Foxushka 2999d9dd5f feat: MIFARE Ultralight C authentication and emulation 2026-06-13 11:38:40 +03:00
unkernet 779bab265e Fix: mf1 encrypted HALT logic 2026-05-30 21:09:31 +07:00
unkernet ca6c299865 Merge branch 'main' into acl 2026-05-30 12:28:48 +07:00
Curious, aren't we? f0566dd720 Add long button press threshold as a user setting 2026-05-26 17:19:31 +02:00
Milan DavídekandClaude Opus 4.7 38689a82ba Move JABLOTRON_WRITE_TO_T55XX from 3017 to 3020
Keep SCAN(3019)/WRITE(3020) adjacent, matching the SCAN+WRITE
adjacency convention used by every other LF protocol
(EM410X 3000/3001, HIDPROX 3002/3003, VIKING 3004/3005,
IOPROX 3010/3011, PAC 3014/3015). Slot 3017 is now free for
future use.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:01:58 +02:00
Milan DavídekandClaude Opus 4.7 52f37bff8d Merge upstream/main into Jablotron PR #404
Resolved conflicts from upstream feature additions (IDTECK PR #407,
LF_T55XX_WRITE PR #413, ISO14443-4 T=CL emulation, HF14A scan-keep,
etc.) by keeping both sides where independent.

Command ID note for reviewer:
- Maintainer's IDTECK shift commit (1e78976) stated "Jablotron retains
  the original slots 3016 and 3017", but upstream had already taken
  3016 for DATA_CMD_LF_T55XX_WRITE. Only 3017 was actually free.
- Resolution: JABLOTRON_WRITE_TO_T55XX kept at 3017 (honors intent).
  JABLOTRON_SCAN moved 3016 -> 3019 (next free slot).
- 5xxx range: JABLOTRON_SET/GET_EMU_ID = 5010/5011 unchanged
  (IDTECK shifted to 5012/5013 as planned).

Python files parse cleanly. No duplicate command IDs in data_cmd.h
(3xxx and 5xxx ranges checked).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:51:54 +02:00
matteoscrugli 1e78976bd9 feat(lf): shift IDTECK command IDs to avoid collision with Jablotron PR #404
LupusE requested in the PR #407 review (2026-05-13) to move IDTECK
command IDs since PR #404 (Jablotron) also uses 3017 / 5010 / 5011.
Both PRs are open with the feature-freeze label; Jablotron retains
the original slots and IDTECK shifts up:

  DATA_CMD_IDTECK_WRITE_TO_T55XX: 3017 -> 3018
  DATA_CMD_IDTECK_SET_EMU_ID:     5010 -> 5012
  DATA_CMD_IDTECK_GET_EMU_ID:     5011 -> 5013

Files changed:
- firmware/application/src/data_cmd.h
- software/script/chameleon_enum.py

app_cmd.c references the constants by name only, no edit needed there.
2026-05-15 10:09:51 +02:00