NFC PN7150 porting on Android Oreo 8.1 - vndk ,hal issue

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

NFC PN7150 porting on Android Oreo 8.1 - vndk ,hal issue

4,808 Views
wiserkuo
Contributor II

Dears

I'm trying porting PN7150 to rockchip 's rk3326 platform , which runs android oreo 8.1

I have followed steps of AN11690 , and merged rockchip's source with GitHub - NXPNFCLinux/nxpnfc_android_oreo: Android patches for support of PN7150 NCI based NXP NFC Co... 

Then, I faced some issues which are not mentioned in AN11690 document.

hal_nfc_default  sepolcy coredomain assiociated build error

1542108579475.jpg

later , i added hal_nfc_default in treble_sepolicy_tests.py's coredomainWhilelist  to solve this issue.

1542191132428.jpg

Then compiled and run the firmware into board.

It has a runtime error of NFC hwbinder,  it can't find INfc/default interface of  manifest.xml

1542108662448.jpg

Afterward i add related INfc /default tag in the patch of manifest.xml to solve it

And AN11690 Step 3.1.5  doesn't mention the interface tag  should be added

1542191425237.jpg

After this patch ,  Android's Setting have NFC option , but it is not worked still.

The newest issue  is about   vndk sphal  can't load   android.hardware.nfc@1.0-impl,so 

but   android.hardware.nfc@1.0-impl,so  is actually located in /vendor/lib64/hw/

1542190572074.jpg

1542191728569.jpg

Is there any one also experienced porting nxp nfc to android oreo?  

Tags (2)
9 Replies

3,164 Views
nagendrasarma
Contributor III

Hello all

where can i get this file "libnfc-nxpTransit.conf"  ?

0 Kudos
Reply

3,164 Views
nikolaos_pasalo
Contributor II

Hi,

You should fix your issue by making sure that you've added the service and it is running. Here is my {board}.mk file:


# NXP NFC support
PRODUCT_PACKAGES += \
NfcNci \
Tag \
com.nxp.nfc \
android.hardware.nfc@1.0-impl \
vendor.nxp.nxpnfc@1.0-impl \
vendor.nxp.nxpnfc@1.0-service \
nfc_nci.pn54x

# Add custom NFC files
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml \
frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/android.hardware.nfc.hce.xml \
frameworks/native/data/etc/android.hardware.nfc.hcef.xml:system/etc/permissions/android.hardware.nfc.hcef.xml \
device/{venodr}/{board}/nfc/libnfc-brcm.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-brcm.conf \
device/{venodr}/{board}/nfc/libnfc-nxp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libnfc-nxp.conf \
device/{venodr}/{board}/nfc/libnfc-nxp_RF.conf:$(TARGET_COPY_OUT_VENDOR)/libnfc-nxp_RF.conf

PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
ro.hardware.nfc_nci=pn54x

Best regards,

Nikolaos

3,164 Views
wiserkuo
Contributor II

Dear Nikolaos:

Thanks for your kindly help .

Although I have done all the changes you mentioned already ,  the final issue still continue  print as the error log as the last screenshot.

"Could not load....... from sphal namespace"

Then i tried to trace source , it is related to libhidl/transport/ServiceManagement.cpp  .

My android.hardware.nfc@1.0.so has always been load as sphal library.

,then i change "if (path != HAL_LIBRARY_PATH_SYSTEM) " to if(0) and let it always run "else" condition--> "dlopen(fullPath.c_str(), dlMode);"  .

After this modification , Nfc /pn54x  works .

I think  NXP should refine the patch document  , depend on different platform , It usually needs additional modification to make it works

1543201358065.jpg

1543201317101.jpg

3,163 Views
hannywei
Contributor I

Hi Wei che Kuo

  Have you solve your issue, the change may raise other problem: "if (path != HAL_LIBRARY_PATH_SYSTEM) " to if(0) , can you share your finally change?

0 Kudos
Reply

3,164 Views
vizhen_tan
Contributor I

Hi hanny wei:

    I have the same problem, do you solved  it? 

0 Kudos
Reply

3,164 Views
nagendrasarma
Contributor III

Hello All,

we are facing similar issue 

are you able to get some break ? could you please share if yes ?

0 Kudos
Reply

3,164 Views
hannywei
Contributor I

Hi Wei Che Kuo, nikolaos.pasaloukos@andromedadigital.com 

we have faced another issue:the nxpnfc_hal_svc can not start, and according to all your change, the issue also exist.

the following  is the log. any one can help me?

[ 12.449301] init: starting service 'nxpnfc_hal_svc'...
[ 12.457728] init: property_set("ro.boottime.nxpnfc_hal_svc", "12453650768") failed: property already set
[ 12.507228] healthd: battery l=100 v=0 t=42.4 h=2 st=2 chg=a
[ 12.513623] init: Untracked pid 3745 killed by signal 1
[ 12.514143] init: Service 'nxpnfc_hal_svc' (pid 3725) killed by signal 6
[ 12.514160] init: Sending signal 9 to service 'nxpnfc_hal_svc' (pid 3725) process group...
[ 12.514263] init: Successfully killed process cgroup uid 1027 pid 3725 in 0ms

...

11-26 17:04:01.001 3627 4695 W ActivityManager: Process com.android.nfc has crashed too many times: killing!
11-26 17:04:01.036 3627 3941 I ActivityManager: Process com.android.nfc (pid 10012) has died: pers PER
11-26 17:04:01.037 3627 3941 W ActivityManager: Re-adding persistent process ProcessRecord{6bcc144 10012:com.android.nfc/1027}
11-26 17:04:01.051 3627 3941 I ActivityManager: Start proc 10060:com.android.nfc/1027 for restart com.android.nfc

0 Kudos
Reply

3,164 Views
nikolaos_pasalo
Contributor II

Hi Hanny,

Sorry but I cannot think of anything. So, you cannot see any obvious crash and the NFC HAL has all the appropriate permissions to access the nfc device? Can you please make sure that the 'nxpnfc_hal_svc' is starting only once, because it looks like something else is setting a value on the "ro.boottime.nxpnfc_hal_svc".

0 Kudos
Reply

3,164 Views
wiserkuo
Contributor II

test

0 Kudos
Reply