logo资料库

PN544 NFC android 开发 NXP官方文档.pdf

第1页 / 共27页
第2页 / 共27页
第3页 / 共27页
第4页 / 共27页
第5页 / 共27页
第6页 / 共27页
第7页 / 共27页
第8页 / 共27页
资料共27页,剩余部分请下载后查看
Android2.3_NFC_Porting_Handbook 1 Scope The following handbook documents contain how to porting and enable the NFC feature based on existing Android2.3 operating system and few related introduction. And this documentation just for NXP NFC chipset. Handbook apply to Android2.3.1(Release: Dec 2010), Android2.3.3(Release: January 2011) , Android2.3.4(Release: April 2011) and Android2.3.5(Release: July 2011) ,between difference can reference Annex B For more information, please visit : http://www.nxp.com For this document issue, please send an email to : xiaohua.wang@nxp.com 2 Index Contents Page 1 Scope Index........................................................................................................................................................... 1 2 How to setup Android SDK Development Environment.................................................................................... 3 3 How to setup Android Platform Development Environment............................................................................. 4 3.1 Android platform development flow................................................................................................................. 4 3.2 Android driver debug flow................................................................................................................................. 4 4 PN544 I2C Driver-A................................................................................................................................................ 5 4.1 PN544&PN65N driver verify and debug flow................................................................................................... 5 4.2 *VEN Note............................................................................................................................................................ 6 5 Android NFC file structure description............................................................................................................... 7 6 Android NFC software stack.............................................................................................................................. 10 6.1 Android NFC software stack brief description.............................................................................................. 10 6.2 Android NFC software flow brief description................................................................................................ 11 7 Android APK ....................................................................................................................................................... 12 7.1 Android file structure description................................................................................................................... 13 7.2 Export APK file and install APK file................................................................................................................ 13 7.3 Install APK file from internet........................................................................................................................... 13 7.4 Make all of the out folder for a package......................................................................................................... 13 8 Android NFC Logs and configurations............................................................................................................. 14 9 PN544 I2C Driver-B.............................................................................................................................................. 15 9.1 PN544 IIC driver architecture.......................................................................................................................... 15 9.2 How to Setup and verify PN544 IIC driver...................................................................................................... 15 9.3 How to run the test code.................................................................................................................................. 16 9.4 Get board initialization refer code................................................................................................................... 16 10 How to verify UICC SE simulation feature...................................................................................................... 17 11 How to change the chipset register................................................................................................................. 18 11.1 Change register through scripts, For example............................................................................................ 18 11.2 Change register through Android system.................................................................................................... 18 12 Troubleshooting problem list.......................................................................................................................... 19 12.1 error [process com.android.nfc]................................................................................................................... 19 12.2 cannot find NFC enable option..................................................................................................................... 20 12.3 LibNfc:Get Stack capabilities........................................................................................................................ 21 12.4 Could not open libpn544.so........................................................................................................................... 22 12.5 How to modify pn544 module node limits................................................................................................... 23 12.6 Driver test code is ok, but when run the whole NFC stack was fail........................................................... 24 Annex A: Difference between Android 2.3 ...…................................................................................................ 25 Annex B: How to check NFC chip work ready…................................................................................................ 26 Annex C: Q&A….................................................................................................................................................... 27
3 Revision History Version V0.1 V0.2 V0.3 V0.4 Release date June 1, 2011 June 29, 2011 July 22, 2011 July 29, 2011 Comments Initial draft Verified NFC FW download, Tag R/W and P2P feature Finish NFC UICC SE card emulation verification Add How to change the chipset register  Just for NXP internal sharing  Unauthorized reference do not assume legal responsibility
Android2.3_NFC_Porting_Part1 How to setup Android SDK Development Environment Reference: http://developer.android.com/sdk/index.html Scope: This introduction of how to setup Android SDK 2.3.3 and configure Integration Development Environment based on eclipse Chief setups: A) Install Eclipse http://www.eclipse.org/downloads/ The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended. B) Install Java JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html jdk-6u25-windows-x64 C) Configure Android SDK (Release 11) I. Install Android SDK http://developer.android.com/sdk/index.html If you downloaded a .zip or .tgz package (instead of the SDK installer), unpack it to a safe location on your machine. By default, the SDK files are unpacked into a directory named android-sdk-.for example: android-sdk-windows If you downloaded the Windows installer (.exe file), run it now and it will check whether the proper Java SE Development Kit (JDK) is installed (installing it, if necessary), then install the SDK Tools into a default location (which you can modify). II. Update Android SDK API2.3.3 android-sdk-windows> SDK Manager> SDK Manager>setting…> HTTP proxy server: 165.114.0.36, http proxy port: 8080>install packages>update all … D) Install the ADT Plugin for Eclipse,(Android Development Tools) 0. Window > preference > search ‘network connection’ >select ‘manual’ HTTP proxy server: 165.114.0.36, http proxy port: 8080 1. Start Eclipse, then select Help > Install New Software.... 2. Click Add, in the top-right corner. 3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ 4. Click OK Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons). 5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next. 6. In the next window, you'll see a list of the tools to be downloaded. Click Next. 7. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. 8. When the installation completes, restart Eclipse. E) Android simulator show Window > Android SDK and AVD Manager>Virtual devices>News…>name: Android2.3.3 ,API level,512M > start…>launch F) Run the NFC application Eclipse >File >project…>Android>Android project >build target :Android2.3.3>select Create project from existing sample:NFCdemo>finish Package explorer>build path>add external archives…>add guava-r07.jar Package explorer> run as…>Android application Troubleshooting : a) In my workaround use the 64bit system and windows 7,when configure Android SDK need download and unpack .zip file, otherwise use the .exe always indicate cannot find JDK , b) Update Android SDK API2.3.3 necessary entry into install directory and run the SDK Manager, c) It’s ok when install the ADT after I have try few times for it, http://developer.android.com/resources/faq/troubleshooting.html#installeclipsecomponents
Android2.3_NFC_Porting_Part2 Android platform development flow Android driver debug flow Install AndroidHandsetUsbDriver_v1.0& android-sdk-windows(fastboot,ddms,adb) [Integrated]Put boot.img(kernel),system.img(apk) into board use adb [No Integrated]Put boot.img(kernel),system.img(apk) into board use adb Reset Android platform adb install -r F:\Nfc.apk (-r for force install) if want add new Just insmod ko and adb push app to /data then run application test [Capture application logs] : adb shell logcat [Capture kernel logs] : adb shell cat /proc/kmsg adb reboot bootloader fastboot flash boot C:\boot.img fastboot flash system C:\system.img fastboot flash userdata C:\userdata.img fastboot flash recovery C:\recovery.img fastboot reboot
Android2.3_NFC_Porting_Part3 PN544&PN65N driver verify and debug flow Get IIC,UART,SPI driver(Source code&lib) from NXP Make/install pn544_xx.ko module and coding application insmod pn544_xx.ko module then adb push application Start application Application sample Hardware reset chip (VEN*101) at least 10ms Send out HCI reset frame (05 f9 04 00 c3 e5) to NFC controller Waitting IRQ* pull up then entry into ISR ISR release semaphore, receive data(correct is 03 e6 17 a7) *IRQ Note please reference - 《pn544&pn65n_IRQ》
*VEN Note 3ms VEN reset standard timing: ○X VEN reset error timing: ○X VEN reset error timing: ○X VEN reset error timing: 10ms(>7ms)
Android2.3_NFC_Porting_Part4 Android NFC file structure description 1 、Frameworks .\frameworks\base\core\java\android\nfc APIs : package [android.nfc] http://developer.android.com/reference/android/nfc/package-summary.html package [android.nfc.tech] http://developer.android.com/reference/android/nfc/tech/package-summary.html
.\frameworks\base\nfc-extras Provides additional methods on an for Card Emulation .\frameworks\base\core\java\com\android\internal\nfc Internal classes or structs provide for android.nfc and android.nfc.tech 2 、NFC Stack .\external\libnfc-nxp Build out [libnfc.so and libnfc_ndef.so]
分享到:
收藏