Skip to main content
Visitor II
January 15, 2025
Question

ST25R3916b collision resolution not working, NFC-A & NFC-V tags not working/detected

  • January 15, 2025
  • 5 replies
  • 6837 views

Hello,

I am currently working as a student on designing my own hardware for reading and writing NFC tags. Although I lack experience in RF design, I have completed the electronic design and antenna matching process. My setup includes an STM32U575RGTx microcontroller connected to an ST25R3916B NFC chip via SPI. The antenna, sourced from Taoglas, is connected to the matching circuit, and I have confirmed the RF field using a spectrum analyzer.

This project does not utilize the STM HAL; instead, I am working in bare metal. I have developed a HAL for SPI communication, which is functioning without errors. Additionally, I have ported the RFAL library to my project to facilitate interaction with the NFC chip.

At present, I have two types of tags for testing: NFC-A T2T and NFC-V tags. I have enabled the necessary configuration in rfal_platform.h and implemented the example from the X-NUCLEO-NFC08A1 to attempt reading the tags.

However, I am encountering issues. When I try to read the NFC-A tag, the process does not progress past RFAL_NFC_STATE_POLL_COLAVOIDANCE in the rfalWorker() function, and gNfcDev.devCnt remains at 0. In contrast, when I attempt to read the NFC-V tag, the state does not reach RFAL_NFC_STATE_POLL_COLAVOIDANCE; instead, it stays in RFAL_NFC_STATE_POLL_TECHDETECT and fails to detect any tags.

I have a logic analyzer connected to my SPI and IRQ pins and can provide traces if needed.

Do you have any insights into where my error might be?

Thank you in advance for your assistance.

Best regards,
Marc

    This topic has been closed for replies.

    5 replies

    Technical Moderator
    January 15, 2025

    Hi,

    can you first enable ST25R_SELFTEST and ST25R_SELFTEST_TIMER compilation switch to make sure interrupt handling and timer management is correct?

    Then can you connect your logic analyzer on SPI (CLK, MISO; MOSI and CS) + ST25R3916_INT and provide us the log file?

    Can you also confirm you have followed the application note AN5276 in particular the design verification chapter?

    Rgds

    BT

    marcklpAuthor
    Visitor II
    January 16, 2025

    Hi Brian,

     

    ST25R_SELFTEST and ST25R_SELFTEST_TIMER is defined and is working without errors.

    I have not followed the application note in the design verification chapter, because i dont have the ISO calibration coil.

    I have now tried a measurement with a VNA of the matching circuit with antenna. My VNA is connected at RFO1 and RFO2 directly at the ST25R3916b, driver output resistance is set to high Z. I have attached a screenshot of the measurement.

     

    I am using FXC.35.52.0075X.A.dg antenna from Taoglas, matched with the ST25 Antenna matching tool to a target Z of 20 Ohm and Q of 20. 

     

    Best regards,

    Marc

    Technical Moderator
    January 16, 2025

    one question from RF expert: can you share antenna parameter and matching component values you used and how you came to those values?

    Rgds

    BT

    marcklpAuthor
    Visitor II
    January 31, 2025

    Hi Blake,

    it was not my intention to use a larger package for the capacitor. As a student in information technology, this was my first experience with hardware design. My primary focus was on the schematic, while a colleague managed the layout. I likely selected the 0805 package by mistake and did not notice the discrepancy.I did ensure that all the necessary layout recommendations for the NFC design from your application note were forwarded to him. I have reviewed all the capacitors used in the design, and they all have a tolerance of 5%. Do you think this is sufficient, or should I consider upgrading to 1% tolerance for my redesign?

    The tuning capacitor C126 is not missing from the design; it was inadvertently obscured due to my inadequate labeling in the previous screenshot. To clarify, I have attached an image of the layout design. 

    To verify my Vector Network Analyzer (VNA), I purchased a STEVAL-25R3916B and connected my VNA to it. The measurements I obtained look excellent, as expected. I have attached the measurement results.

     

    My next step will be to calculate the parasitic capacitance of the PCB circuit and incorporate it into the simulation in Qucs.

    Best regards,

    Marc

     

     

     

    marcklpAuthor
    Visitor II
    January 31, 2025

    there are the attachments i forgot

    Technical Moderator
    January 31, 2025

    HI

    unless Blake has now more ideas:

    I guess we can also not yet rule out an issue in software/porting. Did you verify a field is being emitted? Could you share logic analyzer traces of SPI and IRA to look also from this side?

    BR, Ulysses

     

    marcklpAuthor
    Visitor II
    January 31, 2025

    Hi,

     

    I have attached the logic analyzer traces in both Saleae file format and CSV format for your review. The traces illustrate the execution of the NFC_Init function, followed by the demo_cycle function.

    Additionally, I have included a screenshot of a spectrum analyzer measurement, which confirms that the RF field is being emitted correctly. (rfalFieldOnAndStartGT())

     

    I'll be on holiday next week, so I’ll get back on the 10th or 11th of February.


    Best,

    Marc

    Technical Moderator
    February 3, 2025

    Hi Marc,

    nothing suspicious on the trace - it is polling NFC-A only and not getting a response. But if you have an NFC-A tag it should detect. 

    Which IMO puts us back into looking on the analog side. I would recommend to cross-connect e.g. X-NUCLEO-NFC08A1 instead to have guarantee that your software is working and if so attach then a scope to look into the field (maybe triggering on INT pin) to see the commands in the field and potentially the tag modulation. For now I would be suspecting that the tag does not get enough power and does not answer...

    BR, Ulysses

    marcklpAuthor
    Visitor II
    February 26, 2025

    Hi Ulysses,

    I am currently working with an NFC-A tag for testing purposes, but unfortunately, it is not being detected.

    Upon further investigation into the analog side of my setup, I examined the NFC antenna sourced from Taoglas. For the RF matching circuit, I utilized the values specified in the datasheet, which are the same as those I provided in previous posts. I attempted to verify the antenna parameters using my VNA; however, it has a maximum range of only 40 MHz, which limits my ability to measure the self-resonance frequency and the parallel resistance.

    At 1 MHz, I obtained the following results:

    • Antenna Inductance: 950 nH (compared to 1070 nH in the datasheet)
    • DC Resistance: 360 mΩ (as opposed to 1650 mΩ in the datasheet)

    Using these values, I simulated a new RF matching circuit and subsequently replaced the components on my PCB to align with the new results. Replacing two of my trim capacitors proved challenging due to their size, but I managed to complete the task.

    During testing, I attempted to utilize the AAT function to automatically set the trim capacitors. However, after measuring with my VNA, I found the values to be significantly off. Consequently, I opted to use the setCaps(xx, yy) function to manually identify suitable values.

    After some experimentation, I discovered a promising combination of values, and upon measurement, the curve appears considerably improved compared to before. While it still does not exactly match the simulation, I achieved an impedance of 23 Ω - 1.6 Ω at 13.56 MHz, which I believed would resolve my issue.

    Despite these adjustments, I tested the tag detection again, but the error persists. The state machine from the demo example does not progress past the collision avoidance stage.

    To further troubleshoot, I plan to cross-connect a X-NUCLEO-NFC08A1 that I already have and see if I can get it operational. At this point, I feel I have exhausted all options on the analog side of my design to resolve this error.

    Best regards,
    Marc

    Graduate
    February 3, 2025

    I think I can add to this topic that something in the RFAL layer seems to be acting up. Since I found something very similar in my (unrelated) project today:
    If I set (RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_V) as techs2Find, collision avoidance with my NFC-A tags (in this case Mifare Desfire and Classic based) does no longer return a device (discovery itself still happens). What DOES get found is an NFC-A P2P listener device and my NFC-V device (ST25DV based).
    As soon as I disable RFAL_NFC_POLL_TECH_V the type A cards work as well (but of course the V device is not found).
    Polling for NFC-B as well does NOT impact the NFC-A performance.

    What I did try as well is increasing the totalDuration discovery parameter up to 1500ms, but that had no impact.

    Technical Moderator
    February 4, 2025

    Hi,

    if you set techs2Find to (RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_V) and you get a device of RFAL_NFC_LISTEN_TYPE_AP2P then there must be something wrong on your RAM: Stack overflow, wrong pointers being used, etc. 

    I am sure you use these settings on e.g. X-CUBE-NFC6 and you will not experience such artifacts. You will need to debug how the above actually happens.

    BR, Ulysses

    Graduate
    February 4, 2025

    I have an X-NUCLEO-NFC08A1 and multiple U5, WB or U0 disco and Nucleo boards here. Do you have a complete example project in mind which should work?