esp-idf not able to communicate with PN532

ImDevinC
Posts: 1
Joined: Fri Dec 20, 2024 3:05 am

esp-idf not able to communicate with PN532

Postby ImDevinC » Fri Dec 20, 2024 3:08 am

This is my first project and I'm trying to use a DOIT ESP32 DevKit v1 along with a PN532 to do a simple read. At this point, I'm having trouble even with a simple "GetFirmwareVersion" command working. I have a sample project here showcasing my current code and how it's wired up, but when I send the GetFirmwareVersion command, I get an invalid response.
I have also tried doing a read but that fails too, hence trying a basic GetFirmwareVersion command to see if communication is working.
Any insight is greatly appreciated

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp-idf not able to communicate with PN532

Postby MicroController » Fri Dec 20, 2024 10:05 pm

1) Make sure you initialize all fields in the config structures
2) I guess the PN532 uses half-duplex transfers; check and set up the device accordingly (cf. SPI EEPROM example)
3) You seem to be only sending the command but not transfering enough bytes to also receive the response.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp-idf not able to communicate with PN532

Postby chegewara » Wed Jan 08, 2025 11:58 pm

Hi,
i have the same module and recently i have had to write my own library for it. My library is using UART instead of SPI, so im not sure it is the case, but before you can communicate with that module you have to send wakeup command to it.
I learned it hard way, but existing arduino libraries are very helpful here.

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest