Skip to main content
Graduate
October 16, 2023
Solved

R/W a Tag using ST25R3916

  • October 16, 2023
  • 5 replies
  • 2956 views

Hello everyone, 

I want to Read / Write a Tag using the X-Nucleo - NFC08A1. The demo project(polling) runs perfectly. I also installed X-Cube-NFC6. Which rfal libary is the best and how do I implement the function in the main.c.

 

Tnak you for helping

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    Hi,

    basically, the demo provides an almost turnkey solution: after some initialization, the main() loops on MX_X_CUBE_NFC6_Process() that does the job to detect a tag and reads its unique ID. Then, when a type V tag has been discovered, the demoCycle calls demoNfcv where the user can add its own code  for his application.

    demoNfcv provides a example of reading the block #1 of a type 5 tag with the function rfalNfcvPollerReadSingleBlock. You just need to modify the code in demoNfcv to read the various blocks required by your application with rfalNfcvPollerReadSingleBlock

    Rgds

    BT

    5 replies

    Technical Moderator
    October 17, 2023

    Hi,

    I would suggest to reuse the demo project you have built and to base your application on top of it.

    Rgds

    BT

     

    CT-55555Author
    Graduate
    October 17, 2023

    Hello Brian, 

    I tried you'r suggestion, but I'am not sure how to built the application on top of the base. 

    I have a NFC-Tag type V and I want to use the function: static void demoNfcv(rfalNfcvListenDevice *nfcvDev). Which steps are needed to use this function ?

    Rgds

     

    Technical Moderator
    October 17, 2023

    Simple: include your code in this function :)

    CT-55555Author
    Graduate
    October 17, 2023

    Sorry but I don't really get it. I'am new to STMCubeIde. Can you explain ist a little more specific. I got my main.c and the demo_polling.c. Which steps are needed to get this function running.

    Thank you for you're help. 

    Technical Moderator
    October 17, 2023

    Hi,

    When reading back https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/problem-to-connect-nucleo-nfc08a1-with-stm32f205vet6-via-spi/td-p/598247 and "The demo project(polling) runs perfectly." my understanding is that you've been able to generate the polling application from STM32CubeMX and been able to run it on your custom board.

    Did I miss something?

    Rgds

    BT

    CT-55555Author
    Graduate
    October 18, 2023

    Hi, 

    that is correct. I'm able to detect different types of NFC-Tag's with the demo polling.

    Rgds

    CT-55555Author
    Graduate
    October 18, 2023

    So if I put a Tag next to the reader the LED's show me which type of Tag is used. But now I want to read and write a Tag. 

    Rgds

     

    Technical Moderator
    October 18, 2023

    Hi,

    basically, the demo provides an almost turnkey solution: after some initialization, the main() loops on MX_X_CUBE_NFC6_Process() that does the job to detect a tag and reads its unique ID. Then, when a type V tag has been discovered, the demoCycle calls demoNfcv where the user can add its own code  for his application.

    demoNfcv provides a example of reading the block #1 of a type 5 tag with the function rfalNfcvPollerReadSingleBlock. You just need to modify the code in demoNfcv to read the various blocks required by your application with rfalNfcvPollerReadSingleBlock

    Rgds

    BT

    CT-55555Author
    Graduate
    October 18, 2023

    Hi Brian, 

    I found my mistake and I realise how stupid it was thank you for you're patience. Now I just need to see the messages from plaformLog(). It uses Usart am I right ? So therefore you just need a terminal to read the COM-Port or is there something I am missing ? 

     

    Rgds 

    Technical Moderator
    October 18, 2023

    Hi,

    by default, platformLog() uses an UART/USART serial interface bridged by the ST-Link to an USB Virtual Com Port (VCP). So you just need a serial terminal on your PC connected to this VCP.  The platformLog() function-like macro can be easily customized to use your own log mechanism. 

    Rgds

    BT

    CT-55555Author
    Graduate
    October 19, 2023

    Hi, 

    I'm using USART1 on the STM32F205VET6( PA10 - RX, PA9 - TX). I also use a USB interface converter and connected RX(STM32) with TX(Converter) and TX(STM32) with RX(Converter) and dont receive any messanges on the terminal. 

    Rgds