2021-05-26 09:10 AM
Dear Sir/Madame,
I am using X-NUCLEO-NFC03A1 connected to our MCU (NXP Kinetis). The communication protocol used is SPI and it works well (sends and receives echo). Therefore, we would like to read a text on the smartphone in "NDEF tag emulator" mode, but in the reponses indicate that the NDEF file is not found.
Our goal is to deesign an access control with an NFC reader that is accesser with a smartphone application.
The commands used are extracted using the datasheet, page 78-81, D.1.5 Forum Tag Type 4A, and it works well until the commands after "Select Application" because it responds 0x6A 0x82 (file or application not found). The Select application responds 0x90 0x00 0xF1 0x00, but if I change the command to >>> CR95HFDLL_SENDRECV, 02 00 A4040007D276000085010100 28, it responds 0xF2 (I understand that the timeW is exceeded and I put the maximum value 0x60).
Could you please help us to solve this situation?
Thanks you and Best regards,
José Manuel.-
Solved! Go to Solution.
2021-05-27 11:34 AM
Hi José Manuel,
good to see you succeeded in reading an NDEF. As there is no native NDEF tag emulation mode in Android, I was suspecting you were using a specific application. I will have a look on this "NDEF Tag Emulator" app in Play Store.
I recommend to use the X-CUBE-NFC3 firmware package with its NDEF demo as a basis for your application. This provides the various protocol layers with the proper timings and the retransmission in case of RF error. The decoding of the NDEF is also supported. I would suggest to first evaluate this package on a NUCLEO-L476RG board as it is ready to use on it, to get familiar with the API and then port on your MCU (the whole library is MCU agnostic and has a very simple header file for porting on various MCU). See UM2045 for more information about the NDEF read/NDEF write demo. The firmware package supports various tag technologies but you can easily reduce the size of the code by disabling unused technologies through a set of defines.
Rgds
BT
2021-05-26 11:24 AM
Hi José Manuel,
thanks for using CR95HF devices.
For your information, the X-NUCLEO-NFC03A1 expansion board comes with a C scalable library package (X-CUBE-NFC3) supporting the NDEF features. A demo (NDEF Read and NDEF Write) for STM32 MCUs is provided but it can be easily ported on other MCUs.
As far as I know, Android smartphone does not have an NDEF Tag Emulator mode (unless you have a specific application) therefore, the Select NDEF Tag Application command or the Select CC File command should fail and the smartphone should reply 0x6A82. Can you elaborate on smartphone being used (Android or iOS) and which application?
As long as you receive an answer to your command, it is unlikely that TimerW is exceeded, so I suggest to not modify this register.
It seems there are some typos in the Appendix D of the CR95HF Datasheet. The proper APDU are:
Select NDEF Tag Application
02 00 A4 04 00 07 D2 76 00 00 85 01 01 00 (+ SendRecv transmission flag: 28 )
Select CC File
03 00 A4 00 0C 02 E1 03 (+ SendRecv transmission flag: 28 )
Read Binary (CC File)
02 00 B0 00 00 0F (+ SendRecv transmission flag: 28 )
I would suggest you first try on a real Type 4A tag (such as ST25TA).
Rgds
BT
2021-05-27 09:16 AM
Dear BT,
Today I have put these commands and I have come to read a text! You can get a free application called "NDEF Tag Emulator" in Play Store, it could be interesting for you.
On the other hand, What steps do you recommend for us to check until you detect a tag and then continue checking? Do you need to restart when you finish contacting a tag? Are some commands only inserted once or do they need to be repeated?
With this, I think I'm on a good step for development.
Thanks you and Best regards,
Best regards.
José Manuel
2021-05-27 11:34 AM
Hi José Manuel,
good to see you succeeded in reading an NDEF. As there is no native NDEF tag emulation mode in Android, I was suspecting you were using a specific application. I will have a look on this "NDEF Tag Emulator" app in Play Store.
I recommend to use the X-CUBE-NFC3 firmware package with its NDEF demo as a basis for your application. This provides the various protocol layers with the proper timings and the retransmission in case of RF error. The decoding of the NDEF is also supported. I would suggest to first evaluate this package on a NUCLEO-L476RG board as it is ready to use on it, to get familiar with the API and then port on your MCU (the whole library is MCU agnostic and has a very simple header file for porting on various MCU). See UM2045 for more information about the NDEF read/NDEF write demo. The firmware package supports various tag technologies but you can easily reduce the size of the code by disabling unused technologies through a set of defines.
Rgds
BT