Commit Graph
22754 Commits
Author SHA1 Message Date
iceman1001 ef2ffa2bb4 lessen stack usage 2026-09-01 06:40:26 +02:00
iceman1001 70b2262326 lessen stack usage 2026-09-01 06:40:07 +02:00
iceman1001 f1cc02a6ca lessen stack usage 2026-09-01 06:39:04 +02:00
iceman1001 03f9601cc2 lessen stack usage 2026-09-01 06:38:29 +02:00
Philippe Teuwen 2b7a436ada Warn if sending bitstream to FPGA fails 2026-09-01 00:17:28 +02:00
iceman1001 ab7729259f fix multi tech timings in the trace list. 'hf iclass sam' or 'hf seos sam' 2026-08-31 21:59:32 +02:00
iceman1001 81aa2d437a Real SPI completion wait 2026-08-31 19:47:17 +02:00
iceman1001 7556dd8fc0 Resync drain after framing error 2026-08-31 19:45:23 +02:00
iceman1001 179de04301 Clear ring per send, check start ack 2026-08-31 19:43:38 +02:00
iceman1001 41f8afbfc8 Re-assert HF field every sample when running hf/lf tune 2026-08-31 19:41:40 +02:00
Iceman cb3a21d015 Merge pull request #3562 from pkilar/epassport-blank-panes
Fix ePassport FILES and LOG panes drawing nothing
2026-09-01 00:10:44 +07:00
Paul KilarandClaude Opus 5 bd34414c6d ePassport: fix the FILES and LOG panes going blank
Clicking a file that holds a picture - EF_DG2, EF_DG7 - showed nothing at
all: no image, no hex dump, and no error either.

Both panes drew their text into a single Kivy Label, and a Label is one
OpenGL texture, capped at commonly 16384px. A monospace line here is 13px,
so past roughly 1260 lines the texture fails to be created and the pane
draws nothing. A DG2 portrait is 15-25kB, which is 940-1560 dump lines at
16 bytes a row and four times that in a narrow pane, where the dump falls
back to 4 bytes a row. The LOG pane holds 4000 lines, so it blanked as
well once a dump got talkative. The 64kB cap already in the hex view
guarded the wrong bound: it was sized for how long a Label takes to lay
out, not for what the GPU will hold.

Split both over several Labels. split_blocks() chunks at 512 rows, and the
log at 256 because its lines wrap and so cover more rows than they hold.
The log reuses its Labels and only assigns the ones whose text changed, so
streaming output still re-renders just the tail.

The FILES tab now also shows the picture above the dump for the files that
carry one, which is what you actually want to see for a DG2. The PNG is
already decoded at load time for the data page, so image_for() only hands
over what is there.

Behaviour change: a file carrying an image shows it above the hex dump,
with the dump still underneath. Nothing is truncated that was not before.

Testing: 270 passed, 2 skipped (was 265). Checked on screen against a
generated sample - EF_DG2 shows the portrait, EF_DG7 the signature, EF_SOD
the dump at full height, and the LOG tab renders a full 4000-line buffer
as 16 Labels, tallest texture 3328px against the 16384px maximum. black
clean. Python only, so no client or firmware build matrix applies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 10:45:57 -04:00
Iceman 5e19ee7d38 Merge pull request #3559 from Antiklesys/master
Extended T=1 support
2026-08-31 16:03:36 +07:00
Iceman b3c1ebaade Merge pull request #3558 from nieldk/master
BWM: negotiate ESP/AT32 UART baud up from 460800
2026-08-31 16:00:47 +07:00
Antiklesys a47bdebc87 Extended T=1 support
Extended T=1 support with TA1=95 and T1_IFSD_WANTED 254
2026-08-31 15:28:49 +08:00
Niel Nielsen e4dcda2d5e Add BWM link baud printing functionality
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 09:14:48 +02:00
Niel Nielsen 59219a05ec Refactor BWM forward handling and comments
Updated comments for clarity and changed baud rate assignment to use negotiated value.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:42:09 +02:00
Niel Nielsen da0a5a6ac0 Define target baud rate for UART negotiation
Added target baud rate for UART negotiation and updated comments.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:41:40 +02:00
Niel Nielsen 444d27b05d Refactor UART initialization and configuration
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:41:11 +02:00
Niel Nielsen 2c052710f0 Add baud negotiation function for ESP communication
Added function to negotiate UART baud rate for ESP.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:40:45 +02:00
Niel Nielsen b8d0fbc347 Implement baud acknowledgment in negotiation process
Add baud acknowledgment handling in UART negotiation.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:40:25 +02:00
Niel Nielsen 17ffe0399b Update UART baud rate to 460800
Changed BWM_UART_BAUD from 921600 to 460800 for compatibility.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:30:36 +02:00
Niel Nielsen 0401e5f513 Change BWM_UART_BAUD to 921600
Updated BWM_UART_BAUD to 921600 for improved performance.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:22:10 +02:00
Niel Nielsen 191e21e604 Refactor UART4 driver to use circular DMA for RX
Updated the UART4 driver to use circular DMA for RX, improving performance at higher baud rates. Removed the RX interrupt handler and adjusted the RX head calculation.

Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-31 08:21:40 +02:00
Iceman be7f55f72b Merge pull request #3555 from munzzyy/fix/xerox-view-info-block-oob
Fix heap out-of-bounds read in hf xerox view on short dump files
2026-08-31 03:50:44 +07:00
Philippe Teuwen c356ce7f14 Restore client and fw capabilities version parity 2026-08-30 22:42:52 +02:00
Cole Munz 18936b2188 Fix heap out-of-bounds read in hf xerox view on short dump files 2026-08-30 15:39:45 -05:00
Iceman 5a1d93a2a4 Merge pull request #3557 from Antiklesys/master
Bugfix: stale ISO14443A scheduler delay
2026-08-31 02:19:43 +07:00
Antiklesys d4c68ec9fb Refactor comment for clarity on time base synchronization
Condensed comment about keeping the absolute transfer scheduler in sync with the time base.

Signed-off-by: Antiklesys <syselkitna@gmail.com>
2026-08-31 03:19:02 +08:00
Iceman ff94b8b376 Merge pull request #3554 from actuallysparky/codex/emrtd-sod-stack-overflow
fix(eMRTD): move EF_SOD parser buffers off the stack
2026-08-31 02:18:08 +07:00
Antiklesys e5f6f39a04 Update iso14443a.h
Signed-off-by: Antiklesys <syselkitna@gmail.com>
2026-08-31 03:17:40 +08:00
Antiklesys aadefed412 Refactor comments in iso14a_rebase_transfer_time
Updated comments for clarity regarding NextTransferTime handling.

Signed-off-by: Antiklesys <syselkitna@gmail.com>
2026-08-31 03:16:51 +08:00
Iceman 7a56985ba5 Merge pull request #3556 from nieldk/master
Change Dbprintf to display voltage in mV instead of V
2026-08-31 02:16:43 +07:00
Antiklesys 9479340e19 Bugfix: stale ISO14443A scheduler delay
Internal Card-API code restarts the SSP clock before every RF APDU, resetting it to zero. ISO14443A retains NextTransferTime as an absolute timestamp from the prior clock instance, so each next transmit waits for stale time.
2026-08-31 02:57:12 +08:00
Niel Nielsen bd62f03669 Change Dbprintf to display voltage in mV instead of V
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 20:47:31 +02:00
Iceman 8e405a7fe8 Merge pull request #3550 from pkilar/epassport-startup-segfault
Fix ePassport viewer segfault on startup
2026-08-31 01:26:28 +07:00
Paul KilarandClaude Opus 5 dc718d3e29 ePassport: fix the segfault on startup
The app died with SIGSEGV before drawing anything, on every entry point
including --help.

The window minimum size was pre-seeded into Kivy's Config, and
WindowBase.__init__ is the only place Kivy reads it - so it was applied from
inside WindowSDL.create_window(), while Window.initialized was still False.
If the window SDL has just made is smaller than that minimum, SDL resizes it
on the spot; the resize comes back through the SDL event filter into
EventLoop.idle(), which runs the clock and re-enters create_window(). Still
not initialised, that call runs setup_window() again and resizes again, until
the C stack gives out.

A scaled HiDPI session is enough to reach it: with sdl2-compat on SDL3 under
Wayland sizes come back in logical points, so the inherited 800x600 default
arrives as a 500x375 window, under the 760x520 minimum. Set the minimum on
Window once it exists instead, where the same resize takes Kivy's cheap
already-initialised path.

That exposed a second fault on the same path. _install_kivy_logging attached a
bare StreamHandler() to Kivy's own logger, and kivy.logger replaces sys.stderr
with a stream that feeds whatever is written to it back in as a warning -
kivy/logger.py cautions about exactly this. Any warning _KivyNoise did not
drop answered itself until the recursion limit stopped it, with stderr as the
broken part, so nothing legible came out. Not theoretical: this machine logs
"MTD: Unable to open device" at startup, which would have killed the app as
soon as the segfault was out of the way. Point the handler at the real stderr,
which Kivy leaves alone.

Behaviour change: a window that opens smaller than 760x520 is now grown to it,
rather than the constraint being imposed while the window is built.

Testing: 257 passed, 2 skipped (was 254/2); --help, a plain launch, --dump on
a generated sample and -v all start and stay up; black clean. Python-only
change, so no client or firmware build matrix applies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 14:17:37 -04:00
iceman1001 9e2092fc66 capabilities: report device frame size so the client can adapt
PM3_CMD_DATA_SIZE went 512 -> 624 without a capabilities bump, so a new
client connects to old firmware and every oversized command dies at the
device's length check with no message.

Append max_cmd_data_size, bump to v9. The client now accepts an older
capabilities struct - it only ever grows by appending, so an older layout
is a prefix - and defaults the frame size for pre-v9 firmware.
SendCommandNG bounds by the device value instead of the compile time one.

Also zero init capabilities_t on the device, it leaked stack bytes.
2026-08-30 20:13:38 +02:00
SparkyandCodex 879a4bd273 fix(eMRTD): avoid EF_SOD parser stack overflow
Allocate EF_SOD parsing scratch buffers on the heap so macOS worker threads do not exceed their stack while reading protected travel documents.

Co-Authored-By: Codex <noreply@openai.com>
2026-08-30 10:48:29 -07:00
iceman1001 6d2c35b05b The slight increase of array size makes us use the usb packages the AT91 sends which is 64bytes of size. We maximizing the available bytes basically and it comes with a slight cost of .bss and stack cost. Making bigbuff just abit smaller. We gain: 600 kBs -> 630 kB/s and less number of frames being sent over the wire. \n\nWhen it comes to Pm5 it will need to find its own aligned size to optimize transfers 2026-08-30 19:21:28 +02:00
iceman1001 b7bd6ddadb fix return value that break 'hf search', Thanks @atk! 2026-08-30 19:11:37 +02:00
Iceman 70aa0309e7 Merge pull request #3553 from nieldk/master
Updated BWM usage doc
2026-08-30 23:41:50 +07:00
Niel Nielsen 50b94cf01b Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 17:36:56 +02:00
iceman1001 26d85264d3 add some more output for speed check 2026-08-30 16:55:15 +02:00
iceman1001 ca5913a2db text 2026-08-30 16:54:20 +02:00
Niel Nielsen fd81dbd10a Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 15:24:08 +02:00
Niel Nielsen e6220a828f Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 15:24:08 +02:00
Niel Nielsen 8efb7e5b51 Add files via upload
Signed-off-by: Niel Nielsen <nieldk@gmail.com>
2026-08-30 15:24:08 +02:00
Philippe Teuwen 519e0f6de9 pm5_battery_test: misc fixes 2026-08-30 14:11:47 +02:00
iceman1001 52eb6118e7 text 2026-08-30 14:03:26 +02:00