NFC in Android Lollipop 5.0.0

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

NFC in Android Lollipop 5.0.0

ソリューションへジャンプ
4,329件の閲覧回数
anjalikkrishna
Contributor III

Hi all,

     I am using Android Lollipop 5.0.0 base code upon which I made kernel changes for NFC and the kernel part seems to fine since I m able to see the node created /dev/pn5xx. I referred the NXP NCI Android Porting Guidelines and manually did the changes like replacing the old externel/libnfc-nci with manually download externel/libnfc-nci. The compilation was successful. But the NFC is not enabled and I am getting the logcat messages as

E/NFC ( 1232): could not retrieve NFC service

This is the only print I m getting regarding NFC.The "service list" command also not listing out nfc service.

Since the patch is for Android 5.1.1 , will it work for 5.0.0.? 

What am I missing if the patch will work for 5.0.0 . Any idea?

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
2,717件の閲覧回数
jeremygeslin
NXP Employee
NXP Employee

Hi,

There is no patch delivery for Android 5.0.0. As Gary mentioned a backposrting of 5.1.1 ones is required there, but I understand you already did it.

If your are missing the NFC service I assume this is because you miss components in your build. Your device.mk should include the following packages:

# NFC packages

PRODUCT_PACKAGES += \

       libnfc-nci \

       libnfc_nci_jni \

       nfc_nci_pn54x.default\

       NfcNci \

       Tag \

       com.android.nfc_extras

The first 3 ones relates to external/libnfc-nci component, while the last ones are part of package/apps/Nfc and framework/base.

Regards,

Jeremy.

元の投稿で解決策を見る

0 件の賞賛
返信
10 返答(返信)
2,717件の閲覧回数
gary_bisson
Senior Contributor III

Hi,

No the L5.1.1 patches won't apply on L5.0.0 since there are several internal API updates between those two releases.

However the old NFC repository contains the solution:

Lollipop patches don't apply · Issue #1 · NXPNFCLinux/android_nxp-nci · GitHub

The result can be seen here:

Boundary Devices - Android Lollipop NFC demo

Regards,

Gary

0 件の賞賛
返信
2,717件の閲覧回数
anjalikkrishna
Contributor III

Hi Gary,

   Since I have applied all the changes manually, I did not face any compilation error. It was successful. So I considered patch is applied properly.

  Are you telling using the L5.1.1 NFC patch we cant make the NFC fully functional in L5.0.0?

Thanks & Regards,

Anjali

0 件の賞賛
返信
2,717件の閲覧回数
gary_bisson
Senior Contributor III

Hi,

So the patches have most likely changed since I tried it (almost a year ago). That would explain why the repo has changed.

At the time the patches for L5.1.1 wouldn't apply to L5.0.0, as you can see in the GitHub issue report provided above. The NXP engineer provded a L5.0.0-specific to overcome that issue but once again that was 1 year ago, this might have changed.

Regards,

Gary

2,717件の閲覧回数
anjalikkrishna
Contributor III

Hi,

Thanks for the reply Gary.

So I should be having a different patch in hand for making NFC to work in Android Lollipop 5.0.0.....Am I right:smileyshocked:?

I followed the below link which u shared.....

Lollipop patches don't apply · Issue #1 · NXPNFCLinux/android_nxp-nci · GitHub

But the https://nxp.box.com/NXPNCI-Lollipop-5-0 seems to be a broken link :smileysad:...

0 件の賞賛
返信
2,717件の閲覧回数
gary_bisson
Senior Contributor III

Hi,

I don't know about the new patches, if you say it applied and built cleanly so you should be good. In my case I wouldn't be able to build.

I suggest you ask jeremygeslin​ since he is the one who helped me with the L5.0.0 release.

Regards,

Gary

0 件の賞賛
返信
2,717件の閲覧回数
anjalikkrishna
Contributor III

Hi Gary  ,

    Thanks for your valuable support .

Hi jeremy geslin,

Could you please share me the link for downloading the NFC patch for Android LOllipop 5.0.0?

Thanks & Regards,

Anjali

0 件の賞賛
返信
2,718件の閲覧回数
jeremygeslin
NXP Employee
NXP Employee

Hi,

There is no patch delivery for Android 5.0.0. As Gary mentioned a backposrting of 5.1.1 ones is required there, but I understand you already did it.

If your are missing the NFC service I assume this is because you miss components in your build. Your device.mk should include the following packages:

# NFC packages

PRODUCT_PACKAGES += \

       libnfc-nci \

       libnfc_nci_jni \

       nfc_nci_pn54x.default\

       NfcNci \

       Tag \

       com.android.nfc_extras

The first 3 ones relates to external/libnfc-nci component, while the last ones are part of package/apps/Nfc and framework/base.

Regards,

Jeremy.

0 件の賞賛
返信
2,717件の閲覧回数
anjalikkrishna
Contributor III

Hi,

Sorry for the late reply.

As you told the components were missing in my build . But the NFC packages were added in device.mk .Need to figure out what making the components to be excluded in the build. Right now i am using mm command and flashing as a module.Now the NFC service is registered and listed out in the service list.

But  now I am facing a different issue .The firmware download is failing. I believe there should be a firmware in the Android files system under /vendor/firmware as I saw the below code snippet in NativeNfcManager.jave file

private static final String NFC_CONTROLLER_FIRMWARE_FILE_NAME = "/vendor/firmware/libpn544_fw.so";

I copied the firmware file manually in my target sd card and provided full permission to the file  . But the logcat message shows firmware download failed

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 1

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 0

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 1

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 1

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 0

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 1

E/NxpHal  (  699): Force FW Download, NFCC not coming out from Standby

D/NxpExtns(  699): const CNfcParam* CNfcConfig::find(const char*) const found NXP_SYS_CLK_SRC_SEL=(0x1)

D/NxpExtns(  699): const CNfcParam* CNfcConfig::find(const char*) const found NXP_SYS_CLK_FREQ_SEL=(0x0)

D/NxpExtns(  699): const CNfcParam* CNfcConfig::find(const char*) const found NXP_SYS_CLOCK_TO_CFG=(0x1)

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 2

E/NxpFwDnld(  699): phDnldNfc_InitImgInfo: FAILED

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 0

D/NxpTml  (  699): phTmlNfc_i2c_reset(), VEN level 1

E/NxpHal  (  699): FW Download failed - NFCC init will continue

D/NfcAdaptation(  699): NfcAdaptation::HalDeviceContextCallback: event=6

I/BrcmNfcNfa(  699): nfc_main_hal_cback event: HAL_NFC_ERROR_EVT(0x6), status=1

I/BrcmNfcNfa(  699): nfc_main_handle_hal_evt(): HAL event=0x6

I tried with libpn547_fw.so version firmware also. But same error occurs?....Any idea?

0 件の賞賛
返信
2,715件の閲覧回数
jeremygeslin
NXP Employee
NXP Employee

Both PN7120 and PN7150 doesn't support FW update while the Android SW stack is trying FW download whatever the NFC controller integrated. However the SW stack is able to handle non-presence of FW .so file as well as non-supported functionality by the NFC controller.

As you can see in the log, NFC service initialization continues even if Download fails.

In case you still face issue there, please provide more complete trace (from the beginning of the initialization).

2,715件の閲覧回数
anjalikkrishna
Contributor III

Hi,

  I removed the .so firmware file from the target SD card. And I had a small i2c issue in the dtsi file too ,due to which I2C Read Write were failing. Now the NFC is working fine.

Thanks for your huge Support  :smileyhappy: .

0 件の賞賛
返信