Commit Graph
187 Commits
Author SHA1 Message Date
iceman1001 054fae4ac1 fixed the spinner and download reporting 2026-09-12 18:30:45 +02:00
Matthew CarrollandClaude Opus 5 782d28932c lf: restore the graph buffer length along with its contents
restore_bufferS32() returns the length it put back and every graph-buffer
caller dropped it, so g_GraphTraceLen kept whatever value the code between
save and restore had left.

In try_detect_modulation() that is the 160 sample psk antenna-settle trim:
`data modulation` gave the buffer's samples back but left it 160 short, and
a following demod lost round(160 / clk) bits off the end. check_chiptype()
loses the same way through the acquisitions its detections make, on the
`lf search` path, and for g_DemodBuffer too. demodTI() loses convLen + 16
on its error path.

save_graphbuffer() / restore_graphbuffer() pair the length and grid offset
with the contents so no call site has to remember them. The visa2000 and
zx8211 sites do not change the length, so converting them is a no-op today
and keeps the next one from being a bug.

Regression test in tools/pm3_tests.sh: `data modulation` on a saved psk1
trace must leave all 20000 samples.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 10:33:17 -07:00
Philippe Teuwen 38e0c068d9 A few less hardcoded 40000 samples 2026-09-01 19:54:05 +02:00
Philippe Teuwen 0cde2124c8 Replace pm3_max_cmd_data_size() by g_conn.max_cmd_data_size 2026-09-01 17:58:14 +02:00
Niel Nielsen db35ed4854 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
Niel Nielsen 23175240e8 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
Niel Nielsen 9df1c62ec5 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
Niel Nielsen fa8a7da45d Fixed missing arrays
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
Niel Nielsen 9f0171a706 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-01 17:57:31 +02:00
iceman1001 a0a3eb4bbf remove CMD_LF_SIMULATE_BIDIR, never implemented 2026-08-29 17:38:41 +02:00
iceman1001 177d240ee3 dangling code parts 2026-08-29 16:34:08 +02:00
Philippe Teuwen 7fb8927523 Fix streaming bug affecting mostly the pm5
Bug triggered with:
lf read -s 50000
hw ping

ReadLF_realtime() in lfsampling.c never knew how many samples the client wanted — for the realtime path, lf_sample_payload_t.samples was never populated on the client side, and the ARM handler in appmain.c (CMD_LF_ACQ_RAW_ADC/CMD_LF_SNIFF_RAW_ADC) ignored it anyway. So the device just streamed samples indefinitely, only checking for a stop request roughly once per 64-sample USB burst, and even after noticing it, flushed one more trailing partial burst via async_usb_write_stop().

Meanwhile the client (WaitForRawDataTimeout in comms.c) stops listening in raw mode the instant it has collected exactly the number of bytes it asked for (e.g. 50000), then switches back to normal framed-packet parsing. Since the device kept sending more bytes past that point, those extra bytes sat unread in the pipe and got misinterpreted as a PacketResponseNGPreamble/OLD-frame header, corrupting every subsequent USB exchange (hw ping, etc.) — reproducible even with a plain lf read -s 50000, no trigger/COTAG needed.

Moreover, we make sure the client doesn't stop listening, even briefly, during stream reception.
2026-08-26 20:16:46 +02:00
Nemanja Nedeljkovic 6507b8f36b feat(pm5): hf tune --rgb / lf tune --rgb - antenna RGB as a tuning meter
Adds an opt-in `--rgb` flag to the continuous `hf tune` / `lf tune` commands that
mirrors the antenna tuning level on the PM5 antenna RGB LED: blue = low, green =
mid, red = high, tracking the on-screen bar so you can find coupling (e.g. an
implant) by feel without watching the screen.

The colour is computed client-side from the same per-iteration voltage / running
peak the bar uses (so it matches the bar and auto-scales), and pushed to the
device via a new dumb CMD_PM5_RGB_SET {r,g,b}. That command is handled (#ifdef
PM5) by a dedicated AT32 RGB HAL module, common_arm/rgb/{rgb_apis.h,
rgb_hw_at32.c} (RgbLedSet(), I2C controller @ 0x48), wired into the armsrc
Makefile/CMake as SRC_RGB for PM5 only - so no other platform is affected and no
hardware code lands in shared files.
2026-08-20 11:55:55 +02:00
iceman1001 6411ba1ee4 add 2026-07-30 17:06:36 +02:00
iceman1001 19cc98c532 hooked up the new DSP code. Should improve the t55xx commands 2026-07-30 16:43:09 +02:00
iceman1001 2c6e607110 style 2026-07-15 16:39:15 +02:00
towelbyte c1cefd6e38 Complete and working reimplementation of COTAG support
- "lf cotag reader": now behaves mostly the same as "lf read",
   except it is dedicated for COTAG.
	- It makes sure to send COTAG start sequence and to use
          real time sampling mode to get enough samples.

- "lf cotag demod": Working client-side COTAG demodulation implementation
   (high-low raw demod + Manchester demodulation from high/low demod).
	- Now uses samples directly from g_GraphBuffer
	- Supports 3 types of COTAG preamble (1 active, 2 passive), which
          can start anywhere in the samples.
	- Prints full 128-bits of COTAG tag data in 3 formats: raw,
          groupped by nibbles, and in hex, and identifies and
          prints out the card number.

Signed-off-by: andrej@towelbyte.net
2026-06-12 22:49:06 +02:00
Philippe Teuwen d078e8a62b make style 2026-05-21 20:54:44 +02:00
iceman1001 cbb572afad style 2026-05-11 14:36:17 +02:00
Philippe Teuwen 88d20bd4f2 make style 2026-04-13 09:35:02 +02:00
iceman1001 6af1a8e432 updated help text for `lf realy 2026-04-11 09:04:55 +07:00
iceman1001 36a5c881d0 proper fix for ip, socket handling for win32 , proxspace env 2026-04-11 08:01:48 +07:00
iceman1001 a5140dd666 add win32 headers, will need to refactor the lf relay using win32 aswell 2026-04-10 17:05:12 +07:00
iceman1001 f070d8a06e lf relay - relays between two pm3 devices over internet. Defaults to port 8000, Thanks to Moreno for original source 2026-04-10 14:03:50 +07:00
iceman1001 ad82c50158 enforce NULL checks after all malloc, calloc, realloc 2026-03-29 10:20:30 +07:00
iceman1001 d804cfdbba text 2026-03-23 09:39:52 +07:00
iceman1001 0929a14b5d Change lf search to also run chipset detection if the colleced signal data was just noise 2025-09-02 19:41:04 +02:00
iceman1001 a3c2d2b815 style 2025-07-08 21:15:09 +02:00
iceman1001 65607fc727 added Ultralight-C simulation. hf mfu sim -t 13. Use eload first. Also added support to upload UL-C dictionaries and UL-AES to spiffs memory. A lot of textual reworked across client. Unifiy texts and a bit more color ;) 2025-06-19 17:26:20 +02:00
iceman1001 607f1bb26c style 2025-05-24 22:49:46 +02:00
iceman1001 ad292e8810 unify test - step 2 2025-03-25 10:17:42 +01:00
iceman1001 4d603a4530 unify hint text 2025-03-20 22:55:26 +01:00
iceman1001 b4cc21c68f modified hf 14a apdu to report back when extending time and also added a possibililty to interrupt the extension loop with button press or usb commad. A bunch of minor textual changes 2025-03-20 19:58:13 +01:00
iceman1001 17a8f0f9c2 text 2025-03-20 12:17:37 +01:00
douniwan5788 04133e6d07 Add lf search Chipset detection for Hitag µ / 8265 2025-03-19 18:56:23 +08:00
iceman1001 b3285cce8a style 2024-11-02 15:13:40 +01:00
iceman1001 9ddd833cba fix string handling and styles 2024-11-02 14:50:31 +01:00
douniwan5788 f049b568c5 style 2024-10-23 22:25:30 +08:00
douniwan5788 ef0bae7bc6 refactor: cleanup PacketResponseNG init 2024-09-24 21:06:42 +08:00
douniwan5788 0ef374e06f fix: lf search hangs 2024-09-21 23:37:55 +08:00
iceman1001 805dc99b97 lf search - now tries to read out hitag2 data with the paxton key. 2024-09-15 18:19:28 +02:00
iceman1001 db1b28f327 rename hts read/write commands to rdbl/wrbl to match rest of the client. added a lf hitag hts reader comamnd, modified the lf search to identify hitag2/s/82xx in the chipset detection 2024-09-14 21:00:42 +02:00
iceman1001 8f9ca98f6c fix narrow type .. 2024-09-14 14:19:20 +02:00
douniwan5788 424a467132 fix: lf cmdread silent lost CRC 2024-09-13 19:15:11 +08:00
douniwan5788 112caec054 refactor: lf config renames 2024-08-27 23:45:42 +08:00
douniwan5788 0f2eaa316b fix: WITH_EM4x50 and WITH_EM4x70 in lf search 2024-08-26 21:45:06 +08:00
douniwan5788 8928883f2d refactor: move FPGA_BITSTREAM_* to fpga.h 2024-08-26 20:55:58 +08:00
douniwan5788 d15537bbf1 Unified hitag naming style 2024-08-22 02:01:43 +08:00
douniwan5788 eca9830050 fix: lf cmdread. skip WaitMS(100) when keep signal field ON.
4 extra symbol.
avoid include SOF in crc-hitag
2024-08-20 22:50:13 +08:00
Philippe Teuwen 153064ddfa Fix a bunch of potential buffer overruns with CLIGetStrWithReturn :
Most prominent one was "lf pac clone --cn 123456789" causing garbage on the terminal
Some changed code was valid before but as ppl tend to copy-paste to new code,
better to uniformize and document usages of CLIGetStrWithReturn.

Exceptions left are when filling real buffers (bin, raw,...), not strings.
2024-07-30 22:23:04 +02:00