ST STSW-ST25DV002 User manual

Introduction
This document describes the functionalities of the STSW-ST25DV002 firmware, developed to take full advantage of the
ST25DV64KC-DISCO board functionalities, working with any dynamic tag of the ST25DV-I2C Series.
In this document, the dynamic tag series from STMicroelecronics is referred to as ST25DV-I2C tags.
The ST25DV-I2C tags are integrated circuits (IC) for contactless applications that communicate with a microcontroller through
an I2C interface; this makes this device a dynamic tag. On the RF side, the reader (for instance a smart phone) retrieves and
updates the content of the tag when close by.
The reader communicates with the ST25DV64KC-DISCO board using the ISO 15693 protocol, while the STM32L476xx
microcontroller device communicates with the ST25DV-I2C tag through an I2C bus.
With this discovery kit, the ST25DV-I2C tag is ready to receive any content, following the NFC Forum standard. This means that
a smart phone is able to natively read it, without having previously installed any specific application.
A specific Fast transfer mode allows the user to transfer data directly to the microcontroller, without using the embedded
EEPROM.
STSW-ST25DV002 firmware for the ST25DV64KC-DISCO board
UM2949
User manual
UM2949 - Rev 1 - February 2022
For further information contact your local STMicroelectronics sales office.
www.st.com

1General information
This document applies to the STM32L476xx Arm®-based microcontroller devices.
Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
UM2949
General information
UM2949 - Rev 1 page 2/60

2List of acronyms and notational conventions
2.1 List of acronyms
Table 1. Acronyms
Acronym Definition
APB Advanced peripheral bus
AAR Android™ application record
BLE Bluetooth® Low Energy
CAN Controller area network
GPS Global positioning system
GPO General purpose output
H2R Host to reader
IEC International electrotechnical commission
ISO International standards organization
MCU Micro controller unit (microcontroller)
NFC Near field communication
OOB Out of band
R2H Reader to host
RF Radio frequency
RFID Radio frequency identification
RISC Reduced instruction set computer
SPI Serial peripheral interface
URI Uniform resource identifier
URL Uniform resource locator
USB Universal serial bus
2.2 Number convention and notation
The following conventions and notations apply in this document unless otherwise stated:
• Binary numbers are represented by strings of 0 and 1 digits starting with the most significant bit (MSB) on
the left followed by the least significant bit (LSB) on the right, and "0b" added at the beginning. Example:
0b11110101.
• Hexadecimal numbers are represented by using numbers 0 to 9 and characters A to F, and adding "0x" at
the beginning. The MSB is shown on the left and the LSB on the right. Example: 0xF5.
• Decimal numbers are represented without any leading character. Example: 245.
UM2949
List of acronyms and notational conventions
UM2949 - Rev 1 page 3/60

3Overview
3.1 ST25DV-I2C tag
The ST25DV-I2C tag is a dynamic tag IC for contactless applications (ISO 15693). It manages the RF
communication with a reader. It also includes frame coding, RF modulation and manages the anti-collision
process.
The ST25DV-I2C tag works as an NFC Forum Type 5 tag, supporting: detection, read and write operations. As
shown in Figure 1, this device communicates with a reader without any external controller.
Figure 1. Communication scheme
MCU ST25DV-I2C RF
I2C
3.2 STM32L476xx microcontroller devices
The STM32L476xx microcontroller devices are ultra-low-power microcontrollers based on the high-performance
Arm® 32-bit RISC core operating at a frequency of up to 80 MHz. The Arm® Cortex®-M4 core features a
floating point unit (FPU) single precision, which supports all Arm® single-precision data-processing instructions
and data types. It also implements a full set of DSP instructions and a memory protection unit (MPU) to enhance
application security.
The STM32L476xx microcontroller devices embed high-speed memories (up to 1 Mbytes of Flash memory,
up to 128 Kbytes of SRAM), a flexible external memory controller (FSMC) for static memories (for devices
with packages of 100 pins and more), a Quad-SPI Flash memory interface (available on all packages) and an
extensive range of enhanced I/Os and peripherals connected to two APB buses, two AHB buses and a 32-bit
multi-AHB bus matrix.
The STM32L476xx microcontroller devices embed several protection mechanisms for embedded Flash memory
and SRAM: readout protection, write protection, proprietary code readout protection and firewall.
These devices offer up to three fast 12-bit ADCs (5 Msps), two comparators, two operational amplifiers, two
DAC channels, an internal voltage reference buffer, a low-power RTC, two general-purpose 32-bit timers, two
16-bit PWM timers dedicated to motor control, seven general-purpose 16-bit timers, and two 16-bit low-power
timers. The STM32L476xx microcontroller devices support four digital filters for external sigma delta modulators
(DFSDM).
In addition, up to 24 capacitive sensing channels are available. The devices also embed an integrated LCD driver
8x40 or 4x44, with internal step-up converter.
They also feature standard and advanced communication interfaces:
• Three I²Cs
• Three SPIs
• Three USARTs, two UARTs and one Low-power UART.
• Two SAIs (serial audio interfaces)
• One SDMMC
• One CAN
• One USB OTG full-speed
• One SWPMI (single wire protocol master interface)
For full details of the STM32L476xx microcontroller device specifications, refer to www.st.com.
UM2949
Overview
UM2949 - Rev 1 page 4/60

3.3 ST25DV64KC-DISCO boards
The ST25DV64KC-DISCO is an evaluation kit, which allows the user to evaluate the performance of the ST25DV-
I2C tag dynamic tag. The kit is composed of two boards, namely a motherboard (see Figure 2) and the ST25DV-
I2C tag daughter board (see Figure 3).
3.3.1 ST25DV64KC-DISCO motherboard
The ST25DV64KC-DISCO (illustrated in Figure 2) is powered through the USB bus (micro and mini connectors)
and no external power supply is required.
This motherboard embeds the STM32L476VG microcontroller and different peripherals:
• LCD display and touchscreen to interface with the user
• USB connectors to connect to a PC (mini-USB for the ST-Link debugger and micro-USB available for the
user application)
• Optional modules: Wi‑Fi® and BLE to connect with a smart phone
The connectors on the right side of the board are dedicated to the daughter boards that embed the NFC tags.
Figure 2. ST25DV64KC-DISCO motherboard MB1396
UM2949
ST25DV64KC-DISCO boards
UM2949 - Rev 1 page 5/60

3.3.2 ST25DV-I2C tag daughter board
The ST25DVKC Discovery ANT C3 board (illustrated in Figure 3) embeds the ST25DV64KC device and a 40 mm
x 23 mm, 13.56 MHz double layer inductive etched antenna (no need for any tuning components).
The ST25DV64KC communicates with the STM32L476VG 32-bit MCU via the I²C bus.
Figure 3. ST25DVKC Discovery ANT C3 board
UM2949
ST25DV64KC-DISCO boards
UM2949 - Rev 1 page 6/60

4Firmware description
4.1 Prerequisite
The ST25DV-I2C tag is a dynamic tag, whose content and configuration is driven by both a microcontroller
(through I²C) and a reader through RF.
To benefit from the ST25DV64KC-DISCO demonstration kit, the user must have one of the following:
• A smart phone with the NFC enabled, combined with the ST25 NFC App installed on it. Refer to ST25
Android™ NFC tap application (UM2131), available on www.st.com for more information.
• An NFC reader, such as the CR95HF distributed with the M24LR discovery kit (M24LR-DISCOVERY). To
take full advantage of the ST25DV-I2C tag features, use CR95HF transceiver board firmware version 3.7.0
or higher, combined with the ST25PC-NFC software. Refer to Software toolbox for NFC tags user manual
(UM2444), available on www.st.com.
The ST25DV-I2C tag is fully compliant with the NFC Forum Type 5 standard. As this standard is recently
introduced, some features may not be fully supported by older smart phones.
4.2 Main menu
The main menu (Figure 4) is composed of three icons, used to access sub-menus.
Figure 4. ST25DV64KC-DISCO main menu display
Each item allows the user to enter a sub-menu containing a set of use cases as outlined. The sub-menus are
summarized in Table 2:
Table 2. Main menu item definition
Discover ST25DV-I2C tag Fast transfer mode demonstration NFC NDEF demonstrations
Note: If the Wi
‑
Fi® and/or the Bluetooth® Low Energy modules have been added to the board, the corresponding icons
are available to access the Wi
‑
Fi® and Bluetooth® pairing demonstrations.
UM2949
Firmware description
UM2949 - Rev 1 page 7/60

To select a category, touch the icon on the screen. To start a demonstration, touch the desired demonstration
icon on the screen (see description below). A long touch on an icon displays the description of the corresponding
demonstration(s) in the top line.
As the purpose of this document is to illustrate the firmware behavior, the descriptions are detailed from the
microcontroller point of view.
4.2.1 Discover ST25DV-I2C tag menu
As shown in Figure 5, the "Discover ST25DV-I2C tag" menu proposes several demonstrations of the ST25DV-I2C
tag specific features, among them:
• GPO interrupts in Section 4.2.2
• Energy harvesting in Section 4.2.3
• ST25DV-I2C tag states in Section 4.2.4
• Multi-areas and passwords in Section 4.2.5
Figure 5. ST25DV64KC-DISCO features main display
UM2949
Main menu
UM2949 - Rev 1 page 8/60

4.2.2 RF GPO interrupt demonstration
The ST25DV-I2C tag has a GPO that is used to send interrupts to the microcontroller.
Several kinds of event on the RF side may be configured to trigger the GPO interrupt. In this demonstration
all possible interrupt sources are enabled, except for the "RF activity", which occurs too often for reasonable
readability when using a smart phone as a reader.
To start the demonstration, select the "GPO control demo" menu, this displays the instructions until it detects a
GPO interrupt.
As soon as the first GPO interrupt is received, the LCD displays the list of sources of received interrupt, and the
number of each interrupt occurrences (see Figure 6).
Figure 6. ST25DV64KC-DISCO interrupt generation display
The event types and the way to generate them are listed below:
• Field on: place a reader near the ST25DV-I2C tag
• Field off: move a reader away from the ST25DV-I2C tag
• EEPROM written: modify the content of the ST25DV-I2C tag
• RF interrupt: requires the use of a specific reader instruction, that is sent either by a smart phone running
the ST25 NFC app, or by a reader (see the instructions in Smart phone GPO management and Generating
the RF and RF user interrupts using the ST25PC-NFC software with the CR95HF sections, respectively, for
Android™ ST25 NFC application and for the CR95HF reader used with the ST25PC-NFC software)
• RF user: requires the use of a specific reader command, that is sent either by a smart phone running the
ST25 NFC app or by a reader (see the instructions in Smart phone GPO management and Generating the
RF and RF user interrupts using the ST25PC-NFC software with the CR95HF sections, respectively, for the
Android™ ST25 NFC application and for the CR95HF reader used with the ST25PC-NFC software)
To start the Android ST25 NFC application, read the ST25DV-I2C tag with a smart phone (after entering the GPO
demonstration), which automatically opens the required application (or propose the installation of the application).
The automatic application selection is done using an NDEF with an AAR.
Note: The mailbox events are also used to trigger the GPO interrupts. They are not mentioned here, as they would
require placing the ST25DV-I2C tag in the Mailbox mode.
Smart phone GPO management
The ST25 NFC application handles the RF interrupt and the RF user interrupt using register fields information
(see Figure 7). Do not forget to present the configuration password before any register change.
UM2949
Main menu
UM2949 - Rev 1 page 9/60

Figure 7. Smart phone GPO register configuration
The ST25 NFC application generates the RF interrupt and the RF user interrupt using features located in the
Tools fragment in association with the RF GPO interrupt demonstration.
Generating the RF and RF user interrupts using the ST25PC-NFC software with the CR95HF
These interrupts are generated by any RF reader or Android™ smart phone.
Using the CR95HF IC and ST25PC-NFC software, the user is able to send interrupts or drive the GPO (see
Figure 8 and Figure 9)
• Select the ST25DV-I2C tag product
• Select "ENERGY HARVESTING" and GPO tab
• Click on "Send Interrupt Generated by GPO" to send an interrupt on GPO line
• Click on GPO set or GPO reset to be able to drive the GPO line.
For additional information about CR95HF PC software refer to the CR95HF development software user manual
(UM1084), available on www.st.com.
UM2949
Main menu
UM2949 - Rev 1 page 10/60

Figure 8. ST25DV-I2C tag contextual menu
Figure 9. PC software ST25DV-I2C tag special commands interface
UM2949
Main menu
UM2949 - Rev 1 page 11/60

4.2.3 ST25DV-I2C tag energy harvesting demonstration
The ST25DV-I2C is able to harvest the energy provided by the RF to power other devices.
This demonstration displays the voltage, current and power provided by the ST25DV-I2C (see Figure 10).
Figure 10. ST25DV64KC-DISCO energy harvesting measurement display
A LED is also turned on to simulate the effect of the energy harvesting when the RF field is approaching or when
it leaves.
The energy harvesting pin is connected to a load with which is used to measure the current delivered by the tag.
This load is configurable (shown in Figure 10) from 540 Ω to 4320 Ω. The objective is to simulate the current
consumed by additional external circuitry.
UM2949
Main menu
UM2949 - Rev 1 page 12/60

4.2.4 ST25DV-I2C tag states demonstration
This menu illustrates the possibility to change the ST25DV-I2C tag state, for example the power save
demonstration. This demonstration proposes three different modes:
1. RF disabled mode: RF commands are interpreted but not executed. The ST25DV-I2C tag responds with the
error code 0x0F.
2. Sleep mode: all RF communications are disabled, the RF interface does not interpret the commands, but
minimizes consumption of RF interface.
3. Low-power down: the ST25DV-I2C tag is fully inactive from Host - I2C side, but the memory content is
accessible on the RF side.
For all above cases, the demonstration consists in writing an NDEF with the ST25 URL, and changing the
ST25DV-I2C tag state. A message is displayed that invites the user to try to read the content of the ST25DV-I2C
tag, and check that it is not possible.
The content of the ST25DV-I2C tag can be read again as soon as the demonstration screen is passed.
Note: For the Low-power mode, the ST25DXSPARE jumper must be present on the ST25DV64KC-DISCO board's
MCU pin, and a 12-pin package must be used for the ST25DV-I2C tag.
4.2.5 ST25DV-I2C tag multi area and password demonstration
The ST25DV-I2C tag defines up to four different areas in memory. Each area may have a custom security level,
requiring one of the three passwords to be provided in order to read and/or write the memory.
This demonstration sets two different areas:
1. "Area 1" contains an NDEF with a vCard. This area is readable by anyone, but can only be written after
presenting "password 1".
2. "Area 2" contains an NDEF with a different vCard. This area cannot be read without the "password 1", and
cannot be written even after the password presentation.
By default, all the passwords are set to 0000 0000 0000 0000. These values are only updated from the RF side.
To execute the demonstration, the user must first read the ST25DV-I2C tag without any specific application. The
phone displays the vCard stored in "Area 1".
Then the user opens the ST25 NFC application, and taps the tag again, the application detects two areas, and
displays the "Area "1 vCard.
The user may try to write a different NDEF to the "Area 1", and check that the write fails unless "password 1" is
presented.
If the user selects the "Area 2" NDEF, the application requests "password 1" before displaying the "Area 2" vCard.
The user may try to write a different NDEF in "Area 2", this does not work even after presenting "password 1".
This is expected, as the security level of "Area 2" prevents any write access to the memory.
Smart phone and multi areas
When the tag is configured in multi areas, the ST25 NFC application then handles the areas and presents areas
and content to the user. The user then chooses the desired area by selecting the corresponding menu in the
application drawer. This is illustrated in Figure 11.
In case special protection is needed, the application displays security status information. On click, a popup is
used to present the area password needed to access area content.
UM2949
Main menu
UM2949 - Rev 1 page 13/60

Figure 11. Smart phone and area display
ST25PC-NFC software and multi areas
The ST25PC-NFC software is used to create up to four areas on the ST25DV-I2C tag EEPROM:
1. From the Inventory side panel, right-click on the ST25DV-I2C tag tag (see Figure 8).
2. In the contextual menu, select the "Multi Area Editor" item.
3. Move the sliders for each area until the desired value is reached (see Figure 12 for an example of an
EEPROM cut into four equal areas of 2048 bytes segments).
4. The start address, size of the area and ENDA register values are updated in real time inside the bottom
table.
UM2949
Main menu
UM2949 - Rev 1 page 14/60

Figure 12. ST25DV-I2C tag multi area configuration interface of the ST25PC-NFC software
Access rights for each area of the tag are set from the "Area configuration" screen (see Figure 13):
1. From the table, select the area to protect (up to four areas).
2. In the "Area protection" column, set one of four options for read and write operations (only three are
available for "Area 1").
3. Additionally, the password number can be set for each area.
Figure 13. Area configuration interface of the ST25PC-NFC software
UM2949
Main menu
UM2949 - Rev 1 page 15/60

4.2.6 ST25DV-I2C tag compare EEPROM write
This menu shows the difference between writing to the 4-byte ST25DVxxK EEPROM page and to the 16-byte
ST25DVxxKC EEPROM page. When entering this menu the following screens show the difference by emulating
an ST25DVxxKC EEPROM page write and performing the actual write on the ST25DVxxKC EEPROM.
Figure 14. ST25DVxxK emulated EEPROM write screen
Figure 15. ST25DVxxK emulated EEPROM write results
UM2949
Main menu
UM2949 - Rev 1 page 16/60

