NXP Semiconductors OM27642 Скачать руководство пользователя страница 24

 

 

NXP Semiconductors 

UM11038 

 

OM27642 Smart Lock KIT 

UM11038 

All information provided in this document is subject to legal disclaimers. 

© NXP B.V. 2018. All rights reserved. 

User manual                                                                               
COMPANY PUBLIC 

Rev. 1.1 — 11 October 2018                                                                       

407611 

24 of 38 

12.  Structure of the PN Firmware 

PN firmware is split into two tasks: 
1)  CLIF – RFID task (implemented in 

smart_lock_clif.c

2)  HIF – UART task (implemented in 

smart_lock_hif.c

 
The tasks are created in the 

appMain

 function in 

src/smart_lock.c

.  

Common code for retrieving the token and door opening is 

smart_

lock_token.c

.  

12.1  Token retrieval 

Token retrieval is done by 

smart_lock_retrive_token

 

function from 

s

mart_lock_token.c

. The 

function uses 

phalMfdf

 

functions of the 

NxpRdLib

 to retrieve the token and is independent of 

the underlying implementation of 

PAL

 and 

HAL

 layers.  

 
Before 

phalMfdf

 

functions can be used one must instantiate and configure the 

NxpRdLib

 stack. 

This action is performed in 

smart_lock_init_mfdf

 

function, which takes pointer to 

PAL

 and 

HAL

 

layers. 
 
In case you would like to change the card type from 

MIFARE DESFire

 to some other card from 

MIFARE family

 these two functions (

smart_lock_init_mfdf

 

and 

smart_lock_retrive_token

should be replaced. 
 
After the token is retrieved it is passed to 

smart_lock_process_token

 

function which in turn 

validates its content and perform the correct action (error/door opening).  
 

12.2  Task CLIF 

Task CLIF is implemented in the 

smart_lock_task_clif.c.

 

It uses standard 

NxpRdLib

 to initialize 

the RFID reader chip and set up the correct 

NxpRdLib

 

stack. 

 
The task uses a timer to schedule itself. When timer lapses it initializes the discovery loop to 
search and activate 

ISO14443 Type A

 cards (with 

smart_lock_clif_init_discovery_loop

) and run 

the discovery loop. If valid target gets activated the correct 

PAL

 needs to be initialize and then 

we can perform the token retrieval. 
 
The poll loop is performed a finite number of times. Number of tries and time in-between can 
be set in 

smart_lock_cfg.h

 

by setting:

 

 

SMART_LOCK_CFG_TIMER_WAKE_UP_COUNT – how many times we should poll 

 

SMART_LOCK_CFG_TIMER_WAKE_UP –time in-between polls

 

 
 

4. 

Task CLIF NxpRdLib component stack for activation: 

phhalHw_Nfc_Ic_DataParams_t 
phacDiscLoop_Sw_DataParams_t 

phpalI14443p3a_Sw_DataParams_t 

phpalI14443p4a_Sw_DataParams_t 
phpalI14443p4_Sw_DataParams_t 

Содержание OM27642

Страница 1: ...ds OM27462NBR Smart Lock KIT User manual Abstract This document describes the content the hardware implementation and the usage of the Android application as well as the access token structure and pro...

Страница 2: ...ject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 2 of 38 Contact information For more information please visit http www nxp com Revi...

Страница 3: ...sts of two PCBs and incorporate the following main IC components PN7462AU all in one full NFC application controller with freely programmable Controller PN from now on QN9020 for Bluetooth Low Energy...

Страница 4: ...his document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 4 of 38 2 Smart Lock KIT Package Content Fig 1 OM27462NBR Smart...

Страница 5: ...rd contains all necessary blocking capacitors XTAL 2 status LEDs and the antenna EMC filter The Core module is designed for general purpose use therefore all power supply options e g internal external...

Страница 6: ...2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 6 of 38 3 1 Smart lock system block diagram Fig 3 Main building blocks Fig 4 OM27462NBR NFC Bluetooth Low Energy Modu...

Страница 7: ...t Lock KIT UM11038 All information provided in this document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 7 of 38 4 Schema...

Страница 8: ...UM11038 All information provided in this document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 8 of 38 4 1 Base board sche...

Страница 9: ...11038 All information provided in this document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 9 of 38 4 2 Core Module schem...

Страница 10: ...ng of the Smart Lock main PCB is shown below The EMC filter is part of the stack on core Module The base board consists of the matching circuit with the damping resistors and the serial and parallel m...

Страница 11: ...rdware module 1 Connect the Touch sensor plate as shown in fig 1 2 Connect a DC power source 2V 3 3V to the pins labeled BAT see fig 1 6 1 1 Smart Lock power connection As the Smart Lock is intended t...

Страница 12: ...ile active 2 Present Room 201 ACCESS Guest 1 card or Room 201 ACCESS Guest 1 re issued card in close proximity of the module If the card is valid and accepted LED will light up green and the buzzer wi...

Страница 13: ...isclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 13 of 38 7 2 Operating the Smart Lock using the mobile Smart Lock App Download the NXP SMARTLOCK a...

Страница 14: ...art Lock KIT UM11038 All information provided in this document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 14 of 38 Fig 1...

Страница 15: ...r mode any time by interrupt on GPIO when PN requires the current time from QNs RTC to check the token 8 2 Interaction between PN and QN when token is delivered over RFID When the token is delivered o...

Страница 16: ...00 bps and data format 8N1 The GPIO lines are used to power the PN in case a Bluetooth Low Energy client connects or to wake up QN in case a card or phone is presented to the PN via NFC The UART is us...

Страница 17: ...exist to start the communication between QN and PN 10 1 1 NFC Transaction In this use case the PN is powered up either by the proximity switch or the micro switch In both cases the PN has to wake up t...

Страница 18: ...is use case QN will power PN using the BLE_OUT line after establishing the Bluetooth Low Energy connection After power on the PN will start the communication by triggering the QN GPIO interrupt using...

Страница 19: ...le C PN sends APDU command to QN QN forwards data to the Bluetooth Low Energy client A QN responds with response APDU T PN sets RTC in QN N PN sets a new Bluetooth Low Energy device name in QN D PN in...

Страница 20: ...e PN TASK which will handle the event in a synchronous way Note In the download area only the binary files are provided 11 1 src app pn app_pn_task c The PN TASK has the overall responsibility to take...

Страница 21: ...sending multiple messages allow_wakeup 0 ATTENTION To be sure that the QN OS Kernel is active the library function sw_wakeup_ble_hw must be called Otherwise the sent message could be processed only af...

Страница 22: ...uetooth Low Energy client After a Bluetooth Low Energy disconnect sequence is completed trigger via Bluetooth Low Energy client or smartlock the PN_TASK receives a PN_BLE_DISC_IND message and the hand...

Страница 23: ...advertise cycle again 11 7 Data exchange 11 7 1 1 Send data Data exchange state is entered by calling Smart Lock _uart_wait_for_cmd to set up the correct callbacks on UART to wait for command from PN...

Страница 24: ...FARE DESFire to some other card from MIFARE family these two functions smart_lock_init_mfdf and smart_lock_retrive_token should be replaced After the token is retrieved it is passed to smart_lock_proc...

Страница 25: ...ams_t phalMfdf_Sw_DataParams_t phKeyStore_Sw_DataParams_t phCryptoSym_Sw_DataParams_t phCryptoRng_Sw_DataParams_t 12 3 2 phbalReg_Smart Lock _DataParams_t phbalReg_Smart Lock _DataParams_t component c...

Страница 26: ...ersion Purpose OM27462NBR Smart Lock KIT 1 2 or higher Demonstrator board OM13054 LPC Link 2 1 0 Standalone debug adaptor LPCXpresso IDE 8 0 0 or higher Development IDE for PN LPCXpresso PN7462AU plug...

Страница 27: ...ort the Smartlock PN Project via File Import Existing Project into Workspace Build the Project via Project Build All Additional compiler may need to be installed based on your environment Connect the...

Страница 28: ...ild Target Connect the LPC Link2 and the Smartlock QN SWD Pins with the flashing cable to the correct pins as shown in Fig 18 Make sure the JP2 jumper on the LPC Link 2 is set and the Battery is conne...

Страница 29: ...ved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 29 of 38 A new Window should open and show the SW Device in the List Device Name should be ARM CoreSight SW DP as in Fig 20 Fig 20 Configu...

Страница 30: ...rovided in this document is subject to legal disclaimers NXP B V 2018 All rights reserved User manual COMPANY PUBLIC Rev 1 1 11 October 2018 407611 30 of 38 Fig 21 Configure Utilities in Keil Save the...

Страница 31: ...it is also possible to flash the QN via a serial port Remove the PN Core module and connect your serial port with the QN as shown in the Fig 22 Fig 22 Connections for serial flashing Open the QBlue I...

Страница 32: ...Crypto Mode AES DF Name 07060504030201 HEX 3 keys Key 0 app Master key Diversified Key needed Non diversified Key 00000000000000000000000000000001 Key 1 Read key for File id 00 Diversified key needed...

Страница 33: ...bytes 14 3 Standard Data file content 14 3 1 Token format 14 3 2 Token verification process 1 Validate RevToken chose appropriate processing If revision is below current Rev in lock Token isn t valid...

Страница 34: ...siderations At present the Bluetooth Low Energy is operating in polling mode and advertises every 600ms In order to further reduce the average power consumption one might consider changing the hardwar...

Страница 35: ...ponsibility to determine whether the NXP Semiconductors product is suitable and fit for the customer s applications and products planned as well as for the planned application and use of customer s th...

Страница 36: ...tooth The Bluetooth word mark and logos are registered trademarks owned by Bluetooth SIG Inc and any use of such marks by NXP Semiconductors is under license AMBA Arm Arm7 Arm7TDMI Arm9 Arm11 Artisan...

Страница 37: ...Energy Transaction 18 10 2 Data exchange 19 11 Structure of the QN Firmware 20 11 1 src app pn app_pn_task c 20 11 2 src driver pn_nfc c 21 11 3 Interaction with Bluetooth Low Energy Stack 22 11 4 Blu...

Страница 38: ...NXP B V 2018 All rights reserved For more information please visit http www nxp com Date of release 11 October 2018 407611 Document identifier UM11038 15 Power consumption figures 34 16 Power optimiza...

Отзывы: