2025-01-15 03:07 AM
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
2025-01-31 03:26 AM
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
2025-01-31 04:53 AM
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
2025-02-03 02:03 AM
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
2025-02-03 07:42 AM - edited 2025-02-03 07:44 AM
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.
2025-02-04 01:21 AM
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
2025-02-04 01:56 AM
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?
2025-02-04 03:58 AM
Hi,
please see X-CUBE-NFC6. It comes with binaries and ready-working projects for at least NUCLEO-L476 and some others.
BR, Ulysses