UM2375 User manual. Linux driver for the ST25R3911B/ST25R391x high performance NFC frontends. Introduction

Similar documents
UM2495. High performance HF reader / NFC initiator IC software expansion for NUCLEO-8S208RB. User manual. Introduction

Getting started with the X-CUBE-NFC5 high performance HF reader / NFC initiator IC software expansion for STM32Cube

UM2045 User manual. Getting started with the X-CUBE-NFC3 near field communication transceiver software expansion for STM32Cube.

Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

STSW-STWBCFWDT. STWBC firmware downloader tool. Description. Features

Getting started with the digital MEMS microphone expansion board based on MP34DT01-M for STM32 Nucleo

AN4624 Application note

How to upgrade the firmware on the STEVAL-USBC2DP USB Type-C to DisplayPort adapter

STSW-BLUENRG1-DK. BlueNRG-1, BlueNRG-2 DK SW package

DT0095 Design tip. Datalogging the SensorTile through a PC. Purpose and benefits. Description

STSW-BNRG-Mesh. Mesh over Bluetooth low energy. Features. Description. Applications

RN0084 Release note. ST-LINK/V2 firmware upgrade. About this release note

STSW-BNRGUI. BlueNRG GUI SW package. Data brief. Features. Description

P-NUCLEO-6180X2. Proximity, gesture, ambient light sensor expansion board based on VL6180X for STM32L053R8. Description. Features

Getting started with the FP-NET-6LPBLE1 function pack for 6LoWPAN IoT node connection to a smartphone via BLE interface

P-NUCLEO-53L0A1. VL53L0X Nucleo pack with ranging, gesture detection sensor expansion board and STM32F401RE. Description. Features

P-NUCLEO-53L1A1. VL53L1X nucleo pack with X-NUCLEO-53L1A1 expansion board and STM32F401RE nucleo board. Description. Features

X-NUCLEO-53L0A1. Ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo. Description. Features

Bluetooth low energy profiles for the X-CUBE-BLE1 expansion for STM32Cube. Description

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery. Features. Description

UM2167 User manual. OrCAD PSpice model usage instructions

ST25DV-DISCOVERY. Discovery kit for the ST25DV04K dynamic NFC/RFID tag. Features

Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

AN4782 Application note

P-NUCLEO-IKA02A1. STM32 Nucleo pack: electrochemical toxic gas sensor expansion board with CO sensor. Description. Features

X-NUCLEO-53L1A1. Long distance ranging Time-of-Flight sensor expansion board based on VL53L1X for STM32 Nucleo. Description.

Using the GPIOs and interrupt controller to drive LEDs on STM8 Nucleo-64 boards

NUCLEO-L433RC-P NUCLEO-L452RE-P

Getting started with the FP-SNS-ALLMEMS1 Bluetooth low energy and sensors software expansion for STM32Cube

Description. January 2019 DB2381 Rev 3 1/5

NUCLEO-L496ZG. STM32 Nucleo-144 board. Features. Description

UM2361. Getting started with the ST BlueNRG-Mesh ios application. User manual. Introduction

UM2255 User manual. SPC58NG-DISP user manual. Introduction

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery Data brief. Features. Description

Getting started with X-NUCLEO-53L1A1 long distance ranging ToF sensor expansion board based on VL53L1X for STM32 Nucleo

X-NUCLEO-NFC04A1. Dynamic NFC/RFID tag IC expansion board based on ST25DV04K for STM32 Nucleo. Description. Features

Description. July 2016 DocID Rev 2 1/6

Getting started with STEVAL-IDB007V1 and STEVAL-IDB008V1 evaluation boards

Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery with the Nucleo-F072RB board and the STUSB1602

X-NUCLEO-53L0A1 ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo

EVALKITSTKNX. Miniature transceiver STKNX evaluation and development kit. Features

TN1235 Technical note

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on STUSB1602. Description

L9958 Evaluation board for high current (8.6A) DC and Stepper Motors. Description

Dynamic Electro-Thermal simulator for VIPower products. Description

UM2051 User manual. Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery. Introduction

Getting started with MotionPM real-time pedometer library in X CUBE-MEMS1 expansion for STM32Cube

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

Getting started with the FP-IND-PLCWIFI1 function pack for PLC management via Wi-Fi

32F412GDISCOVERY. Discovery kit with STM32F412ZG MCU. Features. Description

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on the STUSB1602

AN4491 Application note

Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo. Description

EVALKIT-VL6180X. VL6180X plug-in and STM32 F401RE Nucleo board explorer kit. Description. Features

Getting started with MotionPM real-time pedometer library in X-CUBE-MEMS1 expansion for STM32Cube

UM2350. Getting started with MotionPW real-time pedometer for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with osxmotiongc gyroscope calibration library for X-CUBE-MEMS1 expansion for STM32Cube

UM1853 User manual. STM32CubeF1 Nucleo demonstration firmware. Introduction

EVAL6494L. Demonstration board for L6494L gate driver. Description. Features

UM1844 User manual. EVAL-L9958 Graphical user interface (GUI) Introduction

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

STSW-L9960, STSW-L9960T Graphical User Interface (GUI) for EVAL-L9960 & EVAL-L9960T

AN2667 Application note

Getting started with the X-CUBE-53L1A1 Time-of-Flight long distance ranging sensor software expansion for STM32Cube

Running a simple 6LowPAN network consisting of one receiver node and one or more sensor nodes in a Sub-1GHz RF band

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

UM2216 User manual. Getting started with MotionFA fitness activity library in X CUBE MEMS1 expansion for STM32Cube. Introduction

Getting started with X-NUCLEO-NFC03A1 NFC card reader board based on CR95HF IC for STM32 Nucleo

UM2084 User manual. Getting started with the ultra-low-power STM32 and LoRa Nucleo pack. Introduction

How to configure the BlueNRG-1 and BlueNRG-2 devices in network coprocessor mode. Main components Bluetooth Low Energy wireless system-on-chip

UM2343 Application note

UM2194. Getting started with MotionAW activity recognition for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

Getting started with the ultra-low-power STM32 and LoRa Nucleo pack

AN4045 Application note

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

Getting started with the P-NUCLEO-IKA02A1 STM32 Nucleo pack for electrochemical toxic gas sensor expansion board with CO sensor

A scalable approach to your body, networking and security platforms. Description

Software GUI user guide for STEVAL-ISV021V1, STEVAL- IDS002V1 and STEVAL-IDS003V1 evaluation boards

300 ma triple DC-DC converter for powering AMOLED displays. Description. Table 1: Device summary Negative voltage. Auxiliary positive voltage

32L476GDISCOVERY. Discovery kit with STM32L476VG MCU. Features. Description

Motor control power board based on the SLLIMM-nano 2 nd series

Getting started with X-NUCLEO-LED16A1 16-channel LED driver expansion board for STM32 Nucleo

Getting started with the high power stepper motor driver expansion board based on powerstep01 for STM32 Nucleo

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

Getting started with the software package for STEVAL-STLKT01V1 based on STM32Cube

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

32F469IDISCOVERY. Discovery kit with STM32F469NI MCU. Features. Description

UM2276. Getting started with MotionSD standing vs sitting desk detection library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2119 User manual. Graphical user interface (GUI) for EVAL-L9907-H. Introduction

AN5171 Application note

Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube

32F746GDISCOVERY. Discovery kit with STM32F746NG MCU. Features. Description

EVLKSTCOMET10-1. STCOMET smart meter system-on-chip development kit. Features

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

UM2091 User manual. EVAL-L9301 Demo board Hardware documentation. Introduction

Getting started with the X-NUCLEO-EEPRMA1 standard I²C and SPI EEPROM memory expansion board based on M24xx and M95xx series for STM32 Nucleo

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

Getting started with X-NUCLEO-IHM06A1 low voltage stepper motor driver expansion board based on STSPIN220 for STM32 Nucleo

STM32L4R9I-EVAL. Evaluation board with STM32L4R9AI MCU. Features

Transcription:

User manual Linux driver for the ST25R3911B/ST25R391x high performance NFC frontends Introduction The STSW-ST25R009 Linux driver enables the Raspberry Pi 3 to operate with the X-NUCLEO-NFC05A1. This package ports the RF abstraction layer (RFAL) onto a Raspberry Pi 3 Linux platform to operate with X-NUCLEO-NFC05A1 firmware, which contains the ST25R3911B high-performance NFC frontend. The package contains a sample application that detects different types of NFC tags and mobile phones supporting P2P. The RFAL is the ST standard driver for ST25R NFC/RFID Reader ICs ST25R3911B, ST25R3912, ST25R3913, ST25R3914 and ST25R3915. It is used, for instance, by the ST25R3911B-DISCO (STSW-ST25R002) and X-NUCLEO-NFC05A1 (X-CUBE-NFC5) firmware. STSW-ST25R009 supports all the ST25R3911B lower-layer protocols and also some higher layer protocols to abstract RF communication. As the RFAL is written in a portable manner, it can run on a wide range of devices, from 8-bit MCUs up to 64-bit processors running Linux. This document describes how the RFAL library can be used on a standard Linux system (in this case the Raspberry Pi 3) for NFC/RF communication. All the code here is highly portable and works with minor changes on any Linux platform. Figure 1. RFAL library on Linux platform March 2018 UM2375 Rev 1 1/14 www.st.com 1

Contents UM2375 Contents 1 Overview.................................................. 5 1.1 Features................................................... 5 1.2 Software architecture......................................... 5 2 Hardware setup............................................. 7 2.1 Platform used............................................... 7 2.2 Hardware requirements....................................... 7 2.2.1 Hardware connections....................................... 7 3 Linux environment setup..................................... 9 3.1 Booting of Raspberry Pi....................................... 9 3.2 Enable SPI on Raspberry Pi.................................... 9 4 Build of RFAL library and application.......................... 11 5 How to run the application................................... 12 6 Revision history........................................... 13 2/14 UM2375 Rev 1

List of figures List of figures Figure 1. RFAL library on Linux platform............................................... 1 Figure 2. RFAL software architecture on Linux.......................................... 6 Figure 3. Position of Jumpers A3, A2, A1 and A0 on adapter board.......................... 7 Figure 4. Hardware setup top view................................................... 8 Figure 5. Hardware setup side view................................................... 8 Figure 6. Displays of found devices.................................................. 12 UM2375 Rev 1 3/14 3

List of tables UM2375 List of tables Table 1. Document revision history................................................. 13 4/14 UM2375 Rev 1

Overview 1 Overview 1.1 Features Complete Linux user space driver (RF abstraction layer) to build NFC enabled applications using the ST25R3911B/ST25R391x high performance NFC frontends with up to 1.4 W output power Linux host communication with the ST25R3911B/ST25R391x high performance NFC frontends using SPI interface Complete RF/NFC abstraction (RFAL) for all major technologies and higher layer protocols: NFC-A (ISO14443-A) NFC-B (ISO14443-B) NFC-F (FeliCa) NFC-V (ISO15693) P2P (ISO18092) ISO-DEP (ISO data exchange protocol, ISO14443-4) NFC-DEP (NFC data exchange protocol, ISO18092) Proprietary technologies (Kovio, B, iclass, Calypso, ) Sample implementation available with the X-NUCLEO-NFC05A1 expansion board, plugged into a Raspberry PI 3 Sample application to detect several NFC tag types and mobile phones supporting P2P Free user-friendly license terms 1.2 Software architecture Figure 2 shows the software architecture details of RFAL library on a Linux platform. The RFAL is easily portable to other platforms by adapting the so-called platform files: The header file platform.h contains macro definitions, which are expected to be provided and implemented by the platform owner. It provides platform specific settings like GPIO assignment, system resources, locks and IRQs, which are required for correct operation of the RFAL. This demo implements the platform functions and provides a port of the RFAL into user space of Linux. A shared library file is generated, which is used by a test/demo application to showcase the functionalities provided by the RFAL layer. Linux host uses sysfs interface available from Linux user space for performing SPI communication with the ST25R3911B device. Inside the Linux kernel the SPI sysfs interface uses Linux kernel driver spidev to send/receive the SPI frames to ST25R3911B. For handling the INT line of ST25R3911B the driver uses the GPIO sysfs to get notified of changes on this line. UM2375 Rev 1 5/14 12

Overview UM2375 Figure 2. RFAL software architecture on Linux 6/14 UM2375 Rev 1

Hardware setup 2 Hardware setup 2.1 Platform used A Raspberry Pi 3 board with Raspbian OS (operating system) is used as Linux platform to build RFAL library and interact with ST25R3911B over SPI. ST25R3911B enables an application on Linux platform to detect and communicate with NFC devices. 2.2 Hardware requirements Raspberry Pi 3 Model B V1.2 X-NUCLEO-NFC05A1 8 GB micro SD card to boot Raspberry Pi Bridge board to connect X-NUCLEO NFC05A1 with Raspberry Pi Arduino Adapter for Raspberry Pi, Part No. ARPI600 SD card reader 2.2.1 Hardware connections The ARPI600 Raspberry Pi to Arduino adapter board is used to connect X-NUCLEO-NFC05A1 with the Raspberry Pi. It is required to modify the jumpers of adapter board to connect it with the X-NUCLEO-NFC05A1. Jumper setting The jumpers for A3, A2, A1 and A0 shown in Figure 3 have to be changed to P23, P22, P21 and CE1. With these jumper settings, Raspberry s GPIO pin number 7 is used as interrupt line for X-NUCLEO-NFC05A1. Figure 3. Position of Jumpers A3, A2, A1 and A0 on adapter board UM2375 Rev 1 7/14 12

Hardware setup UM2375 Currently, this RFAL library port uses the pin GPIO7 as the interrupt line (according to the jumper setting). If there is a requirement to change the interrupt line from GPIO7 to a different GPIO, the platform specific code (in file pltf_gpio.h) needs to be modified to change the definition of macro PLTF_GPIO_INTR_PIN from 7 to the new GPIO pin, which should to be used as interrupt line. With the above jumper settings, the adapter board can be used to connect X-NUCLEO NFC05A1 with Raspberry Pi board as shown in Figure 4. Figure 4. Hardware setup top view Figure 5. Hardware setup side view 8/14 UM2375 Rev 1

Linux environment setup 3 Linux environment setup 3.1 Booting of Raspberry Pi To setup the Linux environment, first step is to install and boot the Raspberry Pi 3 with Raspbian OS as explained below: Step1. Download the latest Raspbian image from the link: https://www.raspberrypi.org Choose RASPBIAN STRETCH WITH DESKTOP. For the tests below the following version was used: November 2017 (2017-11-29 with kernel 4.9). Step2. Unzip the raspbian image and write in onto the SD card by following the instructions available in the section named Writing an image to the SD card. Step3. Connect the hardware: Connect the Raspberry Pi 3 to a monitor using a standard HDMI cable. Connect mouse and keyboard to Raspberry Pi s USB ports. It is also possible to work with Raspberry Pi using ssh. In that case it is no required to connect the monitor, keyboard and mouse with Raspberry Pi. The only requirement is to have the PC with ssh inside the same network as the Raspberry Pi. Step4. Boot the Raspberry Pi 3 with SD card. After booting, a debian based Linux desktop appears on monitor. Note: Sometimes, it is observed that after booting Raspberry Pi with raspbian, some keyboard keys do not work. To make them work, open the file /etc/default/keyboard and set XKBLAYOUT= us and reboot the Raspberry Pi. 3.2 Enable SPI on Raspberry Pi The SPI driver inside the kernel communicates with X-NUCLEO-NFC05A1 over SPI. It is important to check if SPI is already enabled in the raspbian/kernel configuration. Check if /dev/spidev0.0 is visible in the raspberry Pi environment. If it is not visible, enable the SPI interface using the utility raspi-config by following the steps described below. Step1. Open a new terminal on the Raspberry Pi and run the command raspi-config as root: sudo raspi-config. This step opens a graphical interface. UM2375 Rev 1 9/14 12

Linux environment setup UM2375 Step2. Select in the graphical interface the option named Interfacing Options. Step3. This step lists various options. Select the option named SPI. A new window appears with following text: Would you like the SPI interface to be enabled? Step4. Select <Yes> in this window to enable SPI. Step5. Reboot Raspberry Pi. The above steps will enable the SPI interface in Raspberry Pi environment after a reboot. 10/14 UM2375 Rev 1

Build of RFAL library and application 4 Build of RFAL library and application The RFAL demo of Linux is provided in an archive. Let's assume its name is: rfal_v1.3.0_nfc_poller.tar.xz. To build the RFAL library and application on raspberry Pi, follow the below steps: Step1. Unzip the package rfal_v1.3.0_nfc_poller.tar.xz on raspberry Pi using the below command from the home directory: tar -xjvf rfal_v1.3.0_nfc_poller.tar.xz Step2. Install cmake (if not done before) using below command: apt-get install cmake RFAL library and application build system is based on cmake, for this reason it is required to install cmake for compilation of the package. Step3. To build the RFAL library and application, go to the build directory: cd ~/rfal_v1.3.0/build and run the below command from there: cmake.. In above command.. indicates that top level CMakeLists.txt exists in the parent directory (i.e. rfal_v1.3.0). cmake command creates the makefile that is used in the next step to build the library and application. Step4. Run the make command to build the RFAL library and application: make The make command first builds the RFAL library and then builds the application on top of it. UM2375 Rev 1 11/14 12

How to run the application UM2375 5 How to run the application Successful build will generate an executable named nfcpoller at the following location: /build/applications. By default the application needs to be run with root rights from the path: ~/rfal_v1.3.0//build/applications/: sudo./nfcpoller The application starts to poll for NFC tags and mobile phones. It will display the found devices with their UID as shown in Figure 6. Figure 6. Displays of found devices To terminate the application press Ctrl + c. 12/14 UM2375 Rev 1

Revision history 6 Revision history Table 1. Document revision history Date Revision Changes 09-Mar-2018 1 Initial release. UM2375 Rev 1 13/14 13

IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2018 STMicroelectronics All rights reserved 14/14 UM2375 Rev 1