cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read the ISO14443-4 card using st25r3917 with stm32L4A6VG?

KLAM.1
Associate III

Hi there,

I am a beginner of using customize board to build a project for reading a ISO 144443-4 card . The project demo(polling) that I search in previous post is using a different MCU. Also, I read the rfal_platform header file. It is using the SPI communication. Is it possible to configurate it using I2C communication?

First question, Am I supposed to use the ISO_DEP feature to read the card? 

Second question , I know that I need to configure the GPIO , interrupt pin and the serial communication interface (SPI,I2C....). how can I initialize the St25r3917? What steps or functions must include in initialize process?

Third question, If I am only reading the card UID ,which project or example I should take it as a reference and what command I should use for reading the card or how can I adjust from the existing project to build the Functionality? Based on my understanding of the RFAL document ,I think I only need to achieve the polling to screen the card UID.

Thanks a lot

Regards, Kin Hong

24 REPLIES 24
Ulysses HERNIOSUS
ST Employee

Hi Kin Hong,

yes 14443-4 cards require IOSEP for higher layer commands. Yes, please see the UM of RFAL, define RFAL_USE_I2C to switch to I2C. RFAL for ST25R3916(B) supports also the ST25R3917. Please see the demos available from ST25 Embedded NFC lib.

UID is part of Anticollision, so for that you would not need ISODEP. Use the simple X-NUCLEO-NFC06A1/polling demo to retrieve the UID.

BR, Ulysses

KLAM.1
Associate III

Sorry, How can I initialize the RFAL of st25r3917 and build the functionality? I have set the IRQ pin, scl ,sda pin and I2C_EN (VDD) for the st25r3917 and connect it to stm32L452CCU6 .I am now using I2c1 PA10 , PA9 and the IRQ pin PB6 on stm32L452CCU6 and ,I try to follow the polling example but I cannot initialize the rfal using the command rfalNfcInitialize() .Here is some of my code and tera term log message as well as the pin assignment of STM32L452CCU6.Thank you for your time and reply.

Thanks a lot

Regards, Kin Hong


_legacyfs_online_stmicro_images_0693W00000bjgAzQAI.png

 

0693W00000bjgApQAI_Screenshot 2023-05-09 175921.png
_legacyfs_online_stmicro_images_0693W00000bjgB9QAI.png

Ulysses HERNIOSUS
ST Employee

Hi,

enable ST25R_SELFTEST and debug through into the st25r3916Initialize(). There you should find a function reading and testing the ST25R3917 chip id. See that it calls I2C driver with correct data...

Also make sure that the I2C_EN pin is properly tight on your board.

Regards, Ulysses

KLAM.1
Associate III

Hi

Do you mean that I have to use the SS pin to control the I2C_EN pin? Because Now I use a jumper to connect the I2C_EN to Vdd. I try your method to debug through into st25r3916initialize() and it get stuck at reading the chip id function . it can not read the chip id and ic identity register. I have tried to read the identity register using different method with the same hardware configuration. It returns 0x31 instead of 0x2A claimed in datasheet. Beside, I want to know Do I need to configurate the pin for I2C in the rfal_platform.h ? Some of picture is attached to show what problem I am dealing with. Thank you for your time and reply. Thanks a lot.

Regards,Kin Hong


_legacyfs_online_stmicro_images_0693W00000bjkAZQAY.png 

  1. Using HAL_I2C_Mem_Read function to read the ic identity register and the result.


_legacyfs_online_stmicro_images_0693W00000bjk1xQAA.png 2.using the api function to read the ic identity register and the result.
_legacyfs_online_stmicro_images_0693W00000bjk9bQAA.png 3.The default value of the IC identity register =0x2Ah


_legacyfs_online_stmicro_images_0693W00000bjkLhQAI.png 4.The pin configuration in rfal_platform.h
_legacyfs_online_stmicro_images_0693W00000bjkLrQAI.png

Hi,

I see here:

  1. Check the return code of HAL_I2C_Mem_Read! Value 0x31 cannot come from the ST25R3916/7.
  2. RFAL needs to be configured by filling platformI2c....() macros and setting RFAL_USE_I2C
  3. Attach a logic analyzer/scope to the pins on e.g. X-NUCLEO-NFC06 or your pins to verify correct I2C activity.
  4. I2C_EN should be connected to VDD_D - otherwise you will encounter too high power-down current.
  5. X-CUBE-NFC6 is ready for I2C, check it and its user manual for details.

Regards, Ulysses

KLAM.1
Associate III

I get the development kit and use the GUI to read the IC Identity register and it give me 0x31 not 0x2A claimed in datasheet.Now I have changed the default IC Identity register to 0x31 and it is working. I can now initialize the i2c and the st25r3917. I think the information in the data sheet is wrong.

Best regards,

Kin Hong
_legacyfs_online_stmicro_images_0693W00000bjqo1QAA.png
_legacyfs_online_stmicro_images_0693W00000bjqnmQAA.png

Hi,

I checked the value 0x31: This value does not belong to ST25R3916/7 but to ST25R3916B/ST25R3917B. This is a different chip. RFAL supports this newer variant as well by setting the define ST25R3916B.

Please check the marking on the chip - it should have a B marking....

Regards, Ulysses

KLAM.1
Associate III

Hi

thank you .I now realize that the rfid sensor we are using is st25r3917b .Sorry for that.But Now I have encountered a problem which is the nfc polling always stuck at the discovery state 2 even I put the card on top of the antenna , it cannot read the uid for me.I am using the exampleRfalNfca.c. Also I am using custom board of stm32l452ccu6 and the rfid jumper board of STEVAL-25R3916B which already soldered it as i2c mode, all power supply pin, i2c pin and the interrupt pin has connected do u have any idea how to solve this problem.Beside in st25r3916PerformCollisionAvoidance function it return me 12 as a error value.How can I solve this Thanks alot.

regards, Kin Hong


_legacyfs_online_stmicro_images_0693W00000bjwHNQAY.png
_legacyfs_online_stmicro_images_0693W00000bjwHSQAY.png
_legacyfs_online_stmicro_images_0693W00000bjvvMQAQ.png
_legacyfs_online_stmicro_images_0693W00000bjvsXQAQ.png

KLAM.1
Associate III

HI

I think there is a problem with the rfalNfcaPollerTechnologyDetection() also ,it return me error code 3 and I think it is supposed to be RFAL_ERR_NONE(0) so the program cannot perform the protocol specific activation. I am using the exampleRfalNfca.c and I also check out the error code in rfal_utils.h but I don't know how to resolve the error. Do you have any idea how to solve the problem? thanks a lot

Regards,Kin Hong
_legacyfs_online_stmicro_images_0693W00000bjxA3QAI.png
_legacyfs_online_stmicro_images_0693W00000bjx29QAA.png