Skip to content

Conversation

henrygab
Copy link
Contributor

  1. Rework how communications with tag occur.
  • Data to send to the tag is fully pre-generated as a bitstream
  • Bits sent and received are logged, including start / end times
  1. Support built-in hw dbg for controlling verbosity of debug output

This change provides the framework for more easily supporting a variety of tags.
It is the foundation for work underway to support V4070 tags (e.g., Porsche Boxster)

Because of the new bitstream generation and logging, a surprising characteristic of the legacy code's behavior was brought to light... each of the commands that sent additional data (AUTH, PIN, WRITE) were:

  • inserting an extra RM zero bit
  • forcibly-enabling the use of command parity

While this was not expected, this PR maintains the legacy behavior, as removal of that behavior resulted in failures of those three commands. This change provides a starting point which will simplify discovering the root cause of the hack.

Future TODO:

  • Root-cause why the third RM bit is needed. If it's a coding error (e.g., LIW timing), fix that code to remove the hack.
  • Change the arm/client interface for em4x70 to ONLY use arrays of bytes, with well-defined content endianness, to reduce the repeated reversing of byte arrays in the code.

1. Rework how communications with tag occur.
    a. bitstream to be sent to the tag is now fully pre-generated.
    b. bits sent and received are logged with start / end times.

2. Support built-in `hw dbg` for controlling verbosity of debug output

The new bitstream generation and logging has exposed a surprising legacy behavior ... each of the command that sent additional data (beyond the command) were:
* inserting an extra RM zero bit
* force-enabling command parity is used

This was not expected.  However, this PR maintains the behavior of the existing code.

TODO: Root-cause why the third RM bit is needed.  Fix code to remove that hack.

TODO: change the arm/client interface to ONLY use arrays of bytes, with well-defined content endianness, to avoid this problem.
@henrygab henrygab changed the title Em4x70 Em4x70 - Major improvements to tracing, stability, and debugability Mar 16, 2025
@henrygab
Copy link
Contributor Author

If you'd prefer smaller changes, I could create a PR similar to henrygab#4. However, not all the commits in that working branch worked (and some did not compile). On the flip side, that would provide commit history, with commits that explicitly log the old and new methods ... showing they create equivalent outputs.

@iceman1001 iceman1001 merged commit f2380fe into RfidResearchGroup:master Mar 18, 2025
12 checks passed
@henrygab henrygab deleted the em4x70 branch March 18, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants