Commit Graph
22907 Commits
Author SHA1 Message Date
Antiklesys a96e3e8c18 Update sam_sc.c
Fix implemented: ARM RF-off now bypasses SAM initialization, saving 330ms from operations.
2026-09-05 17:30:42 +08:00
Antiklesys 264d9bf284 TA1=96 support for SIM module 2026-09-05 17:16:38 +08:00
Philippe Teuwen 47d0a8fa00 typo 2026-09-04 19:59:40 +02:00
iceman1001 2025e49c09 added missing clock fct for pm5 2026-09-04 15:34:30 +02:00
iceman1001 9a958880ff fix bad txframe variable 2026-09-04 15:21:19 +02:00
iceman1001 0aef94c667 fix 'lf hitag reader -@' mode with sending a break afterwards. 2026-09-04 15:18:16 +02:00
iceman1001 ceda0728b6 remove debug statements 2026-09-04 14:34:19 +02:00
iceman1001 1a34aac8df texts 2026-09-04 13:32:54 +02:00
iceman1001 ace5d63ff9 hitag2: fix simulation against genuine readers, add restore, fix info
Simulation now completes the full exchange with a genuine Paxton reader in
password mode, and crypto mode read/write passes Proxmark-to-Proxmark.

Firmware:
- SOF was one bit period short. The lead-in that compensated for the lost
  head half bit was removed and nothing replaced it, so readers rejected
  every answer with a second START_AUTH. Default is now 6.
- The edge-detect threshold was latched before being measured, so the value
  chosen depended on whether the Proxmark was in a field when sim started.
  It is now measured on field entry and re-armed when the reader leaves.
- The percentile walk latched on run-scoped variables, so one attempt made
  outside a field poisoned every later one.
- Field loss was detected from TIMESTAMP, which is free-running MCU time and
  never stalls. Detect it from receive silence instead.
- Frames of a length the protocol does not have no longer reach the state
  machine; our own modulation tail was resetting the session and breaking
  every write.
- A dropped edge merges two or three reader bit periods into one gap. Those
  bits were discarded; they are now recovered by decomposition, which is what
  made crypto mode work (AUTH decode 15% -> 100%).
- Threshold selection is limited to 20 and 32 and settles in under 25 ms.

Client:
- lf hitag info printed a hardcoded 0x06 and reported 'Password mode' for
  every tag. It now reads page 3, takes -k (4 bytes password, 6 bytes
  crypto), and says so when the config cannot be read.
- lf hitag restore: writes a dump back in dependency order - user pages,
  then key material, then config last - validates the config byte, and
  prints the credential the tag will require afterwards.
- lf hitag crack2 now reports why it failed instead of a bare 'fail'.
- trace list: bit count moved to its own column, relative mode shows a
  Frame Delay Time row rather than renaming Start/End, --frame and -r
  rejected together.
2026-09-04 13:20:29 +02:00
iceman1001 d85550c6de text 2026-09-04 10:18:08 +02:00
iceman1001 ff387762b4 text 2026-09-04 10:16:34 +02:00
iceman1001 50c1c72136 added some sample dump files and trace file for hitag2 2026-09-03 19:35:58 +02:00
iceman1001 1b631a288a text output 2026-09-03 19:31:56 +02:00
iceman1001 12bd5736ad renamed script 2026-09-03 19:23:39 +02:00
iceman1001 a7918d5135 style 2026-09-03 18:30:00 +02:00
iceman1001 d397e62665 bad compare signed 2026-09-03 18:29:01 +02:00
iceman1001 6616e939f7 the changes to the PM5 button press influenced PM3 button press to enter bootloader. This make sure to seperate those two behaviors from eachother on each device platform 2026-09-03 18:26:09 +02:00
iceman1001 b0c1e42720 textual changes and layout changes to 'lf hitag list'. Now it is more uniform with the rest of the annotation formats 2026-09-03 18:15:44 +02:00
iceman1001 54bbff4c8c hf mad: fix aarch64 -Wstringop-overflow false positive in mad encode
GCC on aarch64 vectorizes the sector fill loop in parse_sector_ranges()
into 16-byte NEON stores. When it versions the loop it loses the range
relationship between count and max_sectors, and reports a 16-byte store
into the last 8 bytes of sectors[40]. The code was correct; the guard
was there. Does not reproduce on x86-64 gcc 14.

Accumulate sectors in a uint64_t bitmask instead of an array, so there
is no store for -Wstringop-overflow to mis-size on any target. Sector
numbers are already validated to 1..39, so the bound check is no longer
needed. Supersedes the sectors[48] padding, which only absorbs a
16-byte vector and would regress on wider ones.

Side effect: duplicate sectors within a single --aid argument now
dedupe instead of erroring (E103:1-3,2 encodes 1-3). Conflicts between
different --aid arguments still error.
2026-09-03 16:55:15 +02:00
iceman1001 08a31f01db client now supports tilde sign '~/´ in paths 2026-09-03 14:59:37 +02:00
Iceman 130219fb99 Merge pull request #3588 from mfcarroll/agents-md
AGENTS.md: say what new comments should look like and add checklist line
2026-09-03 14:53:21 +07:00
Iceman 2475ed7ea9 Merge pull request #3564 from digitalhoax/feature/hf-legic-rdv4
Add Legic Prime 7-slot RDV4 standalone mode (HF_LEGIC_RDV4)
2026-09-03 14:52:42 +07:00
Lennert Raesch 1ec733f8b1 Add Legic Prime 7-slot RDV4 standalone mode (HF_LEGIC_RDV4)
- Implement 7-slot standalone reader/emulator with SPIFFS persistence
- Add binary LED slot indicators (LEDs B, C, D) and mode indicators (LED A)
- Double-click to toggle between SCAN and EMULATION modes
- Optimize stack pressure (64B RunMod frame) and BigBuf lifecycle
- Register HF_LEGIC_RDV4 in Makefile.hal, Makefile.inc, and CMake
Co-Authored-By: Gemini 3.7 Flash <noreply@google.com>
2026-09-03 09:25:56 +02:00
Matthew Carroll 10b2579406 AGENTS.md: say what new comments should look like and add checklist line 2026-09-02 23:55:52 -07:00
Iceman 3339922ec8 Merge pull request #3587 from JasonYuan869/fix-wifi-wsc-ndefread
Improve ndef wsc parsing
2026-09-03 13:30:34 +07:00
Philippe Teuwen fc4bf7cf51 doc 2026-09-03 08:12:04 +02:00
Jason Yuan 25401b6dd5 feat: improve ndef wsc parsing
Adds support for more attribute types and safe
error handling for unknown types. Fixes a bug
where the version attribute didn't increment the
cursor correctly causing an infinite loop.
2026-09-03 02:08:30 -04:00
Iceman feae212f3d Merge pull request #3586 from Msprg/pm5-android-ble-doc
Docs: Add PM5 BWM BLE connection instructions
2026-09-03 09:41:52 +07:00
Msprg d3bf03f3e3 Docs: Add PM5 BWM BLE connection instructions 2026-09-03 01:41:54 +02:00
Msprg 22e9b37b9f armsrc: resync BWM link baud after an AT32-only reset
The ESP keeps its negotiated UART baud (921600) across a bootloader round
trip, hw reset or flash, while the AT32 restarts at the boot baud (460800)
and its baud-set request is then garbage to the ESP. The link stayed at
460800 and every BWM command failed until the module lost power.

Probe GET_UART_BAUD at both rates on boot and adopt the one the ESP answers
at; only run the set-baud handshake when it really is at the boot baud.
2026-09-03 01:02:38 +02:00
Iceman 710a1968e9 Merge pull request #3584 from nieldk/BWM-work
Enhance bwm_wifi_forward_down for better disable confirmation
2026-09-02 23:44:39 +07:00
Niel Nielsen 6526d2ce48 Refactor comment in bwm_wifi_forward_down
Simplified comment in bwm_wifi_forward_down function.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 18:32:06 +02:00
Niel Nielsen cac3f6dc0a Enhance bwm_wifi_forward_down for better disable confirmation
Refactor bwm_wifi_forward_down to confirm WiFi disable success by polling connect status.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 15:26:03 +02:00
Iceman 89c0682990 Merge pull request #3583 from nieldk/BWM-work
Improve BLE negitiation and corrected wifi status
2026-09-02 20:06:40 +07:00
Iceman 1d97fda4b4 Merge pull request #3582 from Msprg/pm5-fix-lowbatt-shutdown-vusb
PM5 low-batt shutdown: gate power-off on VUSB pin, not charger PG bit
2026-09-02 20:05:31 +07:00
Niel Nielsen 8d8fa8733a Update length check for command data size
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:52:39 +02:00
Niel Nielsen bfb8167cbc Refactor CMD_MEASURE_ANTENNA_TUNING_HF case structure
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:46:01 +02:00
Niel Nielsen eb9e6949ab Enhance BWM WiFi status reporting and logging
Refactor BWM WiFi status handling and improve logging messages.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:42:49 +02:00
Niel Nielsen 0c7688dd40 Update bwm_wifi_forward_status function signature
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:40:47 +02:00
Niel Nielsen 5a3e6cbaa1 Refactor bwm_wifi_forward_status function parameters
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:40:22 +02:00
Niel Nielsen b211a92a3a Add BWM_CMD_GET_UART_BAUD definition
Added a new command to get the current UART baud rate from the ESP.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:24:29 +02:00
Niel Nielsen a3b4767ff6 Enhance UART baud negotiation and acknowledgment
Added acknowledgment handling for GET_UART_BAUD command and improved baud negotiation logic.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 14:24:03 +02:00
Msprg 9f2fd682e5 PM5 low-batt shutdown: gate power-off on VUSB pin, not charger PG bit
The critical-shutdown path in bwm_lowbatt_check() was reached whenever the
AW32001 System Status "power good" bit was clear. On this hardware that bit reads
"power fail" even while the board is USB-powered under HF load (hw status shows
power fail + ~400 mA discharge on PC USB), so a low pack could trip the latched
power-off - Gpio_ARM_Power_ON_Low() + while(1) - while USB keeps the MCU alive,
leaving it spinning.

Confirm the cable really is out via the dedicated VUSB sense pin (Gpio_VUSB_Read,
the same source WITH_PM5_AUTOOFF uses) before powering off; if USB is present,
clear the streak and keep running. Also print a reason before cut-off, and fix a
brace/formatting glitch on the trigger condition.
2026-09-02 14:16:27 +02:00
Philippe Teuwen 9573cb355c BWM-related fcts: make sure every usage of I2C starts with StartTicks() & I2C_init() 2026-09-02 12:06:37 +02:00
Msprg 266c549b2d fix PM5 lock-up after hf search: restart TMR5 before low-batt I2C poll
The idle-loop low-battery poll bwm_lowbatt_check() reads the BWM charger/gauge
over the bit-banged I2C, which busy-waits on the TMR5 free-running counter via
WaitUS()/WaitTicks(). A command handler that runs just before the poll can leave
TMR5 stopped through StopTicks() - notably the LEGIC probe in `hf search`
(LegicRfInfo() ends with switch_off(); StopTicks()). WaitTicks() then spins in
`while (GetTicks() < ticks)` forever and the device appears to hang, needing a
manual power-cycle, because WDT_HIT() is a no-op on AT32.

This became reachable by default at d35ddce2 (PM5 gained -DWITH_BWM_LOWBATT_BEEP).
The previous idle-loop I2C user, the power LED, was unaffected because RgbLedSet()
calls StartTicks() first. Do the same in the poll.
2026-09-02 11:55:33 +02:00
Iceman d1e0476278 Merge pull request #3580 from nieldk/master
Update helptext in cmdhw.c
2026-09-02 14:51:45 +07:00
Iceman 7220df2500 Merge pull request #3577 from mfcarroll/t55xx-psk3-ambiguity
lf t55xx: correctly report the psk2/psk3 ambiguity
2026-09-02 14:51:24 +07:00
Niel Nielsen 96e1c6af18 Fix syntax error in battery health logging
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 09:31:30 +02:00
Niel Nielsen 766992ede8 Fix battery health log format in bwm_charger.c
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 09:28:49 +02:00
Niel Nielsen a94388544c Simplify battery health logging message
Removed unnecessary message about full cycle accuracy for battery health.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-09-02 09:20:55 +02:00