HOW TO INTEGRATE NFC CONTROLLERS IN LINUX

Similar documents
HOW TO INTEGRATE NFC FRONTENDS IN LINUX

NFC PAIRING FOR AUDIO DEVICES

PN7462 family Product support package

DEVICE-TO-DEVICE COMMUNICATION VIA NFC

NFC in Linux How to get started with the PN7120S controller board. Public MobileKnowledge July 2015

NFC USE CASES FOR INDUSTRIAL APPLICATIONS. December 2016

PARAMETRIZATION VIA NFC

NFC ESSENTIALS JORDI JOFRE NFC EVERYWHERE MARCH 2018 PUBLIC

PN7462 family - first all-in-one full NFC solution

LEARN ALL ABOUT NFC SESSION 4: PRODUCT SUPPORT PACKAGE FOR NFC READERS & NFC CONNECTED TAGS

IoT solution made easy with NFC

LEARN ALL ABOUT NFC SESSION 3: NFC PRODUCT PORTFOLIO

Linux NFC Subsystem. Lauro Ramos Venancio Samuel Ortiz 2011, September 9th

NFC FOR CONSUMABLES AND ACCESSORIES

Specifications and Application Documents. Laurent Sourgen NFC Forum Board Member STMicroelectronics

POS TERMINALS AND NFC

Products and solutions for Secure Wearables

Smart home NFC commissioning solution

NFC Technology Overview Jonathan Main MasterCard Worldwide Chairman, Technical Committee

NFC Forum Specifications to Build Solutions and Ensure the Global Interoperability of NFC. John Hillan Qualcomm (UK) Ltd. Chair, Technical Committee

Secure Elements 101. Sree Swaminathan Director Product Development, First Data

TI SimpleLink dual-band CC1350 wireless MCU

STMicroelectronics Payment Solutions. December 6 th 2012

NFC is the double click in the internet of the things

SPBTLE-1S ArTM. October STMicroelectronics

ACR1252U. NFC Forum Certified Reader. Technical Specifications V1.03. Subject to change without prior notice.

Security in NFC Readers

Industry-leading, 2 nd - generation NFC controller

BLE121LR Bluetooth Smart Long Range Module 5/12/2014 1

NFC NUTSHELL KIT. MCU Modules USER MANUAL REVISION GMMC GmbH Keywords Abstract. Document information

ACR1251U-A1 USB NFC Reader with SAM Slot

ACR1256U. User Manual V Document Name: ACR1256U- User Manual.doc. Prepared by: Reviewed by: Approved by:

NFC in the PC environment

The NFC Forum NFC Technology for Developers

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

STMicroelectronics NATIXIS Payment Solutions Conference

Microcontrollers. Claude Dardanne Executive Vice President, General Manager, Microcontrollers, Memory & Secure MCU Group.

Bluegiga Bluetooth Smart Software v.1.3 5/28/2014 1

Prepaid Energy System

Fundamentals of Near Field Communication (NFC) Tvrtko Barbarić NXP Semiconductors

Bidirectional wireless communication between IBM Cloud and Bluetooth Low Energy peripherals through SimpleLink Wi-Fi

Extensive proximity connectivity capabilities for USB-enabled devices

Smart Card ICs. Dr. Kaushik Saha. STMicroelectronics. CSME 2002 (Chandigarh, India) STMicroelectronics

Bluetooth Smart Development with Blue Gecko Modules. Mikko Savolainen October 2015

The challenge with IoT

Quick Start Guide (V1.0 May2015) Dynamic NFC tag expansion board based on M24SR for STM32 NUCLEO (X-NUCLEO-NFC01A1)

Intel Research mote. Ralph Kling Intel Corporation Research Santa Clara, CA

Contents. Preface. Acknowledgments. xxiii. List of Acronyms i xxv

ACM1252U-Y3. USB NFC Reader Module with Detachable Antenna Board

Embedded Linux With Raspberry Pi IOT

Bluetooth modules. Modules and turnkey solutions with embedded Bluetooth firmware and AT command

Product Specification

Leveraging the full potential of NFC to reinvent physical access control. Friday seminar,

NTAG I 2 C plus your entryway to NFC

CONNECTING SERVICES IN IOT DESIGN

FOR IOT PRODUCT DEVELOPMENT

BT121 Bluetooth Smart Ready Module. July 2016

Mobile Contactless Technology Backgrounder

UM PN7120 User Manual. User manual COMPANY PUBLIC. Rev January Document information

eh880 Secure Smart Card Terminal

Beyond TrustZone Security Enclaves Reed Hinkel Senior Manager Embedded Security Market Develop

ACR1255U-J1 Secure Bluetooth NFC Reader

BLE MODULE SPECIFICATIONS

BT121 Bluetooth Smart Ready Module. May 2015

ISMART Inventek Systems Module Arduino Test. Product Brief

NFC embedded microsd smart Card - Mobile ticketing opportunities in Transit

Enabling IoT OSs for Intel Quark MCU Platforms: the fast way. OpenIoT Summit Europe Andre Guedes

MR7622 Series USB HID Keyboard Simulator IC Card Reader

THE LPC84X MCU FAMILY A MULTI-TESTER TOOL OFFERING FEATURES FOR YOUR NEXT IOT DESIGN

Overview RFID-Systems

Smart Card meets Connectivity New Opportunities in Mobile Business with NFC Technology. Smart Card Alliance2005 Fall Annual Conference Martin Bührlen

Device to Cloud. Software Hardware Know How

BLED112 Bluetooth Smart USB Dongle 9/16/2013 1

Adafruit Feather nrf52840 Express

ACR122S NFC Reader. Datenblatt / Specifications. Technical Specifications

Quick Start Guide. Bluetooth Low Energy expansion board based on SPBTLE-RF module for STM32 Nucleo (X-NUCLEO-IDB05A1) Version 1.

Wireless-Tag WT51822-S1

ACR1255 NFC Bluetooth Smart Card Reader

Quick Start Guide. STM32 ODE Function Pack for connecting 6LoWPAN IoT Nodes to smartphone through a BLE interface (FP-NET-6LPBLE1)

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

Simplifying Multiprotocol Industrial Ethernet Communication. Sandeep Kumar December 2016

Advanced Embedded Systems

The IoT and Thread in PHYTEC Nodes. Jonas Remmert July 15th, 2016

HEXIWEAR COMPLETE IOT DEVELOPMENT SOLUTION

mbed OS Update Sam Grove Technical Lead, mbed OS June 2017 ARM 2017

Lesson 5 Arduino Prototype Development Platforms. Chapter-8 L05: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Join the forward thinkers who rely on Toshiba for wireless connectivity ICs.

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

ACR128U Dual- Interface Reader

ASK GENXXX Development kit

DESIGN AND DEPLOY INTELLIGENT, LOW-POWER AND LOW-COST WIRELESS NETWORKS

Renesas Synergy MCUs Build a Foundation for Groundbreaking Integrated Embedded Platform Development

Software Driven Verification at SoC Level. Perspec System Verifier Overview

ARM mbed Enabled. Mihail Stoyanov Partner Enablement Team Lead, ARM mbed. Xiao Sun Partner Enablement Engineer, ARM mbed

ARM mbed Reference Designs

New STM32WB Series MCU with Built-in BLE 5 and IEEE

MR7631 Series USB HID Keyboard Simulator IC Card Reader

ARROW ARIS EDGE Board User s Guide 27/09/2017

Software Design Challenges for heterogenic SOC's

Putting NFC Forum Specifications to Work

Transcription:

HOW TO INTEGRATE NFC CONTROLLERS IN LINUX JORDI JOFRE NFC READERS NFC EVERYWHERE 28/09/2017 WEBINAR SERIES: NFC SOFTWARE INTEGRATION PUBLIC

Agenda NFC software integration webinar series Session I, 14th September How to integrate NFC frontends in Linux. Session II, 28th September How to integrate NFC controllers in Linux. Session III, 11th October How to port the NFC Reader Library to K64F. 1

Agenda NFC software integration webinar series Session III, 11th October How to integrate NFC controllers in Linux. Recap about last session PN7150 NFC controller family PN7150 NFC controller concept NFC software libraries available for Linux Integration in Linux using the Linux libnfc-nci SW stack PN7462 NFC controller family PN7462 NFC controller concept PN7462 NFC integration in Linux 2 Wrap up and Q&A

3 Recap about last session

NFC frontends software integration in Linux NFC Frontends expose a register interface towards the host controller through the host interface The NFC Reader Library can be installed on a generic GNU/Linux platform. High latency: Access the host interface (I 2 C, SPI, UART drivers) in Linux Kernel space is slow. High CPU load: There is a lot of code involved just to write one register in Linux context switching. Solutions Increase CPU/SPI clock as much as the MCU can process. Reduce SPI / host interface interactions as much as possible: Linux driver is optimized for few long transactions rather than lots of short ones Move NFC Reader Library BAL module to Kernel space. 4

PN7150 NFC controller family concept 5

Host interface RF interface PN7150 NFC controller family host and contactless interfaces Host interface RF interface PN7150 is connected to the host device through an I 2 C physical interface. Full NFC Forum compliancy with small form factor antenna. PN7150 logical interface (API) is based on the NCI NFC Forum standard. It supports additional, NXP proprietary extensions specific to the PN7150 chip. In few NCI commands, host SW can configure the PN7150 to notify for card or peer detection and start data exchange. NFC controller with embedded firmware (PN7150) Ultra-low power consumption in polling loop mode allows without impacting the user experience. Embedded NFC firmware providing all NFC protocols as pre-integrated feature Load modulation schemes: Active & Passive PN7150 NFC controller family are integrated solutions combining an NFC frontend together with an MCU 6

Host interface RF interface Matching PN7150 NFC controller family are managed by NCI commands Host controller SW implementation is required for both entities, the NFC FW for the controller side, and the NCI driver from the device host. NCI defines a standard communication channel between the NFC controller and the host device. It provides manufacturers with a standard interface they can use for whatever kind of NFC-enabled device they build. PN7150 NFC controller embeds an ARM Cortex-M0 microcontroller core loaded with integrated firmware supporting the NCI 1.0 host communication. Host controller NFC application NCI driver Linux OS NCI commands NFC controller with integrated firmware ARM Cortex-M0 core RF communication TODAY: NFC application runs on Linux OS system There is NCI driver support for Linux, Android, Windows IoT, RTOS and bare metal systems. 7

PN7150 NFC controller family architecture NFC controller with integrated FW Implements NCI 1.0 compliant protocol. Runs the NFC stack and RF protocols. Key benefits 32-bit Cortex-M0 power-efficient 20MHz ARM Cortex-M0 ROM with NFC firmware Critical timing constraints on host are handled by the embedded FW. Host interactions are reduced since some functionalities are handled autonomously by the embedded FW. 8

PN7150 NFC software integration in Linux NFC software libraries available for Linux 9

NFC software libraries available for Linux MUSCLE PC/SC Lite MUSCLE is a project to develop a set of compliant drivers, API's, and a resource manager for various smart cards and readers for the GNU environment. Middleware to access a smart card using the SCard API. Open source implementation of PC/SC (Microsoft OS). Library focused on smartcard integration into computing environment rather than an NFC SW stack Not reusable for PN7150, NCI support is not included Not all NFC functionalities implemented (e.g. Card emulation limited to Type 3 tags) Implements NFC Forum specifications for data exchange with NFC devices and tags. Python module for NFC. USB and UART devices support. EUPL licensed project and available at GitHub. nfcpy 10

NFC software libraries available for Linux (II) Libnfc (From NFC Tools) Academic LGPL licensed project. Written in C. USB and UART devices support. Open source and community supported. Support for various operating systems ( Linux, Mac OS, Windows). No ROM memory access on Linux. Not reusable for PN7150 since NCI support is not included NXP originally contributed to this SW stack. Support has stopped for their NCI-based NFC controllers. Maintained by Intel open source community. Aims to be HW independent (NXP, TI, Inside Secure, etc). Supports HCI, NCI and USB hardware. GPLv2 licensed. Split between kernel and user spaces. Linux NFC 11

NFC software libraries available for Linux (III) Linux Libnfc-nci NDEF tag support MIFARE Classic tag support P2P, LLCP, SNEP WiFi & BT handover Raw tag command support Proprietary NCI command support Host Card Emulation support Optimized in terms of interoperability with mobile devices Works together with the PN5xx I2C driver, which is compatible and offers communication with NXP NFC controllers through an I 2 C interface It is the native library providing NFC functionality for the extension added to support NXP proprietary features. Derived from the available and proven Android stack 12 Linux Libnfc-nci is the best choice for integrating PN7150 NFC controllers in Linux

PN7150 NFC software intregration in Linux Linux libnfc-nci stack 13

Linux libnfc-nci stack mapping in Linux architecture Host controller Kernel Space User Space Host interface Host interface App 1 App 2 App 3 NFC app Linux libnfc-nci details Linux OS stack GNU C Library System Libraries DRM Library Syscall Interface Syscall Dispatcher Linux libnfc-nci stack Linux libnfc-nci stack consists of a library running in User space and implement NFC features (NCI, NDEF, LLCP and SNEP protocols, Tag Operations, Host Card Emulation ) Low level access to PN7150 HW HW platform Process scheduler Memory manager Generic Kernel Virtual File System Network Stack PN5xx_I2c kernel mode driver can be used to communicate with the PN7150 NFC controller Hardware Dependent Kernel USB driver Display Driver I2C driver PN5xx_I2C driver PN7150 NFC Controller NCI commands 14 PN7150 FW autonomously handles part of the NFC activity so it requires much less interaction on the I 2 C interface than NFC frontends, reducing context switching.

Linux libnfc-nci stack architecture in detail Libnfc-nci library Interface Layer: exposes the library API to the user application. Libnfc-nci Core: implements the NFC functionality (NCI, NDEF, LLCP and SNEP protocols, tag operations, Host Card Emulation ) Hardware Abstraction Layer: provides connection to the kernel driver as well as basic functionalities such as self-test or firmware update. Linux Libnfc-nci repository permanently updated and maintained by NXP $ git clone https://github.com/nxpnfclinux/linux_libnfc-nci.git *For alternatives to PN5xx_I2C kernel driver, check AN11769 15

Integrating the Linux-libnfc-nci stack into a Linux system 16

Host interface Host interface Kernel Space User Space Integrating the Linux libnfc-nci stack into a Linux system App 1 App 2 App 3 NFC app Host controller GNU C Library System Libraries DRM Library Linux libnfc-nci stack Step 2: Install the Linux libnfc-nci in user mode. Linux OS stack HW platform Process scheduler Memory manager Syscall Interface Syscall Dispatcher Generic Kernel Virtual File System Network Stack Step 1: Install the PN51xx I 2 C driver as part of the kernel. Hardware Dependent Kernel USB driver Display Driver I2C driver PN5xx_I2C driver PN7150 NFC Controller 17 Integration steps are described in the AN11769 PN71xx Linux Software Stack Integration Guidelines in detail.

Step 1: Installing PN5xx I2C driver Steps to install the PN5xx I2C driver: 1. Download the driver source code $ git clone https://github.com/nxpnfclinux/linux_libnfc-nci.git 2. Include the driver to the kernel Obj-y +=nxp-pn5xx/ Source drivers/misc/nxp-pn5xx/kconfig 3. Create the device node &i2c{ status = "okay"; pn547: pn547@28 { compatible = "nxp,pn547"; reg = <0x28>; clock-frequency = <400000>; interrupt-gpios = <&gpio2 17 0>; enable-gpios = <&gpio4 21 0>; }; }; 4. Build the driver 5. Change access to device node Live demo with RaspberryPi: http://youtu.be/tcgcri-tkxm ACTION== add, KERNEL== pn544, MODE= 066 18

Step 2: Installing the Linux libnfc-nci Steps to install the Linux libnfc-nci: 1. Download the driver source code $ git clone https://github.com/nxpnfclinux/linux_libnfc-nci.git 2. Build the library $./bootstrap $./configure <OPTIONS> $ make 3. Install the library $ make install 4. Using the application $./nfcdemoapp <OPTIONS> 19 Live demo with RaspberryPi: http://youtu.be/tcgcri-tkxm

PN7462 NFC controllers family concept 20

Host interface RF interface PN7462 NFC controller family host and contactless interfaces Host interface PN7462 can be connected to the host device through I2C, SPI, USB or HSUART Contact interface GPIOs & peripherals RF interface High RF output power frontend IC for transfer speed up to 848 Kbps The customizable FW gives developers the widest range of options for functionality and enables a high degree of design flexibility. PN7462 host interface can be used to interact with a high level API-like offered by the FW logic programmed into PN7462 internal MCU. NFC controller with customizable firmware (PN746x_PN736x) Compliance with EMV and NFC Forum standards. Low power card detection mode. Dynamic Power Control (DPC) support. Load modulation schemes: Active & Passive. 21 PN7462 NFC controller family are integrated solutions combining an NFC frontend together with an MCU with customizable firmware

Host interface RF interface Matching PN7462 NFC controller family are managed by an API-like interface Host controller PN7462 can be run stand-alone user application or be connected to a high-end platform running an operative system like Linux. PN7462 custom FW can be designed to provide a higher level protocol or API instead of exposing a register interface over host interface (e.g. NFC frontends). This solution offers an (almost) latency independent interface between host SW stack and the RF frontend. PN7462 embeds an ARM Cortex-M0 with up to 160kB of flash memory and can be configured to run fully-custom applications Host controller Host application Linux OS HW platform API user-defined commands NFC controller with customizable firmware User custom application ARM Cortex-M0 core RF communication PN7462 firmware can de developed leveraging on the NFC Reader Library. 22

PN7462 NFC controller family NFC software integration in Linux 23

Host interface Host interface Kernel Space User Space PN7462 architecture for Linux integration App 1 App 2 App 3 Host app Host app Host controller GNU C Library System Libraries DRM Library. Other tools The host application interacts with the FW defined in PN7462. Linux OS stack HW platform Process scheduler Memory manager Syscall Interface Syscall Dispatcher Generic Kernel Virtual File System Network Stack User-defined application interface If properly designed, the whole system requires little context switching, reducing transaction latency Hardware Dependent Kernel UART USB driver I2C driver SPI driver PN7462 NFC Controller User- defined application interface 24 e.g. For a payment application, PN7462 can implement the EMVCo L1 while the host app can implement the EMVCo L2 payment applications

NFC Reader Library Simplified API An example for developing your application interface-like development Simplified API Provides a high level abstraction access to the NFC Reader Library. Two different available profiles: EMVCo channel: used to transfer ISO 7816 APDU s over the ISO 14443-4 protocol, according to EMVCo L1 spec. ISO channel: general channel, used to transfer raw data on block/frame level. Simplified API functions phnfclib_init(); phnfclib_setconfig_value (); phnfclib_activate(); phnfclib_transmit (); phnfclib_receive (); phnfclib_deactivate(); phnfclib_deinit(); 25

26 Wrap up & Q&A

PN71xx vs PN7462 NFC controllers with integrated FW NFC controllers with customizable FW NFC controller with integrated firmware PN71xx NFC controller with application PN7462 Key benefits Key benefits Full NFC Forum-compliant contactless interface Microcontroller core with integrated firmware. Host interface: I 2 C interface over NCI protocol. Contactless interface with full NFC functionality. Microcontroller core with fully customizable firmware. One configurable host interface: I 2 C, SPI, USB, HSUART. Contact card reader (PN7462). Two master interfaces: I 2 C and SPI and up to 21 GPIOs 27

PN7150 and PN7462 considerations for Linux integration NFC controllers with integrated FW NFC controller with integrated FW PN71xx family PN7150 logical interface (API) is based on the NCI NFC Forum standard over an I 2 C physical interface There are few libraries out there, but the Linux libnfcnci is NXP NFC stack for Linux systems and the most complete. Host interactions are reduced since some functionalities are handled autonomously by the FW. NFC controllers with customizable FW NFC controller with custom application PN7462 family PN7462 internal flash memory can be used to program a fully custom FW that exposes a high level protocol or API towards the host system. PN7462 firmware can de developed leveraging on the NFC Reader Library. It offers an (almost) latency independent interface between host software stack and the RF frontend. 28

Reference links & info PN71xx family www.nxp.com/products/: PN7150B0HN PN746x_PN736x family www.nxp.com/products/:pn7462auhn NXPNFCLinux GitHub repository https://github.com/nxpnfclinux/ NFC Reader Library www.nxp.com/pages/:nfc-reader-library 29

Software development in Android and ios Embedded software for MCUs JCOP, Java Card operating Systems Hardware design and development Digital, analog, sensor acquisition, power management Wireless communications WiFi, ZigBee, Bluetooth, BLE Contactless antenna RF design, evaluation and testing MIFARE applications End-to-end systems, readers and card-related designs EMVco applications Readers, cards, design for test compliancy (including PCI) Secure Element management GlobalPlatform compliant backend solutions Secure services provisioning OTA, TSM services We help companies leverage the mobile and contactless revolution MobileKnowledge Roc Boronat 117, P3M3 08018 Barcelona (Spain) Get in touch with us www.themobileknowledge.com mk@themobileknowledge.com 30