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,

error code 3 is ERR_IO - typically returned when unexpected things are happening - likely interrupts are not properly detected and timeout is hit.

Did you enable ST25R_SELFTEST and goes initialization through?

Please check state if interrupt pin, see ISR being triggered, check your platform*Protect*() macros to see if e.g. interrupts stay disabled by mistake.

Which software packet and version do you use as base? Recent packages (e.g. X-CUBE-NFC6 or ST25 Embedded NFC lib) are using the new rfal_nfc high layer and this removes the need of the code from exampleRfalNfca.c.

Best Regards, Ulysses

KLAM.1
Associate III

Hi

Thank you for the reply. I do go through the initialization and it work .Also I think the rfalInitialize() have the dependency on the st25r3916Initialize, I am using X-NUCLEO-NFC06A1 as my base.Sorry, may I ask what is the code or anything I needed to add to get it work.Also,even I use the demopolling example ,it is not working.

Best Regards,

Kin Hong

KLAM.1
Associate III

HI

here is my cube mx setting and some function related to the irq handle and because now I am using pb6 gpio pin 6 as the irq pin so I change the default irq pin to gpio pin 6. thanks a lot

Best Regards,

Kin Hong


_legacyfs_online_stmicro_images_0693W00000bk3W1QAI.png
_legacyfs_online_stmicro_images_0693W00000bk3XmQAI.png
_legacyfs_online_stmicro_images_0693W00000bk3XhQAI.png
_legacyfs_online_stmicro_images_0693W00000bk3XXQAY.png
_legacyfs_online_stmicro_images_0693W00000bk3XSQAY.png
_legacyfs_online_stmicro_images_0693W00000bk3XNQAY.png
_legacyfs_online_stmicro_images_0693W00000bk3XDQAY.png

KLAM.1
Associate III

Hi

Here is my rfal_platform.h file and may I ask where I can insert platformProtectST25RComm() to disable the irq function in my application. I am using the polling example in X-NUCLEO-NFC06A1 folder. Thanks a lot.

Best regards,

Kin Hong

Sorry I have updated the rfal_platform.h file so I think this one is more helpful. But the same error and result occurs .Thereforce may i ask how can i resolve the problem. Thanks a lot.

Ulysses HERNIOSUS
ST Employee

Hi,

two points:

  1. Debug into RFAL to see where and why the ERR_IO is getting triggered. There are not too many places this is used.
  2. Please come back to previously mentioned point: Attach a logic analyzer/scope and trace the activity of SDA+SCL+INT pin. If you post these traces here I can have a look and give you a qualified hints on what is happening and where to look.

BR, Ulysses

KLAM.1
Associate III

Hi

for now I think I don't have the err_io problem but the intern error still exist.​I can initialize the chip and go to idle state and discovery state and go to RFAL_NFC_STATE_POLL_TECHDETECT function but it return me a intern error after the rfalNfcPollTechDetetection(); .As you said before the new rfal_nfc high layer may removes the need of the code from exampleRfalNfca.c.so now I am using the polling example again .

Best regards,

Kin Hong
_legacyfs_online_stmicro_images_0693W00000bk5MmQAI.png(1) if the initialization success , the log will print out the initializing.
_legacyfs_online_stmicro_images_0693W00000bk5MgQAI.png
_legacyfs_online_stmicro_images_0693W00000bk5NAQAY.png 

Hi,

st25r3916WaitForInterruptsTimed() returning a status of 0 is not normal behavior. Please debug into that. When it returns this way put a breakpoint and check level of INT line, see if the interrupt in MCU is masked or not, .... I don't have the details of STM32L452 to give you the solution out of the blue.

And still a logic analyzer trace will tell a lot.

Best Regards, Ulysses

KLAM.1
Associate III

Hi

I am now adding a breakpoint to the st25r3916WaitForInterruptsTimed() function and i have took a photo of the oscilloscope .Can you help me to take a look of what question it is and how can I solve the problem?Beside,what is the normal behavior of the status of st25r3916WaitForInterruptsTimed() function ? thanks a lot.

best regards,

Kin Hong
_legacyfs_online_stmicro_images_0693W00000bkFeQQAU.png
_legacyfs_online_stmicro_images_0693W00000bkFeLQAU.png
_legacyfs_online_stmicro_images_0693W00000bkFeGQAU.png

Hi,

based on this function I can explain to you:

  • st25r3916PerformCollisionAvoidance() does the following
    • st25r3916ExecuteCommand( FieldONCmd ) : executes direct command which will after few hundred microseconds result in interrupts I_cac or (I_apon + later I_cat) being triggered
    • INT line should go high
    • ISR should execute (st25r3916Isr( void )->st25r3916CheckForReceivedInterrupts( void ), read the Interrupt status register and store the result inside st25r3916interrupt.status
    • st25r3916WaitForInterruptsTimed() will wait for the values inside st25r3916interrupt.status
    • then st25r3916PerformCollisionAvoidance() should act according the return value

INT pin should be high only for some ten/hundreds of microseconds.

Your scope shot is weird:

  1. Signals are way too fast (10 MHz). Don't know your cabling, pull-ups, etc but I would start at 100kHz or maybe 400kHz and only if that is working move higher (doing also signal integrity!)
  2. The pin denoted IRQ does not make sense the way it is behaving. It should only go low if status registers are read out through I2C/SPI which takes at least multiple microseconds.

Best Regards, Ulysses