Figure 16. ST25DVxxKC EEPROM write screen
Figure 17. ST25DVxxKC EEPROM write results
UM2949
Main menu
UM2949 - Rev 1 page 17/60

4.2.7 NFC NDEF demonstration menu
The NFC NDEF demonstrations menu (see Figure 18) proposes several demonstrations concerning NDEF
messages:
• URI NDEF message (URL and phone number)
• SMS NDEF message
• Email NDEF message
• vCard NDEF message
• Geo-location NDEF message
• Custom (MyApp) NDEF message
• Multi record NDEF message
•Bluetooth® Low Energy OOB NDEF message (requires an additional Bluetooth® Low Energy module)
•Wi‑Fi® OOB NDEF message (requires an additional Wi‑Fi® module).
Figure 18. ST25DV64KC-DISCO NFC NDEF demonstrations menu display
URI demonstration
This menu (see Figure 19) shows how to manage URI content in the ST25DV-I2C tag.
With the MCU, the user:
• Stores an NDEF message containing a URL or a phone number (it is then be read with an NFC reader or a
smart phone).
• Reads any URI that is stored in the ST25DV-I2C tag. The display shows the content of the URI.
UM2949
Main menu
UM2949 - Rev 1 page 18/60

Figure 19. ST25DV64KC-DISCO read URI display
Note: If the MCU reads the ST25DV-I2C tag memory, it does not contain a URI, an error message is displayed.
Smart phone and URI NDEF
Refer to Reading and writing NDEF on a smart phone with the Android ST25 application section.
SMS demonstration
This menu indicates how to manage SMS content in the ST25DV-I2C tag.
With the MCU, the user:
• Stores an NDEF message containing an SMS (it is then be read with an NFC reader or with a smart phone)
• Reads any SMS that is stored in the ST25DV-I2C tag memory (the SMS is displayed on the screen).
Figure 20. ST25DV64KC-DISCO read SMS content display
Note: If the MCU reads the ST25DV-I2C tag memory, it does not contain an SMS, an error message is displayed.
Smart phone and SMS NDEF
Refer to Reading and writing NDEF on a smart phone with the Android ST25 application section.
Email demonstration
The menu illustrated in Figure 21 indicates how to manage e-mail content in the ST25DV-I2C tag.
With the MCU, the user:
• Stores an NDEF message containing an e-mail (it is then be read with an NFC reader or with a smart
phone).
• Reads any e-mail that is stored in the ST25DV-I2C tag memory. The content of the e-mail is displayed on
the screen.
UM2949
Main menu
UM2949 - Rev 1 page 19/60

Figure 21. ST25DV64KC-DISCO read Email content display
Note: If the MCU reads the ST25DV-I2C tag memory, it does not contain an e-mail, an error message is displayed.
Smart phone and e-mail NDEF
Refer to Reading and writing NDEF on a smart phone with the Android ST25 application section.
vCard demonstration
The menu illustrated in Figure 22 indicates how to manage vCard content in the ST25DV-I2C tag.
With the MCU, the user:
• Stores an NDEF message containing a vCard. Depending on the size of the ST25DV-I2C tag, this vCard
may or may not embed a picture
• Reads the ST25DV-I2C tag content.
If the vCard was previously stored, the following information is displayed on the board screen: name, title,
organization, cell phone number, work address and work e-mail.
Note: The vCard with an embedded picture needs around 3 Kbytes of memory and cannot be stored in the ST25DV-
I2C tag devices with smaller memory sizes, the ST25DV64 (with 64 kbits) must be used.
If the MCU reads the ST25DV-I2C tag memory, it does not contain a vCard, an error message is displayed.
Only vCard 2.1 is implemented in this firmware version. If the user stores a vCard 3.0 in the ST25DV-I2C tag,
the firmware issues an error message.
UM2949
Main menu
UM2949 - Rev 1 page 20/60
Table of contents
Other ST Computer Hardware manuals

ST
ST STM32H573I-DK User manual

ST
ST X-NUCLEO-OUT16A1 User manual

ST
ST X-NUCLEO-53L5A1 User manual

ST
ST EVAL6470H-DISC User manual

ST
ST STM32F4 Series User manual

ST
ST STR91 Series Installation and operating instructions

ST
ST ST92163 User manual

ST
ST X-NUCLEO-GFX01M1 User manual

ST
ST UPSD3212A User manual

ST
ST X-NUCLEO-DRP1M1 User manual