Skip to main content
Visitor II
May 8, 2023
Question

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

  • May 8, 2023
  • 19 replies
  • 4826 views

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

    This topic has been closed for replies.

    19 replies

    KLAM.1Author
    Visitor II
    May 15, 2023

    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

    KLAM.1Author
    Visitor II
    May 15, 2023

    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.

    Technical Moderator
    May 15, 2023

    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.1Author
    Visitor II
    May 15, 2023

    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 

    Technical Moderator
    May 15, 2023

    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.1Author
    Visitor II
    May 17, 2023

    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

    Technical Moderator
    May 17, 2023

    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

    KLAM.1Author
    Visitor II
    May 18, 2023

    Hi

    I now realize that the BSP_I2C1_IRQHandler wasn't call and i check it the program never go to the st25r3916isr() function.Now I have modified the EXIT_IRQHandler function and now the problem get stuck.I follow the polling example. I would like to ask do I have something missing?

    Also,I wonder in the rfal_platform.h the platformIrqST25RSetCallback(cb) , platformIrqST25RPinItialize(). What function should I link it to? I will provide the picture below.

    Thanks alot

    Best regards,

    Kin Hong


    _legacyfs_online_stmicro_images_0693W00000bkLCiQAM.png
    _legacyfs_online_stmicro_images_0693W00000bkLMSQA2.png
    _legacyfs_online_stmicro_images_0693W00000bkLN1QAM.png
    _legacyfs_online_stmicro_images_0693W00000bkLLBQA2.png
    _legacyfs_online_stmicro_images_0693W00000bkL7SQAU.png
    _legacyfs_online_stmicro_images_0693W00000bkL7NQAU.png

    KLAM.1Author
    Visitor II
    May 18, 2023

    Hi

    For the new update ,I have run the st25r3916initalize() again and now I found the error in the st25r3916.c line 181 about the st25r3916WaitForInterruptsTimed(),it seems the irq handling is not properly configurate.Do you have any idea about it? thanks a lot.

    Best regards,

    Kin Hong

     
    _legacyfs_online_stmicro_images_0693W00000bkMhMQAU.png
    _legacyfs_online_stmicro_images_0693W00000bkMcgQAE.png 

    KLAM.1Author
    Visitor II
    May 18, 2023

    Hi

    • I have some updated .I retry the SELF TEST again and found some ERROR in the SELF TEST .There is a problem with the st25r3916EnableInterrupts the function do not write any value into the 4 interrupt register from address 16h to 19h when calling st25r3916EnableInterrupts( ST25R3916_IRQ_MASK_WT ); .Therefore I read the value in those four register it turn out all 0 so the interrupt so I am not sure the register is masked properly. What is the proper st25r3916interrupt.mask when calling st25r3916EnableInterrupts( ST25R3916_IRQ_MASK_WT ); ?because it seems that the function is doing anything when calling st25r3916EnableInterrupts( ST25R3916_IRQ_MASK_WT ); Finally,it return RFAL_ERR_TIMEOUT when the Wake-st25up timer interrupt is not received

    • Furthermore , I want to ask which register should I read to see the status is really masked as you have mentioned "st25r3916WaitForInterruptsTimed() will wait for the values inside st25r3916interrupt.status" ? The last two pictures show the error in the log and the code when I am doing the SELF TEST .Also I want to ask about st25r3916interrupt.mask . What is the normal mask value when calling the st25r3916ModifyInterrupts function ? thanks a lot

    Best regards,

    Kin Hong


    _legacyfs_online_stmicro_images_0693W00000bkQLFQA2.png
    _legacyfs_online_stmicro_images_0693W00000bkMp7QAE.png
    _legacyfs_online_stmicro_images_0693W00000bkPZLQA2.png
    _legacyfs_online_stmicro_images_0693W00000bkPdNQAU.png
    _legacyfs_online_stmicro_images_0693W00000bkPdSQAU.png

    KLAM.1Author
    Visitor II
    May 19, 2023

    Hi

    • I have some updated .I retry the selftest again and found some bug in the self test .I have passed the selftest part and move forward to the ST25R3916B test .There is a problem with st25r3916ExecuteCommandAndGetResult(),the program get stuck after sending out st25r3916ExecuteCommand( 0xEA ) ,the interrupt get triggered after sending out the command but then the program get stuck. Thanks a lot

    Best regards,

    Kin Hong


    _legacyfs_online_stmicro_images_0693W00000bkR82QAE.png
    _legacyfs_online_stmicro_images_0693W00000bkR6fQAE.pngI2C send out 0xEA data


    _legacyfs_online_stmicro_images_0693W00000bkR6kQAE.pnginterrupt get triggered after the i2c send out data finished


    _legacyfs_online_stmicro_images_0693W00000bkR70QAE.pngsend out the command 0xea


    _legacyfs_online_stmicro_images_0693W00000bkR8RQAU.pngAfter sending out the command


    _legacyfs_online_stmicro_images_0693W00000bkR8lQAE.pngprogram get stucked

    Technical Moderator
    May 22, 2023

    Hi,

    not clear what you mean by "get stucked"... Which loop? Waiting for which signal? You say the ISR gets executed, what is the read-out of interrupt mask registers inside there?

    Regards, Ulysses