cancel
Showing results for 
Search instead for 
Did you mean: 

How to launch properly application to read NFC tag with an NFC03A1 nucleo attached to a NUCLEO F091RC ?

KBens.1
Associate II

Hello,

I am trying to read some NFC tag with a X-NUCLEO-NFC03A1 attached to a NUCLEO F091RC board. I am a beginner into those technology, so basically I was trying to load the sample "NFC Detect " from the package "X-CUBE-NFC3" wich can be found on ST official website to understand how to use NFC stuff. The problem is, I tried to build the project on the STM32 IDE Cube, and it worked fine, but i can't read anything on the NFC NUcleo's antenna after running the programm.

I suppose there are problems of initialisation , but i have no idea how to debug this.

Thanks you for your time,

Best Regards,

Karim

31 REPLIES 31

Hi Brian ,

Yes it's my fault, I wasn't very clear about my explications. Thanks to you now I have more knowledge about RFID to explain my situation :

Regarding the T2T issue ;

According to the NFC tool android application, it's an NXP MIFARE Ultralight- NTAG 213

0693W000000UWZeQAO.jpg

But i don't understand how you manage to find the Control lock TLV on adress 16, because when I study the data sheet , it's only for user memory :

0693W000000UWjcQAG.jpg

https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf

Regarding the M24LR (T5T)

After formating from X PACKAGE application, and write through X PACKAGE application too, i can read on the android application :

0693W000000UWkkQAG.jpg

And the memory :

0693W000000UWhSQAW.jpg

Then i tried to modify the message and read back the memory again :

0693W000000UWlnQAG.jpg

And when I try to read it back on the X PACKAGE application, it's working fine :

0693W000000UWmlQAG.jpg

But, i am now trying to understand why the adress n°05; 06; 07 has changed when i modified the message.

Thanks,

Best regards,

Karim

Brian TIDAL
ST Employee

Hi Karim,

for T2T: as per the NFC Forum Technical Specification T2T v1.0, different TLV can be present after the Capability Container: Null TLV, Lock Control TLV, Memory Control TLV, etc.

For the M24LR, the NDEF TLV starts at address 4:

  • 0x03 is the T-field for a NDEF Message TLV
  • 0x1E/0x17 is the L-field. As your message has a different size than the initial message, the L-field has changed

For more information, see:

  • Type 2 Tag Technical Specification Version 1.0
  • Type 5 Tag Technical Specification Version 1.0
  • NFC Data Exchange Format Technical Specification Version 1.0

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Brian,

Thanks you for all your informations . I have a lot more understanding of the hardware and software, i will come back for any further questions 🙂

Best regards,

Karim

Hello Brian,

For the final step on my project with those elements, i would like to adress specific value on memory blocks of the M24LRE EEPROM. According to this document, it exist function avaible to do such : https://www.st.com/resource/en/application_note/cd00271422-developing-your-m24lr64-r-datalogger-application-for-temperature-acquisition-stmicroelectronics.pdf

But I can't find ST IDE compatible projects to experiments this functions. Do you know if there is any example available on ST IDE ?

To be more clear, i need to learn how to write on the EEPROM memory blocks, to interact with an another application, wich answer depending on the EEPROM memory blocks value.

I am still using nucleo F091RC and NFC03A1 to interact with the M24 tag.

Best regards,

Karim

Brian TIDAL
ST Employee

Hi,

M24LR is a dual interface EEPROM:

ST25R95 <--- RF ---> M24LR <--- I2C ---> MCU

On RF side, the M24LR64E-R follows the ISO/IEC 15693 standard and the physical memory is organized in block of 4 bytes. Due to memory capacity, the read/write commands (such as Read Single Block/Read Multiple Blocks, Write Single Block or Write Multiple Blocks) have been extended to support 2-bytes block address. This is supported through the following RFAL API in rfal_st25xv.c:

  • rfalST25xVPollerM24LRReadSingleBlock
  • rfalST25xVPollerM24LRWriteSingleBlock
  • rfalST25xVPollerM24LRReadMultipleBlocks
  • etc.

Rgds

Bruno

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
KBens.1
Associate II

Hello Brian (Bruno ? )

Thanks you again for those very precise informations. It was exactly the functions I was looking for. But i am encoutering some problems with the arguments of the functions (especially with UID and FLAG arguments) . Would it be possible to get an example of the rfalST25xVPollerM24LRReadSingleBlock and rfalST25xVPollerM24LRWriteSingleBlock functions ?

It's the final step on my project.

Best regards,

Karim

Brian TIDAL
ST Employee

Hi,

see demoNfcv() in demo.c for example of how to set UID and flag parameters.

Basically

uid = nfcvDev->InvRes.UID and flag = RFAL_NFCV_REQ_FLAG_DEFAULT

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello,

Thanks you again for your advice. I studied the rfal_st25xv.c librarie to understand how I could manage to read and write into the memory blocks. As you noticed me, the demoNfcv() as been created to do so. I tried to use it,I copied/pasted it to the ndef_demo.c file, because i can't run it from the demo.c file (wich has been like excluded from the project) :

0693W000000XDnRQAW.png

I am still using the M24 tag, so I am calling the function at the right place, when an ISO15693 has been detected.

0693W000000XDq6QAG.png

As you can see i have put the demoNfcv function.

And now i got a read block error, but no error code is returned, so i can't understand why it is failling :

0693W000000XDtZQAW.png

Best Regards,

Karim

Brian TIDAL
ST Employee

Hi Karim,

the demoNfcv uses rfalNfcvPollerReadSingleBlock() whereas a M24LR64 tags has a extended block number coding.

rfalNfcvPollerReadSingleBlock() works for standard ISO15693 tags whereas rfalST25xVPollerM24LRReadSingleBlock has to be used for M24LR64 or M24LR16 tags.

If you want to read a block from a M24LR16 or M24LR64 tag, you just need to replace rfalNfcvPollerReadSingleBlock by rfalST25xVPollerM24LRReadSingleBlock in the demoNfcv.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Brian,

I tried to replace rfalNfcvPollerReadSingleBlock()  by the rfalST25xVPollerM24LRReadSingleBlock function. Here in the code (ndef_demo.c) :

0693W000000XIKoQAO.jpg

I added a static variable with the asked structure :

0693W000000XIL8QAO.jpg

And I just replaced the demoNdef(nfcDevice) originally in the code by the demoNfcv() .

0693W000000XIO2QAO.jpg

No error or warining during compilation, but when I am trying to read through the application, still got read block fail :

0693W000000XIOMQA4.jpg

Best regards,

Karim