Skip to content

Update examples for M5Unified and fix UHF memory access - #19

Open
LuoIsHere wants to merge 1 commit into
masterfrom
fix/uhf-rfid-membank-and-read-address
Open

Update examples for M5Unified and fix UHF memory access#19
LuoIsHere wants to merge 1 commit into
masterfrom
fix/uhf-rfid-membank-and-read-address

Conversation

@LuoIsHere

Copy link
Copy Markdown

Summary

Fixes #17.

This PR updates the UHF RFID examples to support the latest version of M5Unified and fixes several issues in the examples and library implementation.

Changes

  • Migrate the examples from the legacy M5Stack APIs to M5Unified.
  • Change the memory bank used by the read/write examples from 0x04 to 0x03, which is the User Memory bank defined by the UHF RFID protocol.
  • Apply the sa argument in readCard() to the start-address fields of the command frame.
  • Fix the example log() function so that the provided message is printed to the serial port instead of always printing a fixed string.
  • Make minor adjustments required for compatibility with the latest main branch.

Details

The examples previously passed 0x04 as the memory bank when reading from or writing to User Memory. According to the UHF RFID protocol, User Memory is identified by 0x03.

Additionally, although readCard() accepts an sa start-address argument, the argument was not written to the command buffer. This caused read operations to continue using the default start address of zero.

The log() helper also ignored its input when writing to the serial port and always printed the same fixed message.

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.

Wrong MemBank value in write/read examples?

1 participant