Skip to main content
DIvan.1
Associate III
May 6, 2020
Solved

How to start with ST25R3911B and is It really necessary to use rfal and st25r3911 libraries for simpel project?

  • May 6, 2020
  • 39 replies
  • 7741 views

Hello everybody!

In my company We decided to use ST brand for our "NFC projects". Anyway, now I have Nucleo board 32f070RB and x-nucleo-NFC05a1 with ST25R3911B chip.

For now We have a simple project, just to read and write to/from the Tag (some of the classical tags, probably ISO14443A).

Unfortunately, there is no official Excample for x-nucleo-05a1 and 32F070RB. For now I just established SPI communication with microcontroller and 25R3911B chip(basic read/ write into a register).

Now I need a help because I confused about 2 things and If It's possible to answer me:

+ What is the steps to Initialize ST25R3911B and start communicate with Tag (I read a datasheet but it's a bit confusing for me)?

+ Is it necessary to use rfal and/or st25r3911 libraries or at list which is really necessary?

All the best,

Domen

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

Hi,

UM2253 (Getting started with the X-CUBE-NFC5 high performance HF reader / NFC initiator IC software expansion for STM32Cube) gives some informations about the RFAL architecture and about how to use the various sample applications.

Also, the  X-CUBE-NFC5 comes with Documentation folder that contains the API documentation and examples

Regarding the porting to NUCLEO-F401RE, I would suggest you port the poller application. As explained earlier, I would suggest you use STM32CubeMX to configure the SPI and the various GPIOs:

  • SPI (Full duplex master, Motorola format, 8 bits, MSB first, HW NSS disable - Software NSS, CPOL Low, CPHA 2 edges baud rate up to 5MBits/s
  • GPIO
    • IRQ_3911 external Interrupt mode with rising edge trigger detection
    • SPI_CS: output push pull
    • LEDs: output push pull

Then you just need to copy the /* USER */ parts of the main.c (and add st25r3911Isr() in EXTI0_IRQHandler) and update the platform.h with the pin mapping

I've attached the the NUCLEO-L476RG ioc for reference.

Rgds

BT

39 replies

Brian TIDAL
ST Technical Moderator
July 22, 2020

Hi,

actually different types of tag can use the ISO/IEC 14443-A-3 protocol layer: this can be Type 1, Type 2, Type 4A and even proprietary types. See

https://www.st.com/resource/en/technical_note/dm00190233-st25-nfc-guide-stmicroelectronics.pdf figure 20.

Can you share some information about the tag manufacturer and the model?

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.
DIvan.1
DIvan.1Author
Associate III
July 22, 2020

Hi Brian, sorry for weak-information message.

We just need simple Read/Write application (to control the amount of ammunition in the gun magazine).

We didn't specify the tag manufacturer and the model. You can recommended which would be good but we have a big space limitation and metal environment. Till now I was looking for simple ISO/IEC 14443-A protocol, type 1 or 2.

(We are also thinking to develope our own tag A-protocol, type 1 or 2)

Best,

Domen

Brian TIDAL
ST Technical Moderator
July 22, 2020

​Hi,

I would personnaly not recommand Type 1 but rather Type 2 or Type 4

If you plan to use a T2 tag, you can use the API provided in rfal_t2t.c: rfalT2TPollerWrite() and rfalT2TPollerRead(). You will find some examples of usage of these API in ndefT2TPollerReadBlock and  ndefT2TPollerWriteBlock.

For my own curiousity, why not using Type 5?

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.
DIvan.1
DIvan.1Author
Associate III
July 22, 2020

Brian, thanks for information I thought  ISO/IEC 14443-A-3 protocol is more common. I just want to be simple for develop and implementation (Because We don't have a lot of time for developing-like always :D ). So considering this, which one do you recommended?

Best, Domen

Brian TIDAL
ST Technical Moderator
July 22, 2020

​Hi,

Type 5 is simple to support: demo_polling.c provides an example of read/write in demoNfcv function. ST has a portfolio of type 5 tags for example ST25TV02K.

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.
DIvan.1
DIvan.1Author
Associate III
July 22, 2020

Okey you convinced me. We use all the components from ST so It makes sense to use V-type5 and ST25TV02K.

I'm using X-NUCLEO-NFC05A1 and software (STM32CubeExpansion_NFC5_V2.0.0). But I have a problem, I can't find demo_polling.c files. Can you help me where I can find It. I think We are talking about two different softwares/examples.

Best, Domen

Brian TIDAL
ST Technical Moderator
July 22, 2020

Hi,

the proper name is demo.c (it will be demo_polling.c in future updates).

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.
DIvan.1
DIvan.1Author
Associate III
July 22, 2020

Brian, thank you very much! This morning I was giving up with NFC05A1 and start searching for NFC03A1 (I think, everythink is a little bit more clear to understand) but now, You gave me a clearance and new energy for developing :)

Thanks!

All the respect,

Domen

DIvan.1
DIvan.1Author
Associate III
October 12, 2020

Hello again!

I would be very happy if you can give me an advice about software adjust:

I have a fully workable program on nucleo board with chip 32F070RB. I couldn't get this microcontroller in the store so I bought 32F070C6T6.

The microcontroller is pretty much the same (pinout is a bit different and some other functions).

Now I need to transfer the software from 32F070RB to a 32F070C6T6. Can you give me advice of which way would be the easiest to transfer.

I was thinking about two ways:

  1. Define all the parameters in cubeMX and than copy-paste the code and include all the librarys/paths
  2. just change MX file in current project and also change code (GPIO and communication declaration)

Is there any other ways to do that?

All the best,

Domen Ivanc