cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to get the sample program for the x-nucleo-nfc03a1 working and could use some help

MSava.1
Associate II

I am a student and am trying to get the sample program working for the x-nucleo-nfc03a1 working. I am using the Truestudio IDE​ and the board is docked to the stm32-nucleo-401re.

it compiles but when I try to run the sample program it gets stuck failing the initialize the rfal.

any help would be appreciated ​

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

​Hi,

STM32F401RE_NUCLEO_PollingTagDetectNdef.bin contains the NDEF demo supporting NDEF read / write for T2T, T3T, T4T and T5T tags. The T2T NDEF formated tag you are using is supported and has been tested. Example of NDEF read of a formated T2T tag:

ISO14443A/NFC-A card found. UID: 04BCE8B2551D80
INITIALIZED NDEF detected.
NDEF Capability Container
 * Magic: E1h Version: 1.0 Size: 6 (48 bytes)
 * readAccess: 00h writeAccess: 00h
 CC Raw Data (length 4)
 [0000] E1 10 06 00             | . . . .         |
NDEF Len: 0, Offset=18
Operation completed

Make sure to have the tag being really NDEF formatted i.e Capability Container present with proper values + NDEF TLV present.

Example:

[003] E1 10 06 00 
      E1          CC0: Magic Number E1h
         10       CC1: version 1.0
            06    CC2: MLEN = 06h (48 bytes)
               00 CC3: readAccess: 00h writeAccess: 00h
[004] 03 00 FE 00
      03          T-field: 03h (NDEF Message TLV)
         00       L-field: 00h No V-Field 
            FE    T-fielf: FEh (Terminator TLV)

You can use some Android applications from the manufacturer of this tag to properly format the tag for NDEF.

Rgds

BT

P.-S. : I believe P2P is not used in your case. Just standard communication with T2T tag.

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.

View solution in original post

5 REPLIES 5
Brian TIDAL
ST Employee

Hi,

would you please confirm that you have the following setup:

  • HW
  • SW
  • PC:
    • USB connected to board and serial terminal connected to the ST-Link Virtual Comm port

Please make sure to have the X-NUCLEO-NFC03A1 expansion board being properly plugged into the Nucleo board (check that all pins are correctly inserted)

X-CUBE-NFC3 2.1.0 supports:

  •  IAR™ Embedded Workbench for Arm® (EWARM) toolchain
  • Keil® Microcontroller Development Kit (MDK-ARM™) toolchain
  • STM32CubeIDE Integrated Development Environment for STM32

I would suggest to use STM32CubeIDE instead of  Truestudio IDE​.

X-CUBE-NFC3 2.1.0 includes binary files for the demos provided in the package (see STM32CubeExpansion_NFC3_V2.1.0\Projects\STM32F401RE-Nucleo\Applications\PollingTagDetect\Binary). Would you please download the binary file for the poller demo and check that system is operational ("Initialization succeeded.." message on the serial display)? You just need to drag & drop the STM32F401RE_NUCLEO_PollingTagDetect.bin binary to the NODE_F401RE drive to download it into the Nucleo board.

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.
MSava.1
Associate II

Thanks for the response. I am now downloading the STM32CubeIDE. Also upon using a different nfc expansion board it works sort of. It now initializes and detects my tags but cant open the p2p to write to my tags. The tag i have is mifareultralight/NFCA ndef formatted.

again thanks for the help

Brian TIDAL
ST Employee

​Hi,

STM32F401RE_NUCLEO_PollingTagDetectNdef.bin contains the NDEF demo supporting NDEF read / write for T2T, T3T, T4T and T5T tags. The T2T NDEF formated tag you are using is supported and has been tested. Example of NDEF read of a formated T2T tag:

ISO14443A/NFC-A card found. UID: 04BCE8B2551D80
INITIALIZED NDEF detected.
NDEF Capability Container
 * Magic: E1h Version: 1.0 Size: 6 (48 bytes)
 * readAccess: 00h writeAccess: 00h
 CC Raw Data (length 4)
 [0000] E1 10 06 00             | . . . .         |
NDEF Len: 0, Offset=18
Operation completed

Make sure to have the tag being really NDEF formatted i.e Capability Container present with proper values + NDEF TLV present.

Example:

[003] E1 10 06 00 
      E1          CC0: Magic Number E1h
         10       CC1: version 1.0
            06    CC2: MLEN = 06h (48 bytes)
               00 CC3: readAccess: 00h writeAccess: 00h
[004] 03 00 FE 00
      03          T-field: 03h (NDEF Message TLV)
         00       L-field: 00h No V-Field 
            FE    T-fielf: FEh (Terminator TLV)

You can use some Android applications from the manufacturer of this tag to properly format the tag for NDEF.

Rgds

BT

P.-S. : I believe P2P is not used in your case. Just standard communication with T2T tag.

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.
MSava.1
Associate II

Thanks for all your help. I have gotten it working now. Can I ask a question is there a resource to explain the nfc functions in the libraries? my ultimate goal is to read a plain text message stored on my TAG and transmit that message to a phone via bluetooth.

Brian TIDAL
ST Employee

Hi,

For the documentation:

  • the RFAL API documentation is available in STM32CubeExpansion_NFC3_V2.1.0\Middlewares\ST\rfal\doc\rfal.chm
  • the NDEF API documentation is available in STM32CubeExpansion_NFC3_V2.1.0\Middlewares\ST\ndef\doc\ndef.chm

NDEF API examples can be found in : STM32CubeExpansion_NFC3_V2.1.0\Middlewares\ST\ndef\doc\examples.

The PollingTagDetectNdef demo code can also be used for your needs

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.