cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing the ST25R95

GRB
Associate II

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?

 

 

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

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:

BrianTIDAL_0-1719219717260.png

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Brian TIDAL
ST Employee

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:

BrianTIDAL_0-1719219717260.png

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.