NFCナレッジベース

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

NFC Knowledge Base

ディスカッション

ソート順:
This page contains information about the supported NXP MCU/MPU and NXP NFC product combinations which have ready to use packages. These can be used as a reference. The table below contains link to where you can find the projects as well.    MCU ↓   NFC IC →  NTAG I²C  plus NTAG 5 PN7150 CLRC663 plus family* PN5180 i.MX RT1050 i.MX RT1050 + NTAG I²C plus i.MX RT1050 + CLRC663 plus   Video: Using i.MX RT1050 with CLRC663 plus family and the NFC Reader Library | NXP  i.MX RT1060 i.MX RT1060 + NTAG I²C plus  i.MX RT1060 + PN7150 i.MX 8M Mini i.MX 8M Mini + PN7150 (Andriod) i.MX 8M Mini + PN7150 (linux-yocto) i.MX 7 Dual Sabre i.MX7 Dual Sabre + PN5180 LPC1769 LPC1769 + CLRC663 plus LPC1769 + PN5180 LPC55S69 LPC55S69 + NTAG I²C plus LPC55S69 + NTAG 5 LPC55S69 + PN7150 LPC55S69 + CLRC663 plus LPC55S69 + CLRC663 plus + SE050 (smart lock) LPC11u37h LPC11u37 + PN7150 LPC11u37h + CLRC663 plus LPC11u68 LPC11u68 + PN7150 LPC82X LPC82X + PN7150 LPC845 LPC845 + CLRC663 plus Kinetis K82F K82F + CLRC663 plus K82F + PN5180 Kinetis K64F K64F + PN7150 K64F + CLRC663 plus Kinetis K63 K63 + PN7150 Kinetis K24 K24 + PN7150 KW41Z KW41Z + NTAG I²C plus KW41Z + NTAG 5 KW41Z + PN7150 *CLRC663 plus family: CLRC663 plus, MFRC630 plus, MFRC631 plus, SLRC610 plus For more information on the NFC products, please visit https://www.nxp.com/nfc
記事全体を表示
The latest NXP-NCI example is rev 1.6, and when you run this demo with the lpc11xx board, for example, lpc1115 rev A, and the OM5577, you may meet the following issue: The problem is due to two aspects: one is hardware and the other is software. For hardware solution, besides following what is described in AN11658 section 2.4 LPC11xx, you have to do one more thing: a) The I2C lines are not pulled-up: LPC11xx doesn't offer internal pull-up setting of the I2C lines so external pull-up resistors must be added. For software solution, the function of Sleep()( in tool.c) was optimized too much, and it didn't meet the timing requirement of OM5577, so we should let the IDE ignore it. The solution I use is as below: __attribute__((optimize("O0"))) void my_func() { blah } You may check the attachment for details. The result is shown as below: Original Attachment has been moved to: tool.c.zip
記事全体を表示
Hello NFC community, MIFARE® Ultralight-based tickets offer an ideal solution for low-cost, high-volume applications such as public transport, loyalty cards and event ticketing. They serve as a perfect contactless replacement for magnetic stripe, barcode, or QR-code systems. The introduction of the contactless MIFARE Ultralight® ICs for limited-use applications can lead to reduced system installation and maintenance costs. As you may know the MIFARE family has the Ultralight C tag which is a contactless IC supporting 3DES cryptography is mostly used in limited use applications such smart ticketing, this tag complies with ISO 14443-3 type A and it is defined as type 2 tag, in this document I want to show you the procedure to change the default key to a custom key also to protect certain areas in the tag so the authentication is needed to perform a read or write operation. --------------------------------------------------------------------------------------------------- For this document I used : MFEV710: PEGODA Contactless Smart Card Reader RFIDDiscover Software Lite version  Full Version Available in Docstore Mifare Ultralight c --------------------------------------------------------------------------------------------------- Information Old Key : 49454D4B41455242214E4143554F5946 New Key : 88776655443322117766554433221199 Data sheet ---------------------------------------------------------------------------------------------------- First we start with the procedure to activate the tag and the anticollision procedure explained in the ISO/IEC 14443-3. Command Direction    ">" this direction is command send from PCD (Reader) to PICC(Ultralight c)    "<" this direction is command send from PICC (Ultralight c) to PCD (Reader)    "=" Prepare this command before sending Command   Data message REQA =  Request Command, Type A >  26 ATQA = Answer To Request, Type A  <  4400 SEL + NVB = SEL (Select code for cascade level ) 93, NVB (Number of Valid bits) 20 >  9320 ANTICOLLISION START <  8804598356   >  93708804598356 SAK (Select Acknowledge) = indicates additional cascade level <  x04   >  9520   <  E1ED2580A9   >  9570E1ED2580A9   <  x00 UID = 045983E1ED2580  ** the following procedure is explained in section 7.5.5 from the datasheet** Command   Data message Authenticate Part 1  (command 1A) >  1A00   <  AFA1ED1D682E5101422CC7 Authenticate Part 2 (command AF) >  AF2970D895F186D0302970D895F186D030188AAF4DAF68C5B9   <  006BD027CEC3E04EBC6919 [AUTHENTICATED] Then according to  section 7.5.7 of the datasheet the sections  where the 3DES key are saved are the 2C (Page 44) to the 2F (Page 47). We proceed to  write our new key using the A2 (WRITE command) Command   Data message DATA = byte 07,06,05,04 = 11223344 WRITE to page 44 (2C) >  A22C11223344 Positive acknowledge (ACK) <  0A DATA = byte 03,02,01,00 = 55667788 WRITE to page 45 (2D) >  A22D55667788  Positive acknowledge (ACK) <  0A DATA = byte 0F,0E,0D,0C = 99112233 WRITE to page 46 (2E) >  A22E99112233  Positive acknowledge (ACK) <  0A DATA = byte 0B,0A,09,08 = 44556677 WRITE to page 47 (2F) >  A22F44556677  Positive acknowledge (ACK) <  0A [RESET FIELD] [Authenticate with new key] Command   Data message Authenticate Part 1  (command 1A >  1A00   <  AFFAE2EFF17FAAD69862E7 Authenticate Part 2 (command AF) >  AFFD5794F2D4EA1B19FD5794F2D4EA1B196CF420CD4D9E8104   <  0030922228601939B8FA18 [AUTENTICATED WITH NEW KEY] we proceed to define from which sector the authentication is needed in order to read or write, to do this we use a write command to the AUTH0 (AUTH0 defines the page address from which the authentication is required. Valid address values for byte AUTH0 are from 03h to 30h.) the AUTH0 is located on the section 2A please check table 5 from #datasheet. **for this example we will define that from page 6 (06) we will need authentication to perform a read or write operation** Command   Data message WRITE command (A2) to AUTH0 (2A) from page 6 (06) >  A22A06000000 Positive acknowledge (ACK) <  0A Now the Read capabilities from page 06  require an Authentication in order to be read or written. Hope you find this document useful to get a better understanding of the behavior of the Ultralight C and how its security features can help you in your applications. Have a great day! BR Jonathan
記事全体を表示
The NFC Reader Library is a complete software support library for NFC Frontend ICs. Designed to give developers a faster and simpler way to deliver NFC-enabled products. This multi-layer library, written in C, makes it easy to create NFC based applications. The NFC Reader Library includes a package for K82F. This package can be download from this page. The version used is 05.22.01 - NFC Reader Library for FRDM F82K HW Changes Connecting FRDM_K64F toCLEV6630B Import into MCUXpresso SW Changes (FRDM_K64F) Import the hello_world_demo_apps example Add the source code Basic Discovery Loop Example Link the NFC Reader Library Define FRDM_K64F SDK preprocessor symbols Add include paths Add folder to Source Location Files Modifications phDriver_KinetisSDK.c Board_FRDM_K64FRc663.h BoardSelection.h ph_NxpBuild_App.h phApp_Init.h phApp_Init.c K64 Drivers Demonstration HW Changes The CLEV6630B board has the CLRC663 connected with LPC1760 MCU via SPI. The design of the CLEV6630B makes it very easy to use another MCU, which is what we need to do. To have direct access from FRDM_K64F to CLRC663, this change is needed: the six resistors marked by red squares need to be removed to obtain proper decoupling of the LPC1769 MCU from the CLEV6630B board. Connecting FRDM_K64F to CLEV6630B These are the connections required for this porting: FRDM_K64F pin Connection CLEV6630B pin J2-8 / PTD2 MOSI MOSI J2-10 / PTD3 MISO MISO J2-12 / PTD1 SCK SCK J2-6 / PTD0 SSEL SSEL J1-2 / PTC16 IFSEL0 IF0 J1-4 / PTC17 IFSEL1 IF1 J1-11 / PTC0 IRQ IRQ J1-5 / PTC1 RESET CLRC_NRST J2-14 / GND GND GND Import into MCUXpresso In the Quickstart Panel, click on Import project(s) from file system… Browse the project archive (zip) from your file system. Click Next to select the projects needed (In this example, is just imported the Basic Discovery Loop example). Click on Finish to import the selected ones. The imported projects will appear in the Project Explorer of the workspace. SW Changes (FRDM_K64F) Download and install the K64F SDK from the SDK Builder. Import the hello_world_demo_apps example Click on Import SDK example(s)... Select the frdmk64f. Import the hello_world example and click on Finish. Then we rename the project to frdm_k64f_basic_discovery_loop. Over this project we are going to apply the changes Add the source code Basic Discovery Loop Example Copy the NfcrdlibEx1_BasicDiscoveryLoop.c to our K64 project. Also copy from the src folder the phApp_Init.c file from NfcrdlibEx1_BasicDiscoveryLoop to frdm_k64f_basic_discovery_loop source folder. Link the NFC Reader Library We add the DAL, NxpNfcRdLib, phOsal and intfs folders from NfcrdlibEx1_BasicDiscoveryLoop project to thefrdm_k64f_basic_discovery_loop project. Right click on the frdm_k64f_basic_discovery_loop project, click on New>Folder: Click on Advanced, and select Link to alternate location (Link Folder). Click on Browse… browse to your workspace and choose the NxpNfcRdLib folder. Click on Finish. The same procedure has to be done with the DAL, phOsal and intfs folders. The project should appear with the following structure: Define FRDM_K64F SDK preprocessor symbols We need to change the compiler preprocessor configuration. Right click on the frdm_k64f_basic_discovery_loop Project. Click on Properties.. Go to C/C++ Build>Settings>Tool Settings>MCU C Compiler>Preprocessor The actual symbols are related with the board, but we need to add the related with the Reader Library. These are the symbols we need to add: PHDRIVER_FRDM_K64FRC663_BOARD PH_OSAL_NULLOS NXPBUILD_CUSTOMER_HEADER_INCLUDED Then click on Apply and Close, and Yes. Add include paths After that we add the paths of the folders we recently linked: Right click on the frdm_k64f_basic_discovery_loop Project. Click on Properties.. Go to C/C++ Build>Settings>Tool Settings>MCU C Compiler>Includes The Include paths should be listed like this: Add folder to Source Location Then we add the root folder to the Path and Symbols: Right click on the frdm_k64f_basic_discovery_loop Project. Click on Properties.. Go to C/C++ General>Path and Symbols>Source Location Files Modifications phDriver_KinetisSDK.c We need to change some lines in the DAL>KinetisSDK>phDriver_KinetisSDK.c file: GPIO_PortClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[bPortGpio], bPinNum);‍‍‍‍‍‍‍‍‍‍‍ bValue = (uint8_t)((GPIO_PortGetInterruptFlags((GPIO_Type *)pGpiosBaseAddr[bGpioNum]) >> bPinNum) & 0x01); bValue = (uint8_t)GPIO_PinRead((GPIO_Type *)pGpiosBaseAddr[bGpioNum], bPinNum);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ GPIO_PinWrite((GPIO_Type *)pGpiosBaseAddr[bGpioNum], bPinNum, bValue);‍‍‍‍‍‍‍‍‍‍‍ GPIO_PortClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[bGpioNum], (1<<bPinNum));‍‍‍‍‍‍‍‍‍‍‍ These changes are related to the names of the functions in our SDK version (2.7.0). We can erase the Linux, LPCOpen and PN74xxxx folders, we don’t need them for this migration. frdm_k64f_basic_discovery_loop>DAL>src Also, to avoid multiple definitions issues, we erase the phOsal>src>NullOS>portalble>psOsal_Port_CM3.c file. Board_FRDM_K64FRc663.h The architecture of the NFC Reader Library makes it very simple to be able to use other MCU’s, since you only need to adapt the configuration of the peripheral drivers. To do this, there are some changes required in the DAL (Driver Abstraction Layer) of the Reader Library. In frdm_k64f_basic_discovery_loop>DAL>boards folder, are some header files with the information of different MCU’s and Readers. We need to add our header file: Board_FRDM_K64FRc663.h We can copy the Board_FRDM_K82FRc663.h, rename and make the needed modifications. BoardSelection.h Then we add the K64 option to the BoardSelection.h header. #ifdef PHDRIVER_FRDM_K64FRC663_BOARD # include <Board_FRDM_K64FRc663.h> #endif‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ph_NxpBuild_App.h #if defined(PHDRIVER_LPC1769RC663_BOARD) \ || defined(PHDRIVER_FRDM_K82FRC663_BOARD) \ || defined(PHDRIVER_FRDM_K64FRC663_BOARD) # define NXPBUILD__PHHAL_HW_RC663 #endif‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ phApp_Init.h /* Check for K64 controller based boards. */ #if defined(PHDRIVER_FRDM_K64FRC663_BOARD) #define PHDRIVER_KINETIS_K64 #endif‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ #ifdef PHDRIVER_KINETIS_K64 # include <fsl_debug_console.h> # include <stdio.h> #endif #ifdef DEBUG #if defined(PHDRIVER_KINETIS_K82) || defined (PHDRIVER_KINETIS_K64) #if SDK_DEBUGCONSOLE==1 #define DEBUG_PRINTF DbgConsole_Printf #else #define DEBUG_PRINTF(...) printf(__VA_ARGS__); #endif #else /* PHDRIVER_KINETIS_K82 */ #include <stdio.h> #define DEBUG_PRINTF(...) printf(__VA_ARGS__); fflush(stdout) #endif /* PHDRIVER_KINETIS_K82 */ #else /* DEBUG */ #define DEBUG_PRINTF(...) #endif /* DEBUG */‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ phApp_Init.c Also we to add the FRDM_K64F CPU initialization in phApp_Init.c: #ifdef PHDRIVER_KINETIS_K64 #include <fsl_port.h> #include <fsl_pit.h> #ifdef DEBUG #include <fsl_clock.h> #endif #endif /* PHDRIVER_KINETIS_K64 */‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ #ifdef PHDRIVER_KINETIS_K64 static void phApp_K64_Init(void); #endif /* PHDRIVER_KINETIS_K64 */‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ #ifdef PHDRIVER_KINETIS_K64 static void phApp_K64_Init(void) { pit_config_t pitConfig; BOARD_BootClockRUN(); SystemCoreClockUpdate(); PIT_GetDefaultConfig(&pitConfig); PIT_Init(PIT, &pitConfig); BOARD_InitPins(); } #endif /* PHDRIVER_KINETIS_K64 */‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ #elif defined(PHDRIVER_KINETIS_K64) phApp_K64_Init();‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ K64 Drivers The hello_world example does not use SPI and PIT drivers, we need to add these drivers to our project: Right click on the frdm_k64f_basic_discovery_loop Project. Click on SDK Management>Manage SDK Components And we add the dspi and pit drivers: Demonstration With all these changes, now we can run the Basic Discovery Loop with the FRDM_K64F and the CLRC663.
記事全体を表示
This post contains a guide of how to use the NFC Reader Library with LPC55S69. A ready to use package for using the “Basic Discovery Loop” example from the NFC Reader Library with LPC55S69 and CLRC663 plus frontend is attached with this document. This document is structured as follows: Overview of LPC55S69: The LPCXpresso55S69 development board provides the ideal platform for evaluation of and development with the LPC55S6x MCU based on the Arm® Cortex®-M33 architecture. The board includes a high performance onboard debug probe, audio subsystem and accelerometer, with several options for adding off-the-shelf add-on boards for networking, sensors, displays and other interfaces. The LPCXpresso55S69 is fully supported by the MCUXpresso suite of tools, which provides device drivers, middleware and examples to allow rapid development, plus configuration tools and an optional free IDE. MCUXpresso software is compatible with tools from popular tool vendors such as Arm and IAR, and the LPCXpresso55S69 may also be used with the popular debug probes available from SEGGER and P&E Micro. Hardware Requirements: Following hardware is required to run the project: LPC55S69-EVK development board. CLEV6630B board or BLE-NFC-V2 board. BLE-NFC-V2: It is easier to use the BLE-NFC-V2 board since it can be just plugged on top of the arduino interface available on the LPCXpresso55S69 board. The following figure shows the pin mapping between the two boards. CLEV6630B board: The CLEV6630B board consists of CLRC663 plus (NFC frontend) connected by default to an LPC1769 µC via SPI. However, the board is made in such a way that the LPC1769 MCU can be bypassed to connect to an external MCU (in our case the LPC55S69) easily. For doing so: Six resistors from the board need to be removed. These are highlighted in red in the Figure 1: Use the SPI pin connectors available on the left-hand side, on the board edge to connect to external MCU (LPC55S69 in this case) Solder jumper wires onto the following pins of CLEV6630B Board:  GND IRQ CLRC_NRST SSEL MOSI MISO SCK IF0 IF1      The CLEV6630B is shown in Figure 2 after the required changes have been made to it (Removal of resistors and soldering of wires).   Now connect the two boards as follows:   Running Basic Discovery Loop on LPC55S69:   If this is the first time you’re using LPC55S69-EVK board, follow the getting started guide first à  LPC55S69-EVK | NXP . Make sure to install the SDK package for LPC55S69-EVKboard which is required for the project below to run. Download either‘lpcxpresso55s69_BasicDiscoveryLoop_CLEV6630b' or 'lpcxpresso55s69_BasicDiscoveryLoop_BLE-NFC' package which you will find attached to this post. Drag and drop the downloaded package to the “Project Explorer” tab of your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free from here: https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE Now that the package has been imported to the MCUXpresso IDE (via drag and drop), click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started, click on the run icon to run the code: The project should be running now. The project contains basic discovery loop functionality. Here is how the output looks like in the terminal. Bring any NFC card near the frontend’s antenna and the output console will show the detection and type of the card. For example, in the picture below, we can see that type 4A card was detected:     Running other NFC Reader Library examples on LPC55S69: Once the “lpcxpresso55s69_BasicDiscoveryLoop” project is running on the LPC55S69. Running other examples from is simple. First step is to install the NFC Reader Library : Installing the NFC Reader Library: Go to www.nxp.com/pages/:NFC-READER-LIBRARY Go to the Downloads tab and click on the download button Click download on the NFC Reader Library for Kinetis K82F package. Import the library package in the workspace. The easiest way is to use the Quick Start Panel on the left-hand side: Click on Import project from file system Then, browse the library package in your file system. Click Finish to import it all to your workspace. After completing the import wizard, all projects are listed in the “Project Explorer” window. As can be seen in the screenshot, it contains different folders: API documentation folder Driver Abstraction Layer FreeRTOS support The platform support (in the screenshot, corresponding to the LPC support) The software examples  The Reader Library implementation And the OS abstraction layer   Running "NfcrdlibEx9_NTagI2C" on LPC55S69: Here we use the “NfcrdlibEx9_NTagI2C” example from the reader library to describe the method. The same method can be used to run other examples from the NFC Reader Library.  To run "NfcrdlibEx9_NTagI2C" on LPC55S69, we look at "lpcxpresso55s69_BasicDiscoveryLoop" project (available as a download below) and "NfcrdlibEx9_NTagI2C" project (from the Reader Library). We make changes to the following folders: In “intfs” folder remove everything except the “phaApp_Init.h” file. Then go to the “intfs” folder of the NFC Reader Library example you want to run (“NfcrdlibEx9_NTagI2C” in this case), and copy all the files except “phaApp_Init.h” and paste them in the original “intfs” folder. In line 57 of the “ph_NxpBuild_App.h” file in “intfs” folder, replace #if defined(PHDRIVER_LPC1769RC663_BOARD) \     || defined(PHDRIVER_FRDM_K82FRC663_BOARD)\ #   define NXPBUILD__PHHAL_HW_RC663 #endif with #if defined(PHDRIVER_LPC1769RC663_BOARD) \     || defined(PHDRIVER_FRDM_K82FRC663_BOARD)\     || defined(PHDRIVER_LPC55S69RC663_BOARD) #   define NXPBUILD__PHHAL_HW_RC663 #endif Go to “source” folder and remove every file except “phApp_Init.c“ and “semihost_hardfault.c” files. Then go to “src” folder of the example you want to run (“NfcrdlibEx9_NTagI2C” in this case) and copy all the files except “phaApp_Init.c” and paste them into the “source” folder. Finally, copy the main file of the example you want to run (NfcrdlibEx9_NTagI2C in this case) and paste it into the “source” folder as well. The project is ready to build and run on LPC55S69.       Available Resources: Porting NFC Reader Library to i.MX RT1050. (Detailed Description of porting) https://community.nxp.com/docs/DOC-341843 LPC55S69 https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK BLE-NFC-V2 https://www.nxp.com/products/identification-security/rfid/nfc-hf/nfc-readers/clrc663-iplus-i-and-qn902x-nfc-bluetooth-low-energy-solution-for-consumer-applications:BLE-NFC
記事全体を表示
Hello NFC Community,   This document focuses to the configuration of the LPC8N04 to be controlled by the data it receives though the NFC interface. The document is based on the nfc_eeprom project of LPC8N04’s SDK. It will basically be necessary to modify the code within while(1) loop as below.   Get the data from NFC and store it on d_Data buffer:             if (NDEFT2T_GetMessage(g_NdefInstance, g_Data, sizeof(g_Data))) { /* Save NDEF Data into EEPROM */ //Chip_EEPROM_Write(LPC_EEPROM, 0, g_Data, sizeof(g_Data)); }‍‍‍‍‍‍‍ Clear respective semaphore and Flag: /** Clear Memory Write Semaphore */ releaseMemSemaphore(); /** Clear Write Flag */ g_TargetWritten = 0;‍‍‍‍‍‍‍   Now that the information is in the g_Data buffer now you may proceed to verify the received data with the one expected to trigger a function e.g., to turn on/off a led.   if(g_Data[7] == 'A') { Led_Set(true); } else if(g_Data[7] == 'B') { Led_Set(false); }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍     On the other side, it will only be necessary to approach the reader to the LPC8N04's antenna and the NDEFT2T_GetMessage(g_NdefInstance, g_Data, sizeof(g_Data)) function will get the data and store it on the g_data buffer mentioned above. Happy development! BR, Ivan.
記事全体を表示
Hello NFC Community! This document demonstrates that multiple records can be also read from a Tag with TagXplorer. Please follow the steps below. Let's begin... Please make sure that you have written more than on record with NXP TagWriter app. For a more detailed explanation on this, please refer to the following document: Writing multiple NDEF text records with TagWrite app  The app can be found and downloaded from the Play Store: NFC TagWriter by NXP - Apps on Google Play  -> Connect the reader in TagXplorer -> Place the card on the reader and press Connect Tag -> Check for NDEF (1) and then, read NDEF (2). The Text Records can be visualized in the NDEF Payload Info below: I hope this is of great help! Ivan R.
記事全体を表示
This demonstration is based on RFIDDiscover full version and Pegoda EV710. You may refer to the following links for more details. RFIDDiscover | NXP  PEGODA Contactless Smart Card Reader | NXP  Before start the demonstration, please connect Pegoda with your PC via USB and place the MIFARE DESFire Light card on the reader. The history and log can be fetched from the attachment. Please refer to the video for more details.  
記事全体を表示
The latest NFC reader library for CLRC663 just supports LPCXpresso1769 and FRDM-K82 boards, so when customers want to porting the library to other host controller, they have to make a custom board at first, or use OM26630FDK and make a little hardware modification by following the steps described in https://www.nxp.com/docs/en/training-reference-material/NFC-READER-K64F.pdf?fsrch=1&sr=3&pageNum=1 to connect the frontend board with host controller board, but today we will discuss an alternative way. The CLEV663B Blueboard is a pure NFC frontend board, and it supports connecting with LPCXpresso board not limited with LPC1769, the main difference with OM26630FDK is the reader IC, which is CLRC663 not CLRC663 plus, but fortunately they are pin to pin compatible, so we may replace it with CLRC663 plus, and use that board for porting purpose. Before: After: please forgive my poor soldering skill... With this new board and LPC1769 Xpresso board, you may run the latest 5.12 NFC reader library, for example, the NfcrdlibEx1_BasicDiscoveryLoop demo. but you might have the following issue: This is due to ver 5.12 use another set of IO pins to connect with the reader IC, modify pin definitions in Board_Lpc1769Rc663.h can fix this issue. The final result is as below: Please note, it is recommended using NFC reader library ver 4.03 to test the hardware including CLEV663B and LPC1769Xpresso before replacing with CLRC663 plus, and you know, CLEV663B Blueboard is just optimized for CLRC663 , so the matching circuit is not the best for CLRC663 plus, it is just good enough to run the demo, so that we may know if the porting is successful, but if you want to have the best performance with CLRC663 plus, you have to redo the antenna tuning, and you may refer to https://community.nxp.com/docs/DOC-335545 for more details on that topic.
記事全体を表示
This post contains a step by step guide of how to use PN7150 with LPC55S69.  This document is structured as follows: Overview of PN7150:  The PN7150 is a Plug-and-Play all-in-one NFC solution for easy integration into any OS environment like Linux and Android, reducing Bill of Material (BoM) size and cost. The embedded Arm® Cortex®-M0 microcontroller core is loaded with the integrated firmware, simplifying the implementation as all the NFC real-time constraints, protocols and the device discovery (polling loop) are processed internally. In few NCI commands, the host SW can configure the PN7150 to notify for card or peer detection and start communicating with them. It has the following salient features: Full NFC forum compliancy with small form factor antenna Embedded NFC firmware providing all NFC protocols as pre-integrated feature Direct connection to the main host or microcontroller, by I2C-bus physical and NCI protocol Ultra-low power consumption in polling loop mode Highly efficient integrated power management unit (PMU) allowing direct supply from a Battery Overview of LPC55S69:  The LPCXpresso55S69 development board provides the ideal platform for evaluation of and development with the LPC55S6x MCU based on the Arm® Cortex®-M33 architecture. The board includes a high performance onboard debug probe, audio subsystem and accelerometer, with several options for adding off-the-shelf add-on boards for networking, sensors, displays and other interfaces. The LPCXpresso55S69 is fully supported by the MCUXpresso suite of tools, which provides device drivers, middleware and examples to allow rapid development, plus configuration tools and an optional free IDE. MCUXpresso software is compatible with tools from popular tool vendors such as Arm and IAR, and the LPCXpresso55S69 may also be used with the popular debug probes available from SEGGER and P&E Micro. Hardware requirements: OM5578/PN7150ARD  LPCXpresso55S69 + usb  micro cable  Using PN7150 with LPC55S69-EVK: Hardware Connections: The hardware connections are simple. Both the LPC55S69-EVK board and OM5578/PN7150ARD board have an Arduino interface. So, mount the PN7150ARD board with male Arduino connector onto the female Arduino connector of the LPC55S69-EVK board. Running the demo: If this is the first time you’re using LPC55S69-EVK board, follow the getting started guide first à  LPC55S69-EVK | NXP . Make sure to install the SDK package for LPC55S69-EVKboard which is required for the project below to run. Download the ‘NXP-NCI_PN7150_LPC55xx_example’ package which you will find attached to this post. Drag and drop the downloaded package to the “Project Explorer” tab of your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free by clicking here: Now that the package has been imported to the MCUXpresso IDE (via drag and drop), click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started, click on the run icon to run the code: The project should be running now. The project contains basic discovery loop functionality. Here is how the output looks in the console tab on MCUXpresso: Bring any NFC card near the PN7150 board’s antenna and the output console will show the detection and type of the card. For example, in the picture below, we can see that type 4 card was detected: Available Resources: AN11990 NXP-NCI MCUXpresso example document. (https://www.nxp.com/docs/en/application-note/AN11990.pdf) The example project explained in this project was ported to LPC55S69 using section 5.3 and 6 of the above mentioned document. PN7150 datasheet (https://www.nxp.com/docs/en/data-sheet/PN7150.pdf) PN7150 User Manual (https://www.nxp.com/docs/en/user-guide/UM10936.pdf) PN7150 NFC Controller SBC Kit User Manual  (https://www.nxp.com/docs/en/user-guide/UM10935.pdf)
記事全体を表示
Hello NFC enthusiasts,   In the NFC communication protocol, when a device acts as a NFC reader (it provides its own field), it is waiting for a tag to approach. When this occurs, the reader energizes the tag and depending on the application, it can read from or write to a tag.   When multiple tags are in the field, the power decreases according to the number of tags being energized, for which the tag operations will not work properly. For this, there is a process called anti-collision, in which the reader decides, from the detected tags, one to work with.   The purpose of this document is to demonstrate the activation of each tag at a given index.   This demonstration is going to be made with two NTAG 216.     This demonstration is based on NXP NFC Reader Library v05.02.00, NfcrdlibEx3_NFCForum project for PNEV7462B, in which some modifications are going to be made in order to carry this out. These tags are compliant with NFC Forum Type 2 Tag and ISO/IEC14443 Type A specifications.    In phacDiscLoop.h modify the max number of cards supported (two cards for this demonstration):   #define PHAC_DISCLOOP_CFG_MAX_CARDS_SUPPORTED 0x02U      In NfcrdlibEx3_NFCForum.c add the following code in LoadDiscoveryConfiguration():   static phStatus_t LoadDiscoveryConfiguration() { ... /*Passive max typea devices*/ status = phacDiscLoop_SetConfig(pDiscLoop, PHAC_DISCLOOP_CONFIG_TYPEA_DEVICE_LIMIT, 2); CHECK_STATUS(status); }   A fix to the SW stack has to be made (Fix will be implemented in the next release): open "phacDiscLoop_Sw_Int_A.c", line 511, change if statement as below.     if((pDataParams->sTypeATargetInfo.bTotalTagsFound > 1) && ((bTypeATagIdx) < pDataParams->sTypeATargetInfo.bTotalTagsFound))     Until now, the reader is able to detect a maximum of two tags and work with up to two type A devices.   The activation of a tag at a given index is possible to the phacDiscLoop_ActivateCard() function.   Once this function is called, it will receive the discovery loop data parameters, the type of tag and the index of a tag to be activated.   The code will be added after knowing that multiple tags are detected and resolved in the NfcrdlibEx3_NFCForum.c file.   else if((status & PH_ERR_MASK) == PHAC_DISCLOOP_MULTI_DEVICES_RESOLVED) { /* * Multiple cards resolved. It enters here if DEVICE LIMIT > 1 and more than one devices are * detected and resolved. */ DEBUG_PRINTF (" \n Multiple cards resolved: \n"); /* Get detected technology type */ status = phacDiscLoop_GetConfig(pDiscLoop, PHAC_DISCLOOP_CONFIG_TECH_DETECTED, &wTagsDetected); CHECK_STATUS(status); /* Get number of tags detected */ status = phacDiscLoop_GetConfig(pDiscLoop, PHAC_DISCLOOP_CONFIG_NR_TAGS_FOUND, &wNumberOfTags); CHECK_STATUS(status); DEBUG_PRINTF ("\tNumber of tags: %d \n",wNumberOfTags); /* Code */ ... } Note: The code to be inserted in the comment /* Code */ is below in the Code section of this document.   The demonstration will be as simple as activating one tag, read its NDEF message, activate the second tag and read its NDEF message as well so that we make sure the activation process is performed correctly.   Each tag was previously written with a text NDEF message respectively.   Tag 1: Text: Hallo! Language: de   Tag 2: Text: ¡Hola! Language: es   Writing to a tag can be done by making use of our TagWriter app available in the play store: NFC TagWriter by NXP - Aplicaciones de Android en Google Play    Code section:   uint8_t bTagState1; /* Tag 1 */ /* Activate tag at index 0 */ status = phacDiscLoop_ActivateCard(pDataParams, PHAC_DISCLOOP_TECH_TYPE_A, 0x00); /* Check for NDEF presence */ status = phalTop_CheckNdef(palTop, &bTagState1); /* Read NDEF message */ status = ReadNdefMessage(PHAL_TOP_TAG_TYPE_T2T_TAG); DEBUG_ERROR_PRINT(status); /* Tag 2 */ /* Activate tag at index 1 */ status = phacDiscLoop_ActivateCard(pDataParams, PHAC_DISCLOOP_TECH_TYPE_A, 0x01); /* Check for NDEF presence */ status = phalTop_CheckNdef(palTop, &bTagState1); /* Read NDEF message */ status = ReadNdefMessage(PHAL_TOP_TAG_TYPE_T2T_TAG); DEBUG_ERROR_PRINT(status);   Behavior shown in the console monitor:   NFC Forum Example:       This implementation demonstrated the activation of two type A tags at a given index. I hope this is of great help!   Best regards, Ivan. Original Attachment has been moved to: Project-files.zip
記事全体を表示
         
記事全体を表示
DISCLAIMER APPLICABLE TO THIS DOCUMENT CONTENTS: This post contains a guide of how to use i.MXRT1050 demoboard with other NXP demoboards to demonstrate Secure access to industrial IOT, using NFC, embedded secure element and MCU (see picture below). A ready to use package including preparation of a secure element, and of a MIFARE DESFire EV2 card can be used as 3-step authentication example using symmetric AES keys; a session key will be generated inside SE050 which will be exported to i.MXRT1050 which will handle contactless communication thru CLRC663 plus frontend. This document is structured as follows: Hardware Requirements: Following hardware is required to run the project: i.MXRT1050 EVKB development board plus referred TFT LCD Display BLE-NFC-V2 arduino-friendly board. OM-SE050ARD, embedded secure element arduino-friendly R3 board.   1. Overview of i.MXRT1050 EVKB: The i.MXRT1050 EVKB development board provides the ideal platform for evaluation of and development with the i.MX RT1050 crossover processor, featuring NXP’s advanced implementation of the Arm ® Cortex ® -M7 core. The i.MX RT1050 EVK is a 4-layer through-hole USB-powered PCB. The board includes a high performance onboard debug probe, audio subsystem and accelerometer, with several options for adding off-the-shelf add-on boards for networking, sensors, display and other interfaces. This core operates at speeds up to 600 MHz to provide high CPU performance and best real-time response. Support for Amazon FreeRTOS ™ available within the MCUXpresso SDK.The i.MX RT1050 EVK board is now supported by Arm ® Mbed ™ OS and Zephyr ™ OS, both open source embedded operating systems for developing the Internet of Things. i.MXRT1050 EVKB board supported devices Processors and Microcontrollers i.MX RT Series i.MX-RT1050 : i.MX RT1050 Crossover Processor with Arm ® Cortex ® -M7 core Sensors 6-Axis FXOS8700CQ : Digital Motion Sensor - 3D Accelerometer (±2g/±4g/±8g) + 3D Magnetometer Interfaces USB PD-PHY and CC-Logic PTN5110 : USB PD TCPC PHY IC Power Management Load Switches NX3P190UK : Logic controlled high-side power switch NX5P3090UK : USB PD and type C current-limited power switch The i.MXRT1050 EVKB is fully supported by the MCUXpresso suite of tools, which provides device drivers, middleware and examples to allow rapid development, plus configuration tools and an optional free IDE. MCUXpresso software is compatible with tools from popular tool vendors such as Arm and IAR, and the i.MXRT1050 EVKB may also be used with the popular debug probes available from SEGGER and P&E Micro.   As final touch to this demonstrator, one LCD display will be added in order to show "access control" check result when approaching a MIFARE DESFire EV2 card to the Reader antenna, without the use of a computer console.Connection between i.MXRT1050 EVKB board and LCD Display requires attachment of two flat cables, one for touch-screeen functionality and the other for controlling Display itself.   Click here to order Touchscreen LCD Display thru buy direct:                                          P/N: RK043FN02H-CT 12NC:935358709598   2. BLE-NFC-V2: It is easier to use the BLE-NFC-V2 board due to four Arduino compliant male connectors. Current version has only double row-male connectors which imposes that BLE-NFC-V2 board will be the last board stacked on top of other arduino boards. The following figure shows the pin mapping between the two boards.   Pin Function i.MXRT1050  (Arduino connector # - Pin #) CLRC663 plus NFC BLE V2 (Arduino connector # - Pin #) MOSI J24-5 MOSI J10-P14 MISO J24-4 MISO J10-P12 SPI CLK J24-6 SCK J10-P10 SPI CS J24-3 SSEL J10-P16 RESET J22-6 CLRCL_NRST J12-P6 IRQ J22-5 IRQ J12-P8 IFSEL0 J24-7 GND IF0 Via R11 IFSEL1 J25-4 VCC IF1 Via R9 GND J25-6 GND GND J11-P11   Connections between i.MXRT1050 EVKB Board and NFC BLE V2   3 OM-SE050ARD: SE050 Arduino ® Compatible Development Kit The OM-SE050ARD is the flexible and easy-to-use development kit for the EdgeLock™ SE050 Plug & Trust product family. It can be used in various ways for example via the Arduino interface compatible to any board featuring an Arduino compatible header, including many i.MX, LPC and Kinetis ® boards, or via a direct I 2 C connection. This kit allows evaluation of the SE050 product family features and simplifies the development of secure IoT applications. More information can be found in the respective Application Note AN12395. Preparing hardware for "Secure Access to Industrial IOT demo" at i.MXRT1050 EVKB   Reworking i.MXRT1050 EVKB: It is necessary to short circuit 4 empty resistor pads: R278, R279, R280 and R281 – they connect SPI from i.MX1050 until Arduino SPI pads, which will be used by NFC BLE V2 board.   Reworking NFC-BLE V2 board: It is necessary to cut at least one male pin to avoid conflict with OM-SE050ARD board (better would be to cut first 2 pins):   Configuring OM-SE050ARD board jumpers:     Final HW configuration of these three boards altogether: Since NFC BLE V2 has only male connectors, OMSE050ARD board is first connected to i.MX1050 EVKB, then NFC BLE V2 is plugged on top of this latest pcb.       Running "Secure Access to Industrial IOT demo" at i.MXRT1050 EVKB:   If this is the first time you’re using i.MXRT1050 EVKB board, follow this link  i.MXRT1050 board overview . Make sure to install the SDK package for i.MXRT1050 EVKB which is required for the project below to run. Download the following zip package Access_RT_v_1_0_18092019.zip. This file is split in two parts and includes 3 functionalities in one MCUxpresso project: Preparation of MFDFEV2 card The touch screen display will offer three functionalities. By default, the first screen will be "Authenticate" functionality. When you choose the arrow to the right, you'll find TAB with word START, that you'll touch when you need to prepare a MIFARE DESFire EV2 card with suitable application and AES keys used for demonstrator. Just place a virgin card on top of Reader antenna, and press "START" button and check with Terminal on MCUxpresso to check sequence of actions to personalize one DESFire EV2 card. You may also use Teraterm to monitor the execution of DESFire card personalization, by inspecting the COM number used by i.MXRT1050 board.     Preparation of SE050 with proper keys    When you choose the arrow to the left once, you'll find TAB with word Authenticate; if you do it again, then you'll the word "START", which you will touch when you need to prepare a virgin OM-SE050ARD demoboardcard with suitable application and AES keys used for demonstrator. Just press "START" button and check with Terminal on MCUxpresso to check sequence of actions to personalize one SE050 board. You may also use Teraterm to monitor the execution of SE050 key provisioning, by inspecting the COM number used by i.MXRT1050 board. After steps 2.a and 2.b have been done to obtain preparation of one Secure element as well as preparation of one MIFARE DESFire EV2 card, then select using < and > keys the Default Display menu, containing word "Authenticate" : just place DESFire EV2 card on top of NFC antenna and press "Authenticate". If the DESFire EV2 card is the one you have personalized, you'll see a Locker icon that will show "Open locker" , that is "Access granted action". If you place other cards, "Locker icon"will stay closed, that is "Access denied". Again, use MCUxpresso Terminal or use Teraterm to monitor the execution of DESFire EV2 authentication steps with SE050 by inspecting the COM number used by i.MXRT1050 board. Available Resources: Application Note Secure Access to Industrial IoT: https://www.nxp.com/docs/en/application-note/AN12569.pdf  Quick start guide to integration of SE050 with i.MXRT1050 https://www.nxp.com/docs/en/application-note/AN12450.pdf i.MXRT1050 EVKB i.MX RT1050 Evaluation Kit | NXP  BLE-NFC-V2 https://www.nxp.com/products/identification-security/rfid/nfc-hf/nfc-readers/clrc663-iplus-i-and-qn902x-nfc-bluetooth-low-energy-solution-for-consumer-applications:BLE-NFC SE050: www.nxp.com/SE050 Porting guidelines of P&T MW to other non-NXP MCU's:  https://community.nxp.com/t5/Secure-Authentication/Does-the-EdgeLock-SE050-Plug-Trust-middleware-support-non-NXP/m-p/1686723#M1305  https://www.nxp.com/docs/en/application-note/AN12448.pdf  In the attachment area, you'll find:  one bundle zip file split in 2 files: Access RT...zip001.zip and ....zip001.zip. download both files, unzip them in one laptop directory, then you may re-zip them and import in MCUxpresso. They include draft of all three functionalities of secure access to industrial iot hands-on: DESFire EV2 card preparation, SE050 trust provisioning (with keys) and authentication of card with current installed SE050.
記事全体を表示
This porting guide is for FRDM-K82F, and it can also be used for any other platform supported by KSDK 2.2. The released NXPNCI-KDS_Example_KSDK2.2 is based on FRDM-K64F, so before porting, we need to configure and download KSDK 2.2 for FRDM-K82F. Please make sure you have selected Kinetis Design Studio before downloading. After downloading, extract the package to some folder like below: and change PROJECT_KSDK_PATH to this folder: Change project settings as below: Remove all files in the folder of drivers, and import new source files as below: and similar procedure for "startup" folder and "utilities" folder: Replace the source files in board folder with the files from some ksdk demo like hello_world: FRDM-K82F uses PTC3 for NCI_IRQ pin, PTC9 for NCI_VEN pin, and PTA1 and PTA2(I2C3) as the I2C interface. so add definition in board.c and modify BOARD_InitPins() as below: Change linker settings: -Build -Debug settings -Test Result:
記事全体を表示
The demonstration aims at how to protect the NDEF messages in the NTAG, here we use OM5569-NT322ER | NTAG I2C plus Explorer Kit + reader | NXP  as this dev kit contains NTAG as well as the NFC reader. The NTAG I2C plus has the unprotected memory starting from page 04h of sector 0, and NDEF messages are stored there. Referring to 8.3.11 of the data sheet, AUTH0 specifies the starting page to be protected, ACCESS[NFC_PROT] enables read&write password protection from NFC interface, PWD and PACK are for password configuration, but before changing any of above , you have to do a password authentication as below: Then you may select sector 0 and read the contents starting from E3h. Here FFh is the default value for AUTH0.  Now you may change the AUTH0,ACCESS[NFC_PROT] , PWD and PACK as you wish, for example, something like below: read the data from E3h to E6h and change the corresponding bytes in one write. The video shows how to read the NDEF message under password protection.  
記事全体を表示
SPIM module is one of the master interfaces provided by PN7462 , which is a 32-bit ARM Cortex-M0-based NFC microcontroller, and users may use this interface to connect with up to two SPI slave devices. The NFC reader library provides SPIM driver code in phHal/phhalSPIM, and users may directly use the following APIs in their application to implement simple SPI transaction, just like what is done  in the demo of "PN7462AU_ex_phExHif". While this demo has limitation with some SPI nor flash devices, which need a write-read operation in one NSS session, for example, the SPI nor flash device on OM27462 as below: Please note to solder R202 and connect it to 3V3 to make sure nHold pin has pull-up out of POR. The following is one of the command sets this device supports: This command contains 1 write(9F) followed by 3 read operations in one NSS session, but if you implement it with phhalSPIM_Transmit() and phhalSPIM_Receive() as below: status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 2, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, data_length, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);" You will have the following result: expected: NSS   \__________________________/ MOSI     CMD A7-A0 MISO                            DATA       actual:                         NSS   \____________||______________/ MOSI     CMD A7-A0 MISO                           DATA so the pulse between the write and read is the problem, and here we have to handle the NSS line manually, with the help of NSS_VAL and NSS_CONTROL bits in SPIM_CONFIG_REG. so the code should be like this:   Assert NSS   status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 2, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, data_length, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);"   De-assert NSS The NSS line assert and de-assert function can be implemented with register bit level APIs, just like below:             PH_REG_SET_BIT(SPIM_CONFIG_REG, NSS_VAL);//de-assert NSS             PH_REG_SET_BIT(SPIM_CONFIG_REG, NSS_CTRL);             PH_REG_CLEAR_BIT(SPIM_CONFIG_REG, NSS_VAL);//assert NSS Please also include the following header files in your application code. #include "ph_Reg.h" #include "PN7462AU/PN7462AU_spim.h" Please notice that phhalSPIM_Transmit() and phhalSPIM_Receive() are Rom based function, which clear NSS_CTRL bit by default. We can not change ROM API's behave but fortunately we have phhalSPIM_TransmitContinue() and phhalSPIM_ReceiveContinue() instead. so the final solution will be like below: Assert NSS   status = phhalSPIM_TransmitContinue(1, cmd_buf);    status = phhalSPIM_ReceiveContinue(3, dst);   De-assert NSS This doesn't mean phhalSPIM_Transmit() and phhalSPIM_Receive() are useless, because they can also help up to configure the SPI master interface, if you don't want to use register bit level API to initial the SPIM module manually. Please note to use 1 byte for write/read length to make these two functions work properly. so the whole pseudo code is like below: phhalSPIM_Init(PH_HW_SPIM_TIMEOUT) ; phhalSPIM_Configure(PH_HW_SPIM_SLAVE, PH_HW_SPIM_MSB_FIRST,                 \                                     PH_HW_SPIM_MODE, PH_HW_SPIM_BAUDRATE,  \                                     PH_HW_SPIM_NSSPULSE, PH_HW_SPIM_NSSPOL) ; status = phhalSPIM_Transmit(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_APPEND_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 1, cmd_buf, PH_EXHIF_HW_SPIM_CRC_OFFSET);    status = phhalSPIM_Receive(PH_EXHIF_HW_SPIM_SLAVE, PH_EXHIF_HW_SPIM_INIT_CRC, PH_EXHIF_HW_SPIM_CRC_INIT, 1, dst, PH_EXHIF_HW_SPIM_CRC_OFFSET);" Assert NSS   status = phhalSPIM_TransmitContinue(1, cmd_buf);    status = phhalSPIM_ReceiveContinue(3, dst);   De-assert NSS The following steps show how to create a new project based on NFC reader library, please refer to https://www.nxp.com/docs/en/user-guide/UM10883.pdf  on how to import the NFC reader library. 1. Create a new project after importing the NFC reader library. 2. if you installed PN7462 support package, you will see this: 3. add a link to NFC reader lib: 4. add path and enable NFC reader lib in the project: 5. delete cr_startup.c and create the main code as well as the header file: 6. Build result: 7.Debug result: To fetch the ready demo, please submit a private ticket via the guide of https://community.nxp.com/docs/DOC-329745 . Hope that helps, Best regards, Kan
記事全体を表示
The NXPNCI-KDS_Example for the PN7120/PN7150 Arduino interface boards available in NXP webpage at the time of publishing this document includes a project compatible with KSDK v2.0 for FRDM-K64F platform. With the latest KSDK v2.1 some changes in the drivers along with the later FreeRTOS v9.0.0 make the build process fail when following the instructions in the application note AN11845 NXP NCI KDS Example due to incompatibilities. Meanwhile until the project in NXP webpage is updated there is a temporary project attached to this document fixed to work with KSDK v2.1. The steps to build this project are the same as explained in the appnote, summarized below: - Download and install KSDK v2.1 for FRDM-K64F using MCUXpresso SDK online builder: Welcome to MCUXpresso | MCUXpresso Config Tools  Create a new workspace in KDS IDE. Import the "NXPNCI-KDS_Example_KSDK2.1" project from the archive file. Update the PROJECT_KSDK_PATH build variable according to the installation path of KSDK v2.1. Build the project. For more details please refer to the application note AN11845. Regards! Jorge Gonzalez
記事全体を表示
DISCLAIMER APPLICABLE TO THIS DOCUMENT CONTENTS:   This post contains a guide of how to use LPC55S69 demoboard with other NXP demoboards to demonstrate Access control using NFC, one embedded secure element and an MCU (see picture below). A ready to use package including preparation of a secure element, and of a MIFARE DESFire EV2 card can be used as 3-step authentication example using symmetric AES keys; a session key will be generated inside SE050 which will be exported to LPC55S69 which will handle contactless communication thru CLRC663 plus frontend.   This document is structured as follows: Hardware Requirements: Following hardware is required to run the project: LPC55S69-EVK development board. OM-SE050ARD development board. CLEV6630B board or BLE-NFC-V2 board. 1. Overview of LPC55S69-EVK: The LPCXpresso55S69 development board provides the ideal platform for evaluation of and development with the LPC55S6x MCU based on the Arm® Cortex®-M33 architecture. The board includes a high performance onboard debug probe, audio subsystem and accelerometer, with several options for adding off-the-shelf add-on boards for networking, sensors, displays and other interfaces. The LPCXpresso55S69 is fully supported by the MCUXpresso suite of tools, which provides device drivers, middleware and examples to allow rapid development, plus configuration tools and an optional free IDE. MCUXpresso software is compatible with tools from popular tool vendors such as Arm and IAR, and the LPCXpresso55S69 may also be used with the popular debug probes available from SEGGER and P&E Micro.   2. Overview of OM-SE050ARD demoboard: The OM-SE050ARD is the flexible and easy-to-use development kit for the EdgeLock SE050 Plug & Trust product family. It can be used in various ways for example via the Arduino interface compatible to any board featuring an Arduino compatible header, including many i.MX, LPC and Kinetis boards, or via a direct I 2 C connection. This kit allows evaluation of the SE050 product family features and simplifies the development of secure IoT applications. More information can be found in the respective Application Note AN12395.   2.1 Connections between OM-SE050ARD and LPC55S69 EVK   OM-SE050ARD LPC55S69 (Conn.# - Pin #) Port Function Name SE_SDA (J22-1) P24-6 also P17-3 PIO1_21 FC4_I2C_SDA_ARD SE_SCL (J22-4) P24-5 also P17-1 PIO1_20 FC4_I2C_SCL_ARD +5V_PC (J22-2)     VDD_TARGET GND (J22-3)     GND 2.2 Jumper settings on OM-SE050ARD to connect it to LPC55S69 EVK Connect SE050 to LPC55S Arduino stackable headers and change jumper J14 as: This connects SE_VDD directly to 3V3 and bypasses enable signal. This is required because enable pin on LPC55S coincides with Silex-2401 SPI pins so we cannot use SE_EN signal to drive SE_VDD.   3. Overview of NFC Front end boards working with LPC55S69 EVK board for this example:   3.1 BLE-NFC-V2: It is easier to use the BLE-NFC-V2 board since less changes have to made on the board as compared to the CLEV6630B board. The following figure shows the pin mapping between the two boards. It is advisable to add a pull-up resistor (4k7 to VCC) on CLRC663 plus signal IRQ.   3.2 CLEV6630B board: The CLEV6630B board consists of CLRC663 plus (NFC frontend) connected by default to an LPC1769 µC via SPI. However, the board is made in such a way that the LPC1769 MCU can be bypassed to connect to an external MCU (in our case the LPC55S69) easily. For doing so: Six resistors from the board need to be removed. These are highlighted in red in the Figure 1: Use the SPI pin connectors available on the left-hand side, on the board edge to connect to external MCU (LPC55S69 in this case) Solder jumper wires onto the following pins of CLEV6630B Board:  GND IRQ CLRC_NRST SSEL MOSI MISO SCK IF0 IF1          The CLEV6630B is shown in Figure 2 after the required changes have been made to it (Removal of resistors and soldering of wires).   Now connect the two boards as follows: Signal function LPC55S69 (conn. # - Pin #) Port CLEV6630B MOSI P17-10 PIO0_20 MOSI MISO P17-12 PIO0_19 MISO SPI SCK P17-14 PIO0_21 SCK SPI CSEL P17-6 PIO1_11 SSEL RESET P18-11 PIO0_15 CLRCL_NRST IRQ P18-3 PIO1_10 IRQ GND P17-7   GND  As final touch to this demonstrator, one LCD display will be added in order to show "access control" check result when approaching a MIFARE DESFire EV2 card to the Reader antenna, without the use of a computer console. Connection between LPC55S69 board and LCD Display:   TFT LPC55S69 (Jumper # - Pin #) Port      SPI_CLK D13 (P17-9) PIO1_2      SPI_MISO D12 (P17-11) PIO1_3      SPI_MOSI D11 (P17-13) PIO0_26      SPI_CS_TFT D10 (P17-15) PIO1_1      GPIO_LCD_BL D9 (P17-17) PIO1_5      GPIO_LCD_DC D7 (P18-1) PIO1_9 5V 5V   GND GND     Click here to order 2.8 inch TFT Display from Waveshare: P/N: 2.8 inch TFT Touch Shield Brand       4. Running "Secure Access to Industrial IOT demo" at LPC55S69:   If this is the first time you’re using LPC55S69-EVK board, follow the getting started guide first à  LPC55S69-EVK | NXP . Make sure to install the SDK package for LPC55S69-EVKboard which is required for the project below to run. Download the ‘demobinaries.zip' package which you will find attached to this post. This zip file contains 2 bin files: ex_prepareCard.bin - upload this binary file to LPC55S69 when you need to prepare a MIFARE DESFire EV2 card with suitable application and AES keys used for demonstrator. Upload bin file to LPC55S69 by using MCUxpresso. Just place a virgin card on top of Reader antenna, and reset MCU board by clicking on "RESET KEY" push button. ex_prepareSe050.bin - upload this binary file to LPC55S69 when you need to prepare a new SE050 with suitable AES keys to be used in this demo. Just  upload binary using MCUxpresso; connect a virgin OM-SE050ARD on LPC55S69 arduino connectors, connect micro USB connector to MCU board, and reset MCU by clicking "RESET KEY". After steps 2.1 and 2.2 have been done to obtain preparation of one Secure element as well as preparation of one MIFARE DESFire EV2 card, then upload the next bin file to LPC55S69 using MCUxpresso: ex_Ev2Auth_se05x.bin Alternatively, you can import the whole project in your MCUxpresso environment. Download the file EmbeddedWorld2019DemoLatest.zip at end of this page. Import this zip file project in MCUxpresso environment Now that the package has been imported to the MCUXpresso IDE (via drag and drop), click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started, click on the run icon to run the code: PICTURE TO BE UPDATED MCUXPRESSO PICTURE TO BE UPDATED The project should be running now. The project contains a closed loop that tries to check presence of a card on top of Reader. Here is how the output looks like in LCD Display. Press the button reset, and you will see the text "Secure Access to Industrial IOT demo 2019" PICTURE TO BE UPDATED Then press the button "Wake-up". Afterwards NFC reader will enter in a loop in which he will look for a card to authenticate. If there are no cards, he will soon show the red allert with text "Access denied" Bring any NFC card near the frontend’s antenna (or in presence of no card) LCD display will show a message in RED "ACCESS DENIED". PICTURE TO BE UPDATED Only in case the "prepared DESFire EV2" card is placed on top of reader, in the picture below, we can see message in GREEN "ACCESS GRANTED" PICTURE TO BE UPDATED.     Available Resources: Porting NFC Reader Library to i.MX RT1050. (Detailed Description of porting) https://community.nxp.com/docs/DOC-341843 LPC55S69 https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/lpc-cortex-m-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK BLE-NFC-V2 https://www.nxp.com/products/identification-security/rfid/nfc-hf/nfc-readers/clrc663-iplus-i-and-qn902x-nfc-bluetooth-low-energy-solution-for-consumer-applications:BLE-NFC CLEV6630B Product Information|NXP  SE050: www.nxp.com/SE050
記事全体を表示
This post contains a step by step guide of how to use PN7150 with i.MX RT1060. This document is structured as follows: Overview of PN7150 PN7150 is a Plug-and-Play all-in-one NFC solution for easy integration into any OS environment like Linux and Android, reducing Bill of Material (BoM) size and cost. The embedded Arm® Cortex®-M0 microcontroller core is loaded with the integrated firmware, simplifying the implementation as all the NFC real-time constraints, protocols and the device discovery (polling loop) are processed internally. In few NCI commands, the host SW can configure the PN7150 to notify for card or peer detection and start communicating with them. It has the following salient features: Full NFC forum compliancy with small form factor antenna Embedded NFC firmware providing all NFC protocols as pre-integrated feature Direct connection to the main host or microcontroller, by I2C-bus physical and NCI protocol Ultra-low power consumption in polling loop mode Highly efficient integrated power management unit (PMU) allowing direct supply from a Battery Hardware Requirements      1. OM5578/PN7150ARD      2. i.MX RT1060 EVK Evaluation Board + usb micro cable        Using PN7150 with i.MX RT1060 Hardware Connections The hardware connections are simple. Both the EVKB-IMXRT1060 board and OM5578/PN7150ARD board have an Arduino interface. So, mount the PN7150ARD board with male Arduino connector onto the female Arduino connector of the EVKB-IMXRT1060 board.  Running the Demo If this is the first time you’re using EVK-MIMXRT1060 board, follow the getting started guide first: i.MX RT1060 Evaluation Kit | NXP . Make sure to install the SDK package for EVK-MIMXRT1060 board which is required for the project to run.   Download the ‘evkbimxrt1060_PN7150’ package which you will find attached to this post. Drag and drop the downloaded package to the “Project Explorer” tab of your MCUXpresso IDE workspace (If you don’t have MCUXpresso, it can be downloaded for free from here: https://www.nxp.com/support/developer-resources/software-development-tools/mcuxpresso-software-and-tools/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE Now that the package has been imported to the MCUXpresso IDE (via drag and drop), click on Debug icon from the Quickstart panel to begin a debug session. Once the debug session has started, click on the run icon to run the code: After step 3, the project should be running now. The project contains basic discovery loop functionality. Here is how the output looks in the console tab on MCUXpresso: Bring any NFC card near the PN7150 board’s antenna and the output console will show the detection and type of the card. For example, in the picture below, we can see that type 4 card was detected: Available Resources AN11990 NXP-NCI MCUXpresso example document. (https://www.nxp.com/docs/en/application-note/AN11990.pdf) The example project explained in this project was ported to i.MX RT1060 using section 5.3 and 6 of the above mentioned document. PN7150 datasheet (https://www.nxp.com/docs/en/data-sheet/PN7150.pdf) PN7150 User Manual (https://www.nxp.com/docs/en/user-guide/UM10936.pdf) PN7150 NFC Controller SBC Kit User Manual  (https://www.nxp.com/docs/en/user-guide/UM10935.pdf)
記事全体を表示
The latest NFC reader library supports lpc1769 which is a cortex M3 controller with LPCopen lib supports, so in theory , it should supports other controllers supported by LPCopen, but we have to test this, so we choose , for example, lpc11u37, a cortex M0 based controller for this porting. Platform for this porting: LPC11u37h-Xpresso Rev A: CLRC663 plus based CLEV663B Blueboard 3.0. Please refer to Prepare CLEV663B board for NFC reader library porting  for details. They are connected via LPCXpresso ports. Now we may start the porting, the IDE we use in this porting is MCUXpresso 10.1.1 1. Download and import the latest NFC reader library for CLEV6630B, as it supports CLRC663 plus. For how to import the project, please refer to https://www.nxp.com/docs/en/application-note/AN11211.pdf . 2. Download LPCopen for LPC11u37h and import it as well. 3. Now we may choose some demo in the NFC reader library, for example, the NfcrdlibEx1_BasicDiscoveryLoop, and create new build configuration for lpc11u37h. 4.Select the correct MCU 5.Modify build settings Here we find LPC1769RC663 is defined, so we have to find what is related with this definition in the code and change it/them. Fortunately they are not too many. you may find they are just related with board header file including or something like that, so it is not difficult to modify them. 6. Add new header file for the new board definition 7. add the new board definition 8. As we now use LPCopen lib for LPC11u37h instead, so we have to change the including path. As LPC11u37h is cortex M3 based, so we have to setup FreeRTOS for M0 support: and add the source code for building: 9.Change the link libraries and including path 10.Set the correct ref projects to use LPCopen for LPC11u37h. 11. Some changes in LPCopen library: 1)enable semihosting debug 2) add startup source code for the demo, this C file can be reused/imported from the some lpcopen project. 12. After the above steps, we still have to change the source code in DAL: You know , due to different version of LPCopen library,  some function definition might be changed, and different LPCXpresso boards has different pin connection to the LPCXpresso ports, so it is recommended checking the board schematics and the examples in lpcopen project , find the proper function calls to implement the source codes in the DAL folder. When you finished , the porting is done. 13. As the final image size is greater than 128K, we have enable optimization for size. 14.Demo test ok. Now , we know lpc11u37 can be supported by the latest NFC reader library, so the porting should also be applied for other Cortex M0 controllers, and it is recommended the controller with large internal flash size, better greater than 128K, but anyway, in this porting, I didn't enable the size optimization for LPCopen library, so there might be possibility to have a smaller size image at last...
記事全体を表示