nRF5 SDK v15.3.0
NFC Type 4 Tag

Type 4 Tag is one of the tag types that are defined by the NFC Forum. This implementation is based on the following specification document:

A Type 4 Tag must contain at least the NDEF Tag application. This application provides a file system that consists of at least two Elementary Files (EFs):

The nRF5 SDK provides a Type 4 Tag library that uses application protocol data units (APDUs) to communicate over the ISO-DEP (ISO14443-4A) protocol with any polling NFC device. As with Type 2 Tag, Type 4 Tag also supports NFC-A listen mode. In this mode, the tag can only wait for polling devices, but it does not actively start a connection.

The Type 4 Tag library provides functions to enable the NFC tag and configure the tag data. It uses the NFCT driver module to access the NFCT hardware. The Type 4 Tag library is available as a precompiled linkable library. Its API is described in NFC tag 4 type emulation library.

Note
When using NFCT driver, you must enable the clock in the sdk_config configuration file. To do that, set the following configuration parameter:
#define NRF_CLOCK_ENABLED 1
Additionally, you cannot use TIMER4 because it is used by the NFCT driver.

The Type 4 Tag library supports three different modes of emulation:

Mode type Description
Raw ISO-Dep exchanges All APDUs are signaled through the callback.
Read-Only T4T NDEF tag The NDEF file cannot be modified. Only NFC field status and NFC_T4T_EVENT_NDEF_READ can be signaled through the callback.
Read-Write T4T NDEF tag The NDEF file can be modified. The changes to the NDEF content are signaled through the callback.

To read data from the Type 4 Tag, a polling device is needed. Similarly to the Type 2 Tag, you can use either a mobile device or the Adafruit PN532 NFC shield (see Adafruit NFC Shield library). For the NFC shield, the Type 4 Tag NDEF detection procedure module can be used to parse the raw data into Type 4 Tag format.

NDEF file format

The NDEF file is a file type that can be present in a Type 4 Tag platform. It consists of following fields:

Field Length Description
NLEN 2 bytes Length of the NDEF message in big-endian format.
NDEF Message NLEN bytes NDEF message. See NDEF message and record format.

You can notice that NDEF file adds one additional field in comparison to the raw NDEF message. It is called NLEN and is required for an NDEF file. This field encodes the total length of the NDEF message.

Type 4 Tag NDEF detection procedure


Documentation feedback | Developer Zone | Subscribe | Updated