Using LRIxx, LRISxx and M24Lxx-R products as NFC vicinity tags
Introduction
The NFC technology allows accessing standard ISO/IEC 15693 products such as
STMicroelectronics Dual interface EEPROMs (M24LR04E-R, M24LR16E-R and
M24LR64E-R) and ST ISO/IEC 15693 RFID tag products (LRI1K, LRI2K, LRIS2K and
LRIS64K).
The NFC forum specifies a data structure standard named NDEF allowing user data
exchange. Data can be either text, URI or picture.
RFID or NFC tag memory can embed NDEF messages and share it with different hosts
(reader, mobile phone).
This application note explains how to apply the NDEF format to STMicroelectronics ISO/IEC
15693 products (LRI1K, LRI2K, LRIS2K, LRIS64K and M24LR64-R).
cards - Vicinity cards - Part 3: Anti-collision and transmission protocol
■ NFC forum documents
– [NDEF]: NFC Data Exchange Format (NDEF) Technical Specification; NFC Forum™;
NDEF 1.0
– [URI]: URI Record Type Definition document; NFC Forum™
– [RTD] : NFC Record Type Definition; NFC forum
– [BLUETOOTH] : Bluetooth Secure Simple Pairing Using NFC; NFC forum
– [TEXT] : Text Record Type Definition; NFC forum
– [TAG-2]: Type 2 Tag Operation Technical Specification; NFC Forum™; 1.1
Memory organization for STMicroelectronics ISO/IEC 15693 productsAN3408
1 Memory organization for STMicroelectronics
ISO/IEC 15693 products
The ST ISO/IEC 15693 contactless tag (LRI1K, LRI2K, LRIS2K, LRIS64K) and the dual
interface memory (M24LR04E-R, M24LR16E-R and M24LR64E-R) is divided into three
different areas:
●User memory area, where the user can read and write data.
●System area, which contains UID, DSFID and AFI fields.
●Protection system area, which contains the user memory area protection.
Access rights to the different memory fields are given in Ta bl e 2 .
Table 2.Access rights to memory fields
Operation
R e a dYe sYe sYe sYe s
WriteYesNoYesYes
LockYes
User memory
area
For more details on the protection system, refer to the corresponding STMicroelectronics
datasheet.
1.1 User memory area
The user memory stores NDEF messages. This area can be write-protected by the user.
The user memory size depends on ISO/IEC 15693 contactless tag, as shown in Ta bl e 3 .
The user memory area of ISO/IEC 15693 STMicroelectronics products can be writeprotected. The granularity of the protection can be either 4 bytes or 128 bytes as defined in
Ta bl e 6 below.
Table 6.ST ISO/IEC 15693 sector size
LRI1KLRI2KLRIS2KLRIS64KM24LR4E-R
M24LR16E-RM24LR64
E-R
Memory block
size
4 bytes128 bytes
For more details on the protection system, please refer to the corresponding
STMicroelectronics datasheet.
●The LRIS64K and M24LRxx memory write-protected granularity is the sector.
●The LRI1K, LRI2K and LRIS2K memory write-protected granularity is the block.
Doc ID 018867 Rev 27/37
NDEF dataAN3408
2 NDEF data
NDEF, which stands for NFC data exchange, is a data format defined by the NFC forum.
This format defines a message encapsulation format to exchange information between a
reader and a contactless tag.
NDEF can be used to exchange different types of information such as text, URI and others.
This chapter details NDEF for the following types of information:
●text
●URI
●vCard, which is a virtual business card
●Bluetooth, that allows to carry out the pairing between two bluetooth devices.
2.1 Overview
NDEF data is composed of:
●Capability container
●TLV field, which includes the NDEF message.
The TLV field is located after the CC field. The size of a TLV field is computed according to
the CC2 byte value.
2.2 Capability container field
The Capability container field (CC field) is a 4-byte field that contains an identification value
used to store an NDEF message. The signification of each byte is explained in Tab l e 7.
Table 7.Capability container field description
Byte name
CC000xE17:0NDEF message is present into memory (called magic number)
CC110xXX
CC220xXX7:0Memory size of data field and CC field in bytes (= CC2 * 8)
CC330x0X
number
Byte
ValueBitFunction
7:6Major version number
5:4Minor version number
3:2Read access condition
1:0Write access condition
7:3RFU
2
1RFU
0
1: the IC memory size exceeds 2040 bytes (CC2 overflow)
0: the IC memory size is only defined by CC2 value
1: IC supports ReadMultipleBlocks Command
0: IC does not support ReadMultipleBlocks Command
(1)
8/37Doc ID 018867 Rev 2
AN3408NDEF data
1. If bit number 2 of CC3 is set, the memory size exceeds 2040 bytes (CC2 overflow). The real memory size can be obtained
with the GetSystemInformation command. For more information about the GetSystemInformation command, refer to the
corresponding STMicroelectronics datasheet.
Read access condition values defined by bit 3 and bit 4 of CC1 byte are described in
Ta bl e 8 .
Table 8.Read access condition
Read access condition valueDescription
0b00Free read access
0b01RFU
0b10RFU
0b11RFU
Write access condition values defined by bit 0 and bit 1 of CC1 byte are described in
Ta bl e 9 . Write access condition values depend on the product. For more details, refer to the
corresponding STMicroelectronics datasheet.
Table 9.Write access condition
Write access
condition value
DescriptionLRI1k, LRI2k
LRIS2k, LRIS64k,
0b00Free write accessYesYes
0b01RFUNoNo
0b10
Write password access (data can be
written after sending a password)
NoYes
0b11No write accessYesYes
Note:Bit 2 and bit 3 of CC1 byte (read access values) shall be reset to 0b00 value.
The user shall set the write protection bit according to bit 0 and bit 1 of CC1 byte. For more
details, refer to the definition of the lock command in the corresponding STMicroelectronics
datasheet.
CC20x107:0Data field and CC field size = 16*8 = 128 bytes
CC30x007:0IC does not support Read multiple block
2.3 NDEF message using TLV format
A TLV format is a generic data structure used to embed information and to store NDEF
messages. The TLV format is composed of three fields:
●Type field (T)
●Length field (L)
●Value field (V): contained user message.
Table 11.TLV format description
Length (bytes)11 or3Lfield value
Data description
For more information on the TLV format, refer to [TAG-2] NFC forum – on page 1.
2.3.1 T field values
Ta bl e 1 2 below lists the T field values as defined by the NFC forum.
Table 12.T field values and description
TLV block nameT field valueDescription
NULL TLV0x00Used to padding.
Lock control TLV0x01It defines details of the lock bits.
Memory control TLV0x02It identifies reserved memory areas.
NDEF message TLV0x03It contains NDEF message.
Proprietary TLV0xFDTag proprietary information.
Terminator TLV0xFELast TLV block in the data area.
T fieldL fieldV field
Type of TLV block,
see Ta bl e 12
Number of bytes of
V field
Data
10/37Doc ID 018867 Rev 2
AN3408NDEF data
2.3.2 L field format
The L field can be either coded on 1 or 3 bytes, as shown in Ta bl e 1 3.
Table 13.L field byte format
Byte formatByte numberValue
110x00 to 0xFE
3
1. The 0xFF FFFF value is the concatenation of the bytes 0xFF and 0xFFFF.
2.3.3 V field: NDEF message
The V field is composed of a record head byte, the NDEF message and TLV terminator. The
record head byte is described in a): Record head byte.
An application example is given to illustrate a TLV field: it is a URL, as specified in the “URI
Record Type Definition” document (NFC forum). see Chapter 4.2: URI record.
a) Record head byte
An NDEF message can contain 1 or more NDEF records. The record head byte gives some
information on the current NDEF record.
The different fields of record head byte are described in Ta bl e 1 4.
Table 14.Record head byte fields description
NameBitFunction
MB (message begin)7
10xFF
30x00FF to 0xFFFE
(1)
1: This record is the first of NDEF message.
0: This record is not the first of NDEF message.
ME (message end)6
1: This record is the last of NDEF message.
0: This record is not the last of NDEF message.
1: this record is the initial or middle record chunk.
CF (chunk flag)5
0: this record is the terminating record chunk.
SR (short record)4
1: the payload
0: the payload
(1)
length is on one byte.
(1)
length is more than one byte.
1: ID length field is present.
IL (ID_length flag)3
0: ID length field is omitted.
TNF2:0TNF indicates the structure of the type field (see Ta bl e 1 5 ).
1. Payload is NDEF message body.
b) Type name format field values
The type name format (TNF) is a 3 bits value that indicates the structure of the value of the
type field.
Doc ID 018867 Rev 211/37
NDEF dataAN3408
Table 15.Type name format field values
Type name formatValue
Empty
0b000
NFC forum well known type0b001
Media type as defined in RFC 20460b010
Absolute URI as defined in RFC 39860b011
NFC forum external type0b100
Unknown0b101
Unchanged0b110
Reserved0b111
Example 1
This record head defines an NDEF message which is composed of one record
(MB = ME = 1).
Table 16.Example of a record head byte structure
Record
head byte
0xD111010001
Type record
head byte
MBMECFSRILTNF
This is the first record
This is the last record
This record is the termination chunk
The payload length size in on one byte
The ID length is omitted
NFC forum well known type
For more information about the record head byte, refer to the NDEF data exchange format
(NDEF) document.
12/37Doc ID 018867 Rev 2
Loading...
+ 25 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.