cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3916 not responding with SPI

JonasHSLU
Associate II

Hi,

I'm trying to get the FTM examples from the STSW-ST25R-LIB to work on a ST25R3916.

I am using the following hardware:
-Mikroe NFC 4 Click Board with a ST25R3916
-STEVAL-25R3916B (I only use the reader/antenna board STEVAL-D25R3916B without the Mcu board)
-Nucleo L476RG microcontroller board (as it is the one used in the sample projects from the library)

On the software side I am using the FTM examples from the X-NUCLEO-NFC06A1 (for 3916 on Mikroe board) and X-NUCLEO-NFC08A1 (for 3916B on Steval board) folders in the lib. The programs seem to be identical, only the global definition for the HW/reader selection is different.

When I use the NFC08A1 program with the Steval, the reader works fine. But when I use the NFC06A1 example with the Mikroe board it doesn't work. When I try to read the chip ID in the initialisation process, it always reads zero. I have checked this interaction with a logic analyser in both examples and have attached the screenshots. I have tried both SW examples on both boards (I changed the reader/HW define in the compiler/preprocessor options so naturally, it should work). Both examples work on the Steval and both do not work on the Mikroe.

I have connected some jumper (supply, SPI and IRQ) cables directly to the Nucleo board and I only change them on the reader side when testing with the two boards so all the tests i did should be quite identical in HW and SW except from the used Board/Reader.


Any help would be greatly appreciated.

ST25 NFC - RFID Readers – ST25R391x Series

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi

see STEVAL 3916B Check ID.png for a proper communication on SPI. Check the JP1, JP2 and JP3 to make sure COMM SEL is properly selecting the SPI interface: check the voltage on JP1 pin 2 (it should be 0 and not floating).

X-CUBE-NFC6 is a package for STM32CubeMX to help customer to create NFC application for various MCU.

STSW-ST25R-LIB provides different examples of applications running on NUCLEO-L476RG.

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

5 REPLIES 5
Brian TIDAL
ST Employee

Hi,

make sure

  • that the "COMM SEL" properly selects the SPI interface (Lower position: SPI)
  • to connect the 2 GND pins (8 & 9)
  • to not have swapped the MISO and MOSI pins (the MISO pins is labelled SDO SPI Data Out on this board which can be misleading... this is the Data In from MCU point of view)
  • that the Power LED Indicator is ON

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.

Hi,

The power LED indicator has always worked so the supply shouldn't be the problem.

I didn't connect both GND pins before (only pin 8) but changing that didn't make much difference. I checked again with the logic analyser and now I get some more high flanks during the first byte transfer as seen below. But I don't the the same results every time and it still reads 0 as it gets low before the trailing edge of the clock. I also checked the ID value while debugging and it also gets 0 every time.

JonasHSLU_1-1742551688522.png

JonasHSLU_3-1742553350033.png

JonasHSLU_2-1742553204947.png

Regarding the SPI data connections I have already checked this several times before and also tried it both ways. At the moment I have connected SDO <-> MISO and SDI <-> MOSI which I think should be correct.

I also tried to measure my connections to verify the COMM SEL. When measuring the different sections of the line (header -> COMM SEL / COMM SEL -> reader / 0 Ohm resistor) i always got <1 Ohms. But when I tried to measure straight from the pin header to the reader I got about 200 Ohms on the CLK line. I suspect it has something to do with not getting good enough contact with the pins on the small package of the reader, as the single sections always read close to 0 Ohms.
Would it be possible to rewrite the SW examples for I2C usage if I can't get the SPI to work? I have seen in the RFAL and various other files, that the define "RFAL_USE_I2C" is checked and in the rfal_platform.h there are some predefined makros for I2C usage that could be configured. But I couldn't find any information about I2C usage in the RFAL documentation and I have read in some forum posts, that the RFAL has not been tested with I2C.
Would it be possible to rewrite it and would it be a lot of work?

Kind regards,
Jonas

 

Brian TIDAL
ST Employee

Hi,

the X-CUBE-NFC6 package provides support for both SPI and I2C interfaces. Where have you seen that the RFAL has not been tested with I2C? 

There should have no activity on the MISO when the host is sending the 7Fh. Thus the logic analyzer traces are abnormal. Have you tried with another Mikroe board?

Note that those boards are not manufactured by ST. I would suggest you contact the manufacturer of those boards for a proper support or switch to X-NUCLEO-NFC06A1 (ST25R3916) or X-NUCLEO-NFC08A1 (ST25R3916B).

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.

Hi,

I misread the part about it not being tested with I2C. It was in this post and it was about the demo of the X-CUBE-NFC6 package not being tested with I2C, sorry for the confusion. Also I was and still am confused with all the different libraries (X-CUBE-NFC6, STM25lib, STSW-ST25R-LIB, ...), as I am quite new to the whole NFC topic.

I currently only have one of the Mikroe boards available. If there shouldn't be any activity on MISO during the 0x7F transmission then would you suspect that the reader (or at least the SPI interface) is defect?

Anyway, I will now try to set up a new project with the X-CUBE-NFC6 package and see how it goes.

Thanks for your support
Jonas

Brian TIDAL
ST Employee

Hi

see STEVAL 3916B Check ID.png for a proper communication on SPI. Check the JP1, JP2 and JP3 to make sure COMM SEL is properly selecting the SPI interface: check the voltage on JP1 pin 2 (it should be 0 and not floating).

X-CUBE-NFC6 is a package for STM32CubeMX to help customer to create NFC application for various MCU.

STSW-ST25R-LIB provides different examples of applications running on NUCLEO-L476RG.

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.