Skip to main content
HSidd.1
Associate
December 15, 2020
Solved

Not able to detect any tag on st25r3916

  • December 15, 2020
  • 4 replies
  • 2225 views

Hello All,

I'm trying to receive tag ID through st25r3916 discovery board. I read out the register through PC GUI software tool and try to mimic it on my firmware. I'm new to this board even RFID. I did not find any library that can help to develop my application. Please, let me know if you know any library that I can use. I'm using yocto linux on NXP.

Thank you

This topic has been closed for replies.
Best answer by Ulysses HERNIOSUS

Hi HSidd.1,

To understand all this you need to inspect pltf_gpio.c. On startup this file opens the file descriptors by calling gpio_get_linehandle() and stores them into fd_GPIOs array. Later on triggered from RFAL via gpio_set(), etc. it will issue ioctl() on these file handles.

Hope this helps.

Best Regards, Ulysses

4 replies

Ulysses HERNIOSUS
Technical Moderator
December 16, 2020

Hi HSidd.1,

STSW-ST25R013 shows NFC operation as user space application on RaspberryPi Linux.

This should be portable to other Linux easily.

BR, Ulysses

HSidd.1
HSidd.1Author
Associate
December 16, 2020

Hello Herniosus,

Thank you so much for your quick response. I looked on the library, It seems quite complicated. I just have to setup st25r3916 to read type 5 tags. I do have a working SPI to change the register values. what I did was, I readout the resister from st25r3916 through PC software and set all the register accordingly. I'm trying to read the FIFO (AS tag information should be saved there). But getting zero. Is there anyway I can just do this without involving this huge library? I'm not giving any type of delay or anything and I have just attached these lines

MOSI

MISO

SCL

SS

Vdd (3.3)

gnd

Thank you

Ulysses HERNIOSUS
Technical Moderator
December 17, 2020

Hi HSidd.1,

ST25R3916 is not an NFC controller. It even has no integrated MCU. For using it barebone you need to know and implement all the low-level NFC commands and protocol stacks of NFC. Typically you put the RF frame you want to send into the FIFO, trigger a command and some time later you can retrieve the result from the FIFO. To send the right command and interpret its response is up to the external MCU.

Even more challenging is your case of T5T / ISO15693. Here the ST25R3916 cannot send/receive the payload bytes but rather the external MCU needs to transcode the payload into sub-stream bits and bytes.

My advice: Use the driver which we provide. If you are running a Linux system, I am sure that you can spare the few tens of Kilobyte our RFAL is requiring.

Compared to our default demo you can even save quite a bit of code by disabling all the features which you don't need in platform.h.

For operation of the RFAL I strongly advice to also connect the INT pin.

Regards, Ulysses

HSidd.1
HSidd.1Author
Associate
December 17, 2020

Thank you for your advice. I understand what need to be under. I just have few questions.

It's only main.c and platform.h files that need to me edit. Or there are other files. Thank you

Ulysses HERNIOSUS
Technical Moderator
December 18, 2020

Hi HSidd.1,

the main file for adaption is platform.h. However it glues functions to the RFAL which are implemented in folder platform: pltf_* files. So will probably touch those as well - e.g. change "static const char *device = "/dev/spidev0.0";" to your needs etc.

The main.c is under your control to implement your application, change the existing one to your needs. I guess for the first step of just running our application you don't need to adapt.

Regards, Ulysses

KVoul.1
Associate II
July 1, 2021

Hello, I am trying the linux example STSW-ST25R013 and it never detects the X-NUCLEO-NFC06A1. I ran it with gdb and it is caught in an endless loop in main.c:111.

Function "st25r3916CheckChipID" in "Linux_RFAL_st25r3916_v2.2.0/rfal/source/st25r3916/st25r3916.:141" returns ERR_HW_MISMATCH.

Can you confirm that the read and check conditions in the function are correct? What else can cause the example not to work?

bool st25r3916CheckChipID( uint8_t *rev )
{
 uint8_t ID;
 
 ID = 0; 
 st25r3916ReadRegister( ST25R3916_REG_IC_IDENTITY, &ID );
 
 /* Check if IC Identity Register contains ST25R3916's IC type code */
 if( (ID & ST25R3916_REG_IC_IDENTITY_ic_type_mask) != ST25R3916_REG_IC_IDENTITY_ic_type_st25r3916 )
 {
 return false;
 }
 

Ulysses HERNIOSUS
Technical Moderator
July 1, 2021

Hi KVoul.1,

better if you open a new topic with the issues you are seeing.

The conditions here should be correct. Not sure what you are doing but I suspect that you have no 3916 answering on SPI. What is the value of the ID variable? Which Linux board + adapter are you using?

Best Regards, Ulysses