2024-06-23 07:21 PM
I am trying to communicate with an ST25R95 from an ESP32S3 but the the spec isn't very clear on the SPI initialization sequence.and I can't find any complete examples. I'd like to verify that I can communicate with the ST25R95 by reading the IDN so I've implemented the following sequence and verified that this occurs with a Logic Analyzer
After initializing the ESP32 SPI peripheral I set
CSn HIGH
IRQ_IN HIGH
SCLK LOW
MOSI LOW
(delay)
CSn LOW
Send one byte over SPI 0x01 //reset
CSn HIGH
(delay)
IRQ_IN HIGH100mS
IRQ_IN LOW 100mS //wake up ST25R95
IRQ_IN HIGH100mS
(delay)
CSn LOW
Send 14 bytes over SPI 0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 //READ IDN
CSn HIGH
I am expecting the IDN to be returned but instead I get 0xC,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0. The Reset command is returning 0x0C.
Can you verify that this simple sequence should return the IDN [0x000F4E4643204653324A41535434002ACE]?
Am I missing something in this sequence?
What is the complete sequence for echo? Does it echo data in the command?
Solved! Go to Solution.
2024-06-24 02:08 AM
Hi,
the startup sequence is defined in the ST25R95 datasheet §3.2. It is implemented in the X-CUBE-NFC3 package and can be ported on various MCU. This package provides an NFC communication stack and some demos.
Regarding the startup sequence, you will find several post on this community, in particular: https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/cr95hf-error-0x71-spi-interface/m-p/329870
Regarding the communication protocol, make sure to read §4.1 of the ST25R95 datasheet as your sequence for IDN is erroneous. Here is the correct sequence assuming IRQ_OUT is used:
First line is a SPI write (0x00) with the IDN request (0x01 0x00)
Second line is a SPI read (0x02) once the IRQ_OUT indicates the readiness for the response.
I would recommend to use the FW package from st.com (either X-CUBE-NFC3 or the ST25 embedded NFC library with more demos).
Rgds
BT
2024-06-24 02:08 AM
Hi,
the startup sequence is defined in the ST25R95 datasheet §3.2. It is implemented in the X-CUBE-NFC3 package and can be ported on various MCU. This package provides an NFC communication stack and some demos.
Regarding the startup sequence, you will find several post on this community, in particular: https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/cr95hf-error-0x71-spi-interface/m-p/329870
Regarding the communication protocol, make sure to read §4.1 of the ST25R95 datasheet as your sequence for IDN is erroneous. Here is the correct sequence assuming IRQ_OUT is used:
First line is a SPI write (0x00) with the IDN request (0x01 0x00)
Second line is a SPI read (0x02) once the IRQ_OUT indicates the readiness for the response.
I would recommend to use the FW package from st.com (either X-CUBE-NFC3 or the ST25 embedded NFC library with more demos).
Rgds
BT