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

1 ACCEPTED SOLUTION

Accepted Solutions
Ulysses HERNIOSUS
ST Employee

Hi Karim,

the projects build out of the box - given you have the toolchain pre-installed. In the package are also pre-compiled binaries which you can directly load and observe.

Regards, Ulysses

View solution in original post

31 REPLIES 31
Ulysses HERNIOSUS
ST Employee

Hi Karim,

AFAIK the X-CUBE-NFC3 is for F103, F401 and L476. So I assume you did some porting to F091?

Maybe you can highlight your configuration of SPI and interrupt pin.

Also if you look into rfalInitialize() it calls a function st25r95CheckChipID() which will be helpful for you.

Ulysses

KBens.1
Associate II

Hello Ulysses,

Thanks you for your fast answer ! =)

Actually yes, I noticed there are three main documents in the package, wich shows that the NFC application have been tested on the F103, F401 and L476. To be honest, I tried first to see what kind of change I would have to do to adapt it to the R091RC, but I failed 😅

I succed to develop SERIAL communication and transmit/receive message on the F091RC, but first I generated the code with the CUBE MX, so i didn't have to care about any configuration stuff (wich has been made on MXCUBE).

So basically no i didn't do anything to adapt it to the F091RC, because i don't know how to, and if you could help me on this it would be great (This is the first time I am developping on STM32 and STM32 IDE, I am coming from Arduino IDE)

I am learning baout the rfal librairies, but i would like to valid the pre made applications to understand the context, and then develop my own.

Thanks you for your time,

Best regards,

Karim

KBens.1
Associate II

To illustrate what i am trying to do at the moment, is to execute the ndef_demo.c sample. Here , am on the F103 example. Obviously, I have to do some changes to adpat it, but i can't see wich part I have to change. I can notice the HAL drivers are differents, but there aren't used.

0693W000000TkxvQAC.png

Ulysses HERNIOSUS
ST Employee

Hi,

actually HAL is being used from spi.c (HAL_SPI_TransmitReceive()).

Please debug through the above mentioned functions to see if you are able to receive the chip ID. If you don't receive it you will need to check the Pin configuration CubeMX to see if the used SPI block is connected to the right pins for the shield.

At some point you may want to observe with a logic analyzer / scope.

Regards, Ulysses

KBens.1
Associate II

I will order the STM32F103RB NUCLEO, then I will be able to load directly the application without having to do any changes. Can you confirm i will have nothing to do but building the projet and run it ?

Ulysses HERNIOSUS
ST Employee

Hi Karim,

the projects build out of the box - given you have the toolchain pre-installed. In the package are also pre-compiled binaries which you can directly load and observe.

Regards, Ulysses

KBens.1
Associate II

Hi Ulysses,

Thanks you. I will receive this F103 NUCLEO on Monday, i will come back to you for any further questions 😉

Best regards,

Karim

KBens.1
Associate II

Hello Ulysses,

So a couple days after my last message, I am currently working on a NUCLEO-F103RB, wich is compatible with one of the application on the X CUBE NFC package. So when I run the application "STM32F103RB_Nucleo_PollingTagDetectNdef", it's working fine. I can tag different NFC devices, and read there UID.

Now, i'm trying to read the NDEF message present on the NFC tag. I checked the compatibility ISO/IEC 14443 Type A and B, so the application should work with my NFC Device.

But for the moment, an error is showing up on the terminal when I aml reading with the NFC Nucleon NFC03A1 :

0693W000000U5mFQAS.png

Obviously, i made some research and trying to find out what is this error.0693W000000U5mjQAC.png

So the function ndefPollerNdefDetect  will able to determine if there is an error, and what kind, by returning an integer.

0693W000000U5n8QAC.png

0693W000000U5nDQAS.png

Based on the "Return Code", I am currently receiving the line "#define ERR_REQUEST            ((ReturnCode)5U) /*!< invalid request or requested function can't be executed at the moment */"

The problem is : why ?

I am using compatible NFC device, and i didn't modified the original code of the application, shouldn't it works ?

Ulysses HERNIOSUS
ST Employee

Hi Karim,

the application will try to read NFC Forum formatted T2T, T3T, T4T and T5T.

Generally the different tags will not automatically be able to act as one of these tag types. Even if a tag is compatible it still needs to be formatted: Write an NFC Forum Capability Container (CC) to the tag.

IMO if NDEF Detect fails it can simply mean no CC was detected. Which tag are you using?

For ST25TV you could use the ST25NFC Android app to properly format.

Regards, Ulysses