AN11480 Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Rev. 1.0 — 17 December 2013 279710 Application note COMPANY PUBLIC Document information Info Content Keywords Abstract PN512; Raspberry Pi, NFC, P2P, Card Emulation, MIFARE, ISO/IEC 14443, EXPLORE-NFC This document gives a description on how to get started with the provided software packages in conjunction with the EXPLORE-NFC board and the Raspberry Pi Model B.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Revision history Rev Date Description 1.0 First release 20131217 Contact information For more information, please visit: http://www.nxp.com For sales office addresses, please send an email to: salesaddresses@nxp.com AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 1. Introduction This document gives a description on how to get started with the provided software packages in conjunction with the EXPLORE-NFC board and the Raspberry Pi Model B. This document provides a step by step guide to the installation procedure of the software and the hardware. Fig 1. EXPLORE-NFC and MIFARE Ultralight card 1.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi using H.264 at 40MBits/s. It has a fast 3D core accessed using the supplied OpenGL ES2.0 and OpenVG libraries. In addition, the Model B has 512MB RAM included in its SoC. To get started quickly, the Rapberry Pi Foundation provides several preconfigured Linux distributions. For the project described in this guide we are using the “Raspbian wheezy [7.]. For more information about the Raspberry Pi please visit [9.].
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 2. Software installation 2.1 Required items • Compatible SD card [1.] with a size of at least 4GB. • Card reader 2.2 Downloading the software Please download Win32DiskImager and the Raspbian “wheezy” image from the download page of the Raspberry Pi foundation [12.]. 2.3 Preparing the SD card 1. Unzip the archive containing the system image. 2. Insert the SD card into a card reader connected to the PC. 3.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 3. Hardware installation Required items • Raspberry Pi Model B • Contactless reader board EXPLORE-NFC • Compatible SD card [1.] • Micro USB power supply (5V / 1A) [2.] • Keyboard • Mouse • DVI cable to connect to a Monitor / TV Please connect the hardware in the following order: 1. Connect the EXPLORE-NFC board.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Fig 4. AN11480 Application note COMPANY PUBLIC EXPLORE-NFC and Raspberry Pi stacked together – side view All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 4. Preparation of the demo software for the Raspberry Pi All example software projects are being delivered within an installer. We provide installer for the platforms Linux x86 and Windows x86. The installer cannot be executed on the Raspberry Pi because of the ARM architecture. To obtain the example projects, please execute the installer.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 5. Login to the Raspberry Pi and starting the software This section describes how to compile and run the software for the EXPLORE-NFC demo board. The steps shown here are especially for the Polling project. In principle the description can be transferred to the other projects easily. The only procedural differences will be the naming of the folders. 5.1 Login to the Raspberry Pi 1.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 8. The software detects MIFARE cards in an endless loop. The EXPLORE-NFC board in conjunction with this software is able to detect MIFARE Ultralight, MIFARE Classic, MIFARE Plus and MIFARE DESFire cards. To stop the software, please press Ctrl + C on the keyboard. AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 6. How does the Polling software work? Imagine in a Hotel you got a key card for your room and want to check what card it is. Is it contactless card? And if it is a contactless card, what type of card is it? Or if you got a contactless public transport monthly pass. With the polling software you can get this information immediately.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi commands are named “AppSelection1” and “AppSelection2”. Only one of those commands need to be sent to the card If both tries to select the PSE file are answered with an error, we can assume that we have no PSE crad in the field. When the return value is positive, the PSE name will be taken from the return answer and the function “Compare” checks whether it is valid or not.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 7. Card Emulation project Suppose you want to organize an outdoor game similar to Paper Chase and you want to give it a digital touch. In addition you also want to give some audience the opportunity to follow the game live. Then Card Emulation is the key technology for that purpose.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi A specification to store data for any kind of service and application is specified in the NFC Forum and it is called NFC Data Exchange Format. Storing NDEF formatted data inside contactless card products as mapping models as well as the management of NFC forum device as a specific platform such as a NFC Forum Type 4 Tag are defined in [18.].
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 7.6 Program flow Fig 5. Program flow of the Facebook Card Emulation example AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi The first blocks describe the initialization of the necessary layers and components independent of the card emulation. After the layers have been initialized, the card emulation can be initialized too. After applying the protocol settings, the PN512 waits for a successful activation of the card side. This activation can be done for example by an NFC enabled mobile device.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Choose a folder where you want to save the file and copy the application file (FacebookMsg.apk) there. Take the phone and open the data manager application. Switch to the selected folder and tap the Facebook.apk file. Tap the “Settings” button to accept unknown sources. Unknown source means that the application has not been obtained from the Google Play Store. Fig 7.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Fig 8. Accept unknown sources Change to the file manager again and tap the “FacebookMsg.apk”. Now tap the “Install” button. Fig 9. Install the Application Installation finished. Tap “Open” to use the application. AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Fig 10. Finish 7.7.3 First post Choose the “Write“ screen. Fig 11. Startscreen Tap the „Create“ button for creating a new message AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Fig 12. Message store Type your message and tap the “Store” button Fig 13. Create a message Select your message in the message store and tap the “Write” button. AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Fig 14. Message store Touch the antenna of the NFC extension board with your device Fig 15. Write screen AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi Now the message gets sent to the NFC application that has been executed on the Raspberry Pi previously. 8. P2P SNEP client project Imagine you receive an image via e-mail and want to upload it to your mobile phone. If you have no cable at hand, you need to fiddle about with Bluetooth or WiFi. That is the point where NFC – P2P makes the game.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 8.2 Choosing the NDEF message By default the software sends an image of the NXP logo as NDEF message. There are more NDEF messages prepared in dedicated header files (see Table 1). Only a single header can be compiled with the SNEP client application. To choose another content of the NDEF message for transmission just do following modifications in the Error! Unknown document property name./source/ndef_message.c. 1.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 7. Type the following command: cmake ../source 8. Compile the source with the command make 9. Run the program with the command ./Snep_client 8.5 Timers In the NXP Reader Library P2P there is the OSAL module – NxpRdLib_PublicRelease/comps/phOsal encapsulating memory allocation and time related functions. Time related functions are more precisely described in [10.].
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 9. Supplementary notes 9.1 Turning off the Raspberry Pi The Raspberry pi has no power switch. To turn it off, please type sudo halt into the command prompt. After the screen turns black, you may unplug the power supply. 9.2 Resizing the file system In case one uses an SD card bigger than 2GB it might be reasonable to resize the root file system to use the whole space of the SD card.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 10. References [1.] List of verified SD cards: http://www.nxp.com/redirect/elinux.org/RPi_SD_cards [2.] List of verified USB power adapters: http://www.nxp.com/redirect/elinux.org/RPi_VerifiedPeripherals_Power_ adapters [3.] Software for the Raspberry Pi: https://nxp.box.com/RaspberryPi [4.] Supported wireless network adapters: http://www.nxp.com/redirect/elinux.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi [18.] TYPE 4 TAG: NFC Forum, Type 4 Tag Operation Specification, Version 1.0, March 13, 2007 www.nxp.com/redirect/nfc-forum.org/specs AN11480 Application note COMPANY PUBLIC All information provided in this document is subject to legal disclaimers. Rev. 1.0 — 17 December 2013 279710 © NXP B.V. 2013. All rights reserved.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 11. Legal information 11.1 Definitions Draft — The document is a draft version only. The content is still under internal review and subject to formal approval, which may result in modifications or additions. NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information.
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 12. List of figures Fig 1. Fig 2. Fig 3. Fig 4. Fig 5. Fig 6. Fig 7. Fig 8. Fig 9. Fig 10. Fig 11. Fig 12. Fig 13. Fig 14. Fig 15. Fig 16. EXPLORE-NFC and MIFARE Ultralight card .... 3 Win32 Disk Imager............................................ 5 EXPLORE-NFC and Raspberry Pi stacked together – top view............................................ 6 EXPLORE-NFC and Raspberry Pi stacked together – side view ........
AN11480 NXP Semiconductors Quick Start Up Guide for EXPLORE NFC working with Raspberry Pi 13. Contents 1. 1.1 1.2 1.3 2. 2.1 2.2 2.3 3. 4. 5. 5.1 5.2 5.3 5.4 6. 6.1 6.2 6.3 7. 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.7.1 7.7.2 7.7.3 8. 8.1 8.2 8.3 8.4 8.5 8.5.1 8.5.2 9. 9.1 Introduction ......................................................... 3 What is EXPLORE-NFC? ................................... 3 What is a Raspberry Pi? .................................... 3 NXP Reader Library and Linux.....................