2387076_en-US

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

2387076_en-US

2387076_en-US

Reading infineon mifare classic using nfclib

Hi,

In my product, I use the PN5190 with NFC Lib to read different types of cards. I’m having an issue with one customer: the device reads original MIFARE Classic cards without problems, but this customer has already deployed a mix of cards using NXP chips and Infineon chips.

The NXP cards can be read just fine. However, with the Infineon cards, the device is unable to authenticate. I’m using as a base the simplified API demo, and these cards are detected as: “Type A Layer 3 card with merged ATQA”. The ATQA is 0x0400 and the SAK is 0x88, but on the NXP chip the SAK shows 0x08.

First, I tried running the same code that I use for MIFARE Classic, but authentication fails. If I modify the SAK in PeerInfo.uTi.uInitiator.tIso14443_3a.bSak, I get the same result. Likely, the real data is kept in the reader and the peer info isn’t “bidirectional.” I’ve checked the examples, but there’s no information for this specific situation. Any info on how to read compatible cards?

I can read the card with my phone and it works fine (maybe slower than an original NXP card, but it works). The sector 0 dump is:

XXXXXXXXC188040043242BCE0001020E
XXXXXXXXXXXXXXXX0000000000000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
XXXXXXXXXXXXFF078069XXXXXXXXXXXX

NFC Lib returns this error code:

ErrorInfo Comp: 0x0 type: 0x0
The result of sending the authenticate command is 0x20000.

Any example?

Thanks in advance.

Re: Reading infineon mifare classic using nfclib

Hello @Saydev

Hope you are doing well.

Layer 3 covers anti-collision, UID selection and card activation, while ISO 14443 layer 4 presents a set of standardized commands for data exchange. Basic Tags/Cards stop after Layer 3 and use proprietary memory-read/write commands instead of Layer 4.

Since your customer is using third-party PICCs, you will need to implement the proprietary/custom command set for your device.

Also, please refer to NxpNfcRdlib -> types -> ph_Status.h for the Status Code definitions.

Regards,
Eduardo.

Re: Reading infineon mifare classic using nfclib

Good news,

I've been able to read the card, i simply changed the way to read the card from simplified API to the approach shown in the NfcrdlibEx4_MIFAREClassic.c example, the macro phalMfc_Authenticate seems to work just fine with these cards while MFC_AUTHENTICATE was failing.

Re: Reading infineon mifare classic using nfclibHi Eduardo,

The card is detected by the phone app as mifare classic 1k and it can be read just fine once the proper keys are loaded (no proprietary software is needed, just mifare classic tool for android), therefore i think the card accepts standard commands (i still need to discover the chip model, but i think it's one of the family SLE 78CLXxxxP, on the datasheet it says to have " Mifare™ compatible interface"), maybe the compatibility is emulated but it works, I've checked the example code that came with nfclib and it expects to have a ATQA of 0x0400 and SAK of 0x08, i think that the problem is related to the SAK value having a different value than expected. is there any way to force the reader to believe the SAK is 0x08?
Tags (1)
No ratings
Version history
Last update:
2 weeks ago
Updated by: