NFC Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NFC Knowledge Base

Discussions

Sort by:
  Some customers are trying to update the user firmware on PN7642 through host interface and using “DownloadLibEx1” demo,  and they are using SFWUMaker to create .esfwu file from .bin followed the readme file but failed to do a firmware update. Here is a step-by-step guide to do it. I will use the SDK led blinky demo,  and generate an Esfwu file , and program it into PN7642 board with LPC5516 host.  Led blinky demo is in PN7642_MCUXpresso_SDK_02-15-00_PUB.  You can download it from PN7642 product page.  Single-Chip Solution with High-Performance NFC Reader, Customizable MCU and Security Toolbox | NXP Semiconductors Step 1: compile pnev7642fama_led_blinky demo Please make sure the flash size is 180KB.  By default,  the output flash size is 180KB with MCUXpresso IDE.     Step 2: Bin file generation The binary (.bin) file is not generated by default, we can do it manually by doing following: Build your target application Open the debug/release folder in MCUXpresso Right-click on the *.axf file Choose 'Binary Utilities' → 'Create binary' in the menu The .bin should appear   Step 3: Make an ESFWU file To convert a bin file to an ESFWU file, we can use the ESFWU Maker Utility (sw810311). It can be downloaded from PN7642 product page. It is a secure file, and you need to have an active NDA to get it.  To run this utility, the toml file is very important.  You need to change the output name and binary name according to your project ,  and  you need to use the correct aes_root_key. For other parameters, we left them unchanged.   3.1   change the output name and binary name   3.2 set the correct aes_root_key The application flashed via SWD is a bin file and NOT encrypted neither is it flashed with our bootloader. The .esfwu file via host interface is encrypted and flashed by our own bootloader.  The keys have to be valid, else the bootloader will not be able to decrypt the received file. Please make sure we are using the right keys to create the user application firmware.  This is crucial and without it, it won’t work anyways. The default keys are mentioned in the datasheet as transport keys. See below picture.  But it is highly recommended to provision your own keys!  Please have a look at the secure key mode application note for further information on that.        If you are not sure whether you have provisioned the root key or not, you can check the SKM state by running SKM demo. if the root key is provisioned, please use the provisioned root key.  From below picture, I can see that the app_root_key is  not provisioned, so I use the default transport key.     3.3  use the EsfwuMaker command to generate the Esfwu file.     After this command, we can get the esfwu file.       Step 4: Secure firmware download   We use the firmware download example to update the PN7642 firmware.  It is in the host software package, it  holds examples to be used with LPC55S16 and MCUXpresso, to interact with the PN7642. The LPC55S16 Host Software can be download from PN7642 product page. LPC55S16 Host Software Version 02.01.00 (nxp.com) To run the demo, we need to edit the firmware location.  In file DownloadLibEx1.c,  about line 60.       Please set the correct hardware settings as below.  we have to stack the PNEV7642A Rev-B development board on top of the LPC55S16-EVK board. Align Pin.1 of J36 of the PNEV7642A Rev-B development board with Pin.1 of J9 of the LPC55 board. The last 4 pins, 17 - 20, of J12 of the LPC board are not connected. As well as pin 1-4 of J10 stay unconnected, as below picture shows.       Run the firmware download Demo with LPC55s16,  see the log output below.  Choose option “6” to update your application firmware. The update may take a while.  At the end, a successful update is indicated by the prompt of “Successful firmware upload ”.         To verify it is successful, we can run this demo, please keep J65 open.  you will see the D7 (RED LED) blinky (0.5 HZ rate). If you need the pnev7642fama_led_blinky.esfwu, please let me know.    
View full article
Using an alternative clock source to set up PN7462's contact interface clock , so that we have more options of the clock frequency.
View full article
A Quick Solution for link issue of "missing --end-group" when you use the latest MCUXpresso IDE to compile the NFC reader library projects.
View full article
Example sends Wi-Fi credentials from phone to IoT device, so it can join the Wi-Fi network.  Using: iOS and Android phone with NXP's TagWriter app PN7462 NFC Reader device on PNEV7462B eval board, part of kit OM27462CDK Host Card Emulation mode example based on NfcrdlibEx8_HCE_T4T example from NFC Reader Library Example will also print out other NDEF messages received.  NDEF formats include: Contacts / Business Cards URL link Wi-Fi network and credentials Bluetooth MAC address for pairing Email address Phone number Geo location Launch application on host OS Plain text SMS (sorry the audio is horrible)
View full article
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
View full article
This document provides a step by step guide of how to use the CLRC663 plus with i.MX RT1050. For this purpose, we need to port the NFC Reader Library to i.MX RT1050.  There are two zip files attached to this document: 1. "NFCReaderLibrary_IMXRT1050_Porting Guide +DAL_IMXRT1050_BLE-NFC-V2.zip" : This folder is pre-configured for those who want to use BLE-NFC-v2 board with i.MX RT1050. 2. "NFCReaderLibrary_IMXRT1050_Porting Guide +DAL_IMXRT1050_CLEV6630B.zip" : This folder is pre-configured for those who want to use CLEV6630B board with i.MX RT1050. A video describing how to use i.MX RT1050 with CLRC663 Plus Family is available by clicking this link (Using i.MX RT 1050 with CLRC663 plus family |NXP ) as well. 
View full article
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
View full article
As NFC reader library 5.12 also supports PN5180, switching the NFC frontend from CLRC663 to PN5180 is quite easy based on previous porting. The porting also includes the hardware settings and software modification. Hardware Setup for porting: a) Remove resistors on PNEV5180B to disconnect the onboard lpc1769 from PN5180, following steps on page 16 of https://www.nxp.com/docs/en/application-note/AN11908.pdf  b) Connect LPCXpresso board for LPC11U37 with PNEV5180 as below: Software Modification for porting: 1. Make a copy of Board_Lpc11u37Rc663.h , and change its name to "Board_Lpc11u37Pn5180.h", and import it into the DAL/boards folder. 2.Change the source code in the header file as below: 3. Add two more pins' definition and configuration for BUSY and DWL pins of PN5180, and new configuration for reset pin. and modify the reset logic: 4.Change the IRQ interrupt trigger type to rising edge. 5.Include this header file in BoardSelection.h 6.Add this new configuration in ph_NxpBuild_App.h 7.Add this new configuration in phApp_Init.h 8.Add this new configuration in ph_NxpBuild_Platform.h 9.Add this new configuration in Settings. 10.Building result: Testing result:
View full article
Based on NFC reader library porting guide for LPC11u37h(Ver 5.12) ,We have a partial ported NFC reader library like below: Now, it is time to port other demos in this project. You may choose any demo, but here NfcrdlibEx2_AdvancedDiscoveryLoop is selected. and similar with before, the first step is creating a new build configuration: then in the project references, choose the LPCopen library for LPC11u37 instead. Change the MCU settings: Change the build settings: Change FreeRTOS portable to cortex M0: Search "PHDRIVER_LPC1769RC663_BOARD" in the source code of "NfcrdlibEx2_AdvancedDiscoveryLoop" project, and you may simply replace it with "PHDRIVER_LPC11U37RC663_BOARD", and there are only two places needs to be fixed. Search "PHDRIVER_LPC1769" in the source code of "NfcrdlibEx2_AdvancedDiscoveryLoop" project, and you may simply replace it with "PHDRIVER_LPC11U37". Most changes are in phApp_Init.c. Also please don't forget to enable optimization for size. Building result: Demo testing result:
View full article
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...
View full article
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.
View full article
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
View full article
The NFC reader library is supporting multiple frontends. For a customer this might become a more difficult to use, if only the part for one of the frontend chips is needed. To enhance the readability and usability, you can remove the support for not used reader ICs by simply removing the folders below NxpRdLib/comps/phhalHw/src. For instance: if you only want to use the RC663, you could simply delete the folders Pn5180, Rc523. The result would be a library that only supports RC663. This short screen recording shows the steps to reduce the number of supported Frontends.
View full article
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
View full article