Skip to content

[BUG] drivers/contactless/PN532: Incorrect UID Readings, Timeouts, and Documentation issues #15942

@keever50

Description

@keever50

Summary
The PN532 driver for NFC/RFID tag reading appears incomplete, undocumented, and unreliable. It exhibits multiple issues, including incorrect UID readings, broken timeout handling, and limitations on UID length.

Environment
Hardware: PN532 NFC reader via SPI
MCUs tested: STM32F4, Raspberry Pi Pico (with added local driver support)
Test code: Pastebin link

--Issues Observed--

Incorrect UID Readings
The first byte of the UID is unique, but the rest remain the same across all NFC tags.
This suggests a possible bug in the driver’s UID parsing or response handling.

Polling for New Cards Fails
When polling for new NFC cards, the driver frequently returns timeout errors.
Timeout settings appear to be non-functional.

UID Length Restriction
The driver only returns 4-byte UIDs, whereas the PN532 is capable of providing longer UIDs.

Concerns and Next Steps
The driver is very old and poorly documented, making it difficult to diagnose and fix issues.
I have previously written a PN532 driver with similar (or more) functionality. Given the state of this driver, would it make more sense to fix these issues or port my own driver instead?

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Arch Linux x86_64, Kernel: 6.13.4-arch1-1

NuttX Version

Master

Issue Architecture

[Arch: all]

Issue Area

[Area: Drivers]

Host information

No response

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arch: allIssues that apply to all architecturesArea: DriversDrivers issuesOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions