cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to detect any tag on st25r3916

HSidd.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

9 REPLIES 9
Ulysses HERNIOSUS
ST Employee

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
Associate II

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
ST Employee

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

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

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

Hello Herniosus,

thank you so much for your last reply that help me a lot to move forward in right direction. I had made some changes in necessary files inside platform folder. I'm still confuse with platform.h files. I have changed all the pin number according NXP imx8 mini processor. I think it's wrong because I keep processor port number there. exp

/* Set the GPIO pin number used as interrupt line to receive interrupts from ST25R */

#define ST25R_INT_PIN 506            /*!< GPIO pin used for ST25R External Interrupt        */

#define ST25R_INT_PORT (fd_GPIOs[0]) /*!< GPIO port used for ST25R External Interrupt       */

But 506 is a processor GPIO port number not eval kit external pin number. Would you please tell me how to resolve this issue. I know all external pin connection to internal Port number, like 506 port number is connected to external pin 12. Would you also explain me what is the difference between able two lines in code.

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

KVoul.1
Associate III

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;
    }
        

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