Skip to main content
Visitor II
January 23, 2020
Solved

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

  • January 23, 2020
  • 5 replies
  • 1530 views

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 ​

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

    ​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.

    5 replies

    Technical Moderator
    January 23, 2020

    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

    MSava.1Author
    Visitor II
    January 23, 2020

    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

    Technical Moderator
    January 24, 2020

    ​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.

    MSava.1Author
    Visitor II
    January 30, 2020

    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.

    Technical Moderator
    February 3, 2020

    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