Card emulation on PN7160

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

Card emulation on PN7160

5,572 Views
fr5
Contributor IV

Hi,

I am using PN7160 SPI EVK (OM27160B1EVK) on Raspberry Pi4, with yocto image based on https://github.com/NXPNFCLinux/meta-nxp-nfc/blob/master/recipes-nfc/nxp_nfc/nxp-nfc_git.bb recipe, with SRC_URI overrided to git://github.com/NXPNFCLinux/linux_libnfc-nci.git;branch=NCI2.0_PN7160 and SRCREV to "6bf9f42b94e267f6384043009bda84c11e7ebbaa".

I run card emulation mode with following command :
nfcDemoApp share -t URI -u https://www.nxp.com

I read emulated card on Android and iOS, using "NFC Tools" application : tag is detected but no data is read (tag empty on Android, tag unknown on iOS).

I attach screenshots from NFC Tools app, NXP stack configuration files, and NXP log files.

1. Does anyone has any suggestion about what is wrong here ?

2. Final goal is the following :
- application uses PN7160 to emulate a card
- external device reads the emulated card
- external device writes the emulated card
- application using PN7160 can read the emulated card and get content modified by external device
Any hint about how to do it ? (Modification of nfcDemoApp ?)

Regards,

Fabien

0 Kudos
11 Replies

5,474 Views
fr5
Contributor IV

Hi,

I confirm read is OK with "NXP_T4T_NFCEE_ENABLE" set to 0x00, @danielchen thank you very much !

@rodolfoveltrigo @Mehdi thank you I will check the links.

Regards,

Fabien

0 Kudos

5,496 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Fabien:

 

Please modify "NXP_T4T_NFCEE_ENABLE" from 0x01 to 0x00. It should solve your issue. "NXP_T4T_NFCEE_ENABEL" is actually switch the card emulation types. (version 1  or version 2)  

This configuration is located inside libnfc-nxp.conf.

 

Regards

Daniel

5,397 Views
davidfrsan
Contributor I

Hi Daniel.

This same issue was happening to me while using my PN7160 and it was fixed modifying the NXP_T4T_NFCEE_ENABLE value as you said.

 

However, while trying to scan from IPhone X the tag gets scanned but it also opens the wallet most of the times. I know PN7161 has some kind of apple protocol support but PN7160 hasn't and that's not the normal behavior for any card I tried before.

Is this a problem with the firmware or something I can disable while compiling?

 

@rodolfoveltrigo 

0 Kudos

5,378 Views
danielchen
NXP TechSupport
NXP TechSupport

@davidfrsan :

 

Could you please let me know how to reproduce your issue on my side?  which app and iOS version you are using?   can you attach the logs here? I checked with NXP TagInfo,   iOS 15.5, not found this issue.

 

Regards

Daniel

0 Kudos

5,372 Views
davidfrsan
Contributor I

Dev Board: OM27160A1HN
Device (Probably this has something to do as IIRC they did some nfc changes for Iphone XS and later): Iphone X
IOS Version: 15.5
Command: nfcDemoApp share -t URI -u https://www.nxp.com

libnfc-nxp.conf: https://pastebin.com/L56Quxjh

Just putting the device near the board will open the wallet without any card.
GoToTags opens the link but shows the wallet.
NFC Tools seems to only be showing the wallet.

 

0 Kudos

5,327 Views
davidfrsan
Contributor I

Hi @danielchen @rodolfoveltrigo 

I was able to fix this by modifying libnfc-nci.conf to:

POLLING_TECH_MASK=0x00
and (probably not needed)  libnfc-nxp.conf to:

MIFARE_READER_ENABLE=0x00
This seems to be related with how Apple VAS works.

Apparently the IPhone has an HCE Applet.

Attempting to send the APDU Select command to it will open the wallet.

It seems like the PN7160 was attempting to read the content from it even if it was in HCE mode.

I would need to investigate if this is a bug with the library or the firmware but this solves the problem in the short term.

0 Kudos

5,231 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @davidfrsan :

I got an information from R&D that this is a configuration issue rather than a firmware issue. If we don't want to have any poll when using card emulation, the POLLING_TECH_MASK should be set to 0x00, otherwise we will see REQA (for example) and by default in iphone this will  open wallet application.  Please check RF sniffer below.   

danielchen_0-1656406055598.png

Regards

Daniel

5,224 Views
davidfrsan
Contributor I

Hi @danielchen 

Thanks for your reply. As I stated before changing that configuration solved my issue.

However, there may be some applications where someone wants to switch between read or emulate mode.

It would be great updating the lib so it sets the POLLING_TECH_MASK  to 0x00 if you are trying to emulate eitherways there will be people having trouble using the demoApp.

0 Kudos

5,221 Views
danielchen
NXP TechSupport
NXP TechSupport

thanks for your suggestion, I will forward it to software team.

 

Regards

Daniel

0 Kudos

5,312 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @davidfrsan 

 

Yes, you are right.  MIFARE_READER_ENABLE should be disabled in HCE mode. I would suggest described this in user manual next time.  I will report this to the software team for further analyzing and will update you in case I have any result.

Thank you very much for your information.

Regards

Daniel

 

Regards

Daniel

0 Kudos

5,502 Views
rodolfoveltrigo
NXP Employee
NXP Employee

Hi, @fr5 @Mehdi 

besides available PN7160 MCUxpresso examples available in its webpage ( examples for MCUXpresso https://www.nxp.com/products/rfid-nfc/nfc-hf/nfc-readers/nfc-plug-and-play-controller-with-integrate....  https://www.nxp.com/downloads/en/software/SW6705.zip) and the two secure files which contain MIFARE examples ( SW6856 Linux libnfc-nci MIFARE examples; SW6890 PN7160 NXP-NCI2.0 MCUXpresso MIFARE examples); please find also Examples for Linux, Android  https://github.com/NXPNFCLinux/linux_libnfc-nci (Linux, Android).

Please check whether you can find any PN7160 card-emulation working examples in links above, otherwise let me know.

Cheers

Rodolfo