Commit Graph
22673 Commits
Author SHA1 Message Date
Niel Nielsen d49a5299b0 Refine low battery shutdown conditions
Update low battery shutdown logic to require corroboration from both voltage and SoC.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-29 19:10:08 +02:00
Philippe Teuwen 09bf8fb04e doc 2026-08-29 18:33:01 +02:00
iceman1001 7fade30465 remove commented out code 2026-08-29 17:48:25 +02:00
iceman1001 b0125c036e removed CMD_SMART_SETBAUD since we dont use it any more. Thanks Claude! 2026-08-29 17:46:06 +02:00
iceman1001 35c098d489 make style 2026-08-29 17:42:29 +02:00
iceman1001 a0a3eb4bbf remove CMD_LF_SIMULATE_BIDIR, never implemented 2026-08-29 17:38:41 +02:00
iceman1001 026a1c7648 fixed missing waits for return OPcodes 2026-08-29 17:30:07 +02:00
iceman1001 297d5cef4b fix argparser 2026-08-29 17:15:52 +02:00
iceman1001 0a0d7f19c3 fixed another MIX command laying around 2026-08-29 17:11:43 +02:00
iceman1001 c5ee0ea3d5 fix leftover oldarg in lua scripts 2026-08-29 17:07:33 +02:00
iceman1001 0fbd4aa6a7 text 2026-08-29 17:06:38 +02:00
iceman1001 1ee41ecf95 fix leftover oldargs 2026-08-29 17:06:24 +02:00
iceman1001 87b5ee37c9 stablize download trace more 2026-08-29 17:02:15 +02:00
iceman1001 0f11c5c4d1 Phase E - dismantle MIX functionality 2026-08-29 16:50:29 +02:00
iceman1001 07a0ff70db fix string formatting CodeQL 2026-08-29 16:42:01 +02:00
iceman1001 ff56ec85f9 missed one 2026-08-29 16:35:13 +02:00
iceman1001 11f5e58136 text 2026-08-29 16:34:47 +02:00
iceman1001 177d240ee3 dangling code parts 2026-08-29 16:34:08 +02:00
iceman1001 094bed1176 remove MIX bindings in lua 2026-08-29 16:33:16 +02:00
iceman1001 bd20f7cc81 OLD/MIX convert to NG: Phase D. reworked all lua scripts to handle and behavie same way. Thanks Claude 2026-08-29 16:31:01 +02:00
iceman1001 24a9a686ea Update doc with lessons. Thanks Claude 2026-08-29 16:09:45 +02:00
iceman1001 85ce9c94c4 OLD/MIX convert to NG: Phase C11 2026-08-29 16:03:00 +02:00
iceman1001 7b7ec48bd9 OLD/MIX convert to NG: Phase C10 2026-08-29 15:50:36 +02:00
iceman1001 72ff6a5b80 OLD/MIX convert to NG: Phase C9 2026-08-29 15:18:54 +02:00
iceman1001 721641428c OLD/MIX convert to NG: Phase C8 2026-08-29 15:13:34 +02:00
iceman1001 0bbc9025ae OLD/MIX convert to NG: Phase C7 2026-08-29 15:00:03 +02:00
iceman1001 3762130c42 OLD/MIX convert to NG: Phase C6 2026-08-29 14:48:36 +02:00
iceman1001 5589cbf847 OLD/MIX convert to NG: Phase C5 2026-08-29 14:31:34 +02:00
iceman1001 d1cc742987 OLD/MIX convert to NG: Phase C4 2026-08-29 14:24:11 +02:00
iceman1001 f42564283e OLD/MIX convert to NG: Phase C3 2026-08-29 14:19:26 +02:00
iceman1001 ad629c77e8 OLD/MIX convert to NG: Phase C2 2026-08-29 14:12:22 +02:00
iceman1001 5c7e9f6c42 OLD/MIX convert to NG: Phase C1 2026-08-29 13:58:42 +02:00
iceman1001 1a3f64960a OLD/MIX convert to NG: Phase C 2026-08-29 13:50:49 +02:00
iceman1001 bbc8cc25b2 OLD/MIX convert to NG, Phase B 2026-08-29 13:30:07 +02:00
iceman1001 99c58f9dea NG: iso14a_raw_cmd_t, convert hf 14a raw, dual-mode reader handler. A multi step process, this is the first step. Thanks Claude 2026-08-29 13:06:28 +02:00
iceman1001 795d6f6fe3 simplify hf em 4x50 eload. all fits in one usb package 2026-08-29 12:48:20 +02:00
iceman1001 d71ee36996 reserve space for cmd struct and proper available space 2026-08-29 12:47:13 +02:00
iceman1001 7bfbde93fc widen detection for flipper ultralight dump files 2026-08-29 12:36:59 +02:00
iceman1001 2677ee541e added support for flipper iso15693 .nfc dump files. Thanks Claude 2026-08-29 12:33:05 +02:00
iceman1001 b3048064f6 converted CMD_LF_EM4X50_ESET to NG frame, thanks Claude 2026-08-29 12:20:56 +02:00
iceman1001 899ad1d467 NG: retag bootloader CMD_PING as SendCommandBL 2026-08-29 11:28:55 +02:00
iceman1001 d7ed0d5a96 NG: convert CMD_LF_T55XX_SET_CONFIG to t55xx_setconfig_t 2026-08-29 11:28:29 +02:00
iceman1001 0dc844ace6 text 2026-08-29 11:19:56 +02:00
iceman1001 0ae01a5331 new ISO15693 dump file format with converters added. Needed since 0x100 pages and 8 byte blocks is possible 2026-08-29 11:19:39 +02:00
iceman1001 80388c8fea adapt tear off parameter to handle limits correct 2026-08-29 06:53:58 +02:00
iceman1001 9b61ef867c fix SpinDelayUsPrecision() clock, no more wrapping 43ms> issues. Still capped at 1390ms. This affects a bunch of tearoff attacks 14b especially win 100ms actually being 16ms wrapped. Should be handled according to new HAL layer. Next things is rate renegotiated at reconnect for sim module. Makes things a more stable if something fails. Thanks Claude! 2026-08-29 06:42:17 +02:00
iceman1001 41c1809404 less dropfield means less complete select... 2026-08-28 23:04:53 +02:00
iceman1001andClaude Opus 5 cb48c928a5 hf felica: make reading actually work
FeliCa reading was broken on every card tested: 'hf felica reader' returned PM3_ETIMEOUT while the tag was answering correctly. The cause was in the FPGA demodulator, not the ARM.

fpga/hi_flite.v
---------------
Adaptive hysteresis thresholds. The envelope tracker clamped curmin to <= 70 and curmax to >= 180, so curminthres/curmaxthres were pinned near 91/160 no
matter where the signal actually sat. Measured on a RDV4 with the field on, the peak detector idles near 112 and a tag swings it by about +/-35, ie entirely
inside that window - so nothing ever crossed a threshold and every frame demodulated as a constant. The band is now derived from the tracked envelope,
3/16 of its span, floored at +/- 8 to stay clear of the 4..6 counts of carrier ripple.

Matched-filter bit detector. The slicer counted comparator trips (+1 above curmaxthres, -1 below curminthres, repeat the last crossing direction inside
the dead band), so every bit depended on where the band happened to sit. A mispositioned band railed the output to a constant and, since only the stable
branch can recompute thresholds or desync, it stayed that way for the rest of the session. It also discarded amplitude, gaining nothing from 32x
oversampling. Each half-bit is now integrated in the ADC domain and the larger half wins. Thresholds still drive bit phase and the desync, they no longer
decide bit values, so a clipped or mispositioned envelope can no longer rail the output.

Polarity lock guard. try_sync arms part way through a half-bit, so the first decision after arming is meaningless and could latch 'zero' inverted, decoding
the whole frame with the wrong polarity and losing the sync word. Skip the first two decisions; the preamble is 48 bits.

curbit re-timing. The bit decision was made in the bit-phase domain, which is aligned to the tag's edges, but sampled by the SSC in the carrier domain. The
ARM could latch a bit mid-transition at a phase that varied per frame. Both run at 64 carrier periods per bit, so re-timing curbit half an SSP bit away from the
sampling edge is a re-time, not a resample.

Envelope watchdog. FPGA registers persist across PM3 commands - only a bitstream reload clears them - so the tracker could enter a state it never left and the
first command after the client started would work while every one after it failed. Force a re-centre when the demodulator has not reached a known-good idle
for 19.3 ms, held off at the start of each frame so it cannot fire mid-reply.

state is marked (* fsm_extract = 'no' *). The project synthesises with -fsm_style bram; once XST recognised this register as a state machine it placed
the state ROM in a block RAM, and the xc2s30's six were already spoken for. MAP then failed to fit with nothing but a generic 'design is too large' error, no
BITGEN, and no new bitstream.

armsrc/felica.c
---------------
- felica_select_card() returning 4 (response too short for IDm+PMm) fell through to PM3_SUCCESS, so 'hf felica reader' reported an all-zero IDm as a good read.
- After a poll timeout the code still read FelicaFrame; with a stale POLLING_RES and len == 0, check_crc() was handed (len - 2) as a size_t, ie 65534.
- WaitForFelicaReply() could only time out from STATE_UNSYNCD/TRYING_SYNC and would spin forever if a frame never completed.
- felica_sniff() decremented and broke before LogTrace, so '-s 10' logged nine frames and '-s 0' logged none. CRC-failed noise no longer pollutes the trace.
- felica_sendraw() sent no reply at all for some flag combinations, leaving the client blocked until its own timeout.
- Polling used time slot 0 only, so several cards in the field collided forever. Retries now widen the TSN window.
- BuildFliteRdblk() warned about a bad block count and built the frame anyway.

Signal probe
------------
'hf felica raw -p' streams the per-window envelope min and max instead of demodulated bits, so reading distance and coupling can be measured rather than
guessed. This is what told 'tag out of range' apart from 'demodulator not locking', which are otherwise identical from the ARM's point of view.

Measured on a RDV4, both cards previously unreadable:
  FeliCa Standard RC-S830 (CJRC 0003): reader 4/4, info 4/4, 39 nodes discovered, dump complete in 2.0 s, 37/40 single polls.
  FeliCa Standard RC-S962 (Octopus 8008): reader 10/10, 23 nodes discovered, dump complete in 1.5 s, 40/60 single polls. This one drives the envelope onto the bottom ADC rail; the matched filter reads it anyway.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 22:35:08 +02:00
Philippe Teuwen ff6954f8a6 First attempt at providing guidance to LLMs, don't hesitate to try it out 2026-08-28 15:17:11 +02:00
MsprgandClaude Fable 5 d852118de5 client: build the tab completion vocabulary at runtime from the command tree
Tab completion used a generated table (pm3line_vocabulary.h, refreshed by
hand via `make commands`) that drifted from the real command tables: new
commands were missing (e.g. `hw bwm*`), removed ones lingered, and the
"offline" flag depended on the platform of whoever regenerated it
(IfPm5() returns true offline on PM5 builds).

Build the vocabulary at startup instead:

- cmdparser: add walkCommandsRecursive(), a tree walk using a fourth
  internal sentinel (XX_internal_command_walk_XX) next to the dump ones.
  It hands each leaf to a visitor as its command_t chain (ancestors +
  leaf). A dispatch counter detects entries shown like a category but
  with their own parser (reveng) and reports them as leaves.
- pm3line_vocabulary: dynamic vocabulary holding the IsAvailable()
  predicates of every command and its ancestor categories, so completion
  applies exactly the rule CmdsHelp() uses, live, for both offline and
  connected devices. Script entries ("script run <relpath>") come from
  the same directories `script list` scans, sorted, including
  subdirectories with the path `script run` needs.
- pm3line: readline and linenoise completers consume the live vocabulary.
  The walk runs with output disabled so category handlers stay silent.
- Drop pm3_help2list.py and the header regeneration from `make commands`.

Behaviour change: entries whose category is hidden by `help` (e.g. `mem`,
`usart` offline) are no longer offered, matching `help`; when connected,
commands the device does not support are no longer offered either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 14:29:04 +02:00