Always get response trailer SW1 SW2 = 0x67 0x00

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

Always get response trailer SW1 SW2 = 0x67 0x00

1,472 Views
Minh_Hien_Tran
Contributor I

Hello NXP community,

I'm working on PN5180 module to read data from my ePassport (ICAO 9303). I can sen RATS - ATS, PPS, so technically, now i can exchange data using APDU command. Firstly, i tried to select LDS1 but however i tried, i always get SW1 SW2 = 0x67 0x00, which means "Wrong length". 

Here my code trace:

RATS: 0xE0 0x80

ATS: 0E 78 77 D4 03 4D 4B 6A 43 4F 53 2D 33 37

PPS: 0xD0 0x11 0x00

PPS_resp: 0xD0

APDU_SELECT: 0x0A 0x00 0x00 0x00 0xA4 0x04 0x0C 0x07 0xA0 0x00 0x00 0x02 0x47 0x10 0x01

APDU_SELECT_resp: 0x0A 0x00 0x67 0x00

 

So maybe my INF in APDU_SELECT is incorrect, but the problem is i have used PN532 to communicate, i could read my ePassport with the same INF (using InlistPassiveTarget and InDataExchange).

 

If anyone see this post and worked with PN5180 or smart card before, pls let me know.

 

P/s: My English is very bad, sorry :((

Labels (1)
0 Kudos
8 Replies

1,426 Views
KellyLi
NXP TechSupport
NXP TechSupport

Hello @Minh_Hien_Tran 

Here are a few examples for your reference, please download from the below link:

PN5180 | NFC IC for POS Solutions | NXP Semiconductors

NXF92074_0-1666773533418.png

 

 

Best Regards,

kelly

0 Kudos

1,417 Views
Minh_Hien_Tran
Contributor I

Hello NXF92074,

i have read the referrences you've mentioned, and i've not found anything that i think maybe useful. I think my problem is about wrong implementing ISO 14443 - 4 protocol because i used the same APDU for my PN532 before, not about implementing ISO 14443  - 3.

0 Kudos

1,396 Views
KellyLi
NXP TechSupport
NXP TechSupport

Hello @Minh_Hien_Tran 

Here is an example for how to write block by PN5180 in SW6257, this example (Ex3_WriteBlock) is working in my side, please refer to implement your application.

Best Regard,

kelly

0 Kudos

1,392 Views
Minh_Hien_Tran
Contributor I

Hello NXF92074,

Thank you so much for answering my questions, one more thing i want to know is does PN5180 can automatically add odd parity bits when i am communicating with my ISO14443A (SAK = 0x20) ? if yes, which SPI command should i send to the chip? 

0 Kudos

1,389 Views
KellyLi
NXP TechSupport
NXP TechSupport

Hello @Minh_Hien_Tran 

1. On page 59 of the datasheet there are some descriptions for odd parity, please check the below:

NXF92074_1-1667209108481.png

 

2. The host send command by SPI, you can refer to the line 690-700 of Ex2_Anticollision.

NXF92074_0-1667209004785.png

3. For the Host command details, please check the dedicated datasheet of PN5180.

0 Kudos

1,386 Views
Minh_Hien_Tran
Contributor I

Hello Sir,

You are the only one person that replied my question everytime although i have asked a lot. Thank you so so so much. I have devided my command into 6-byte-blocks to PN5180 (in my understanding about sendBigSPI func: a SPI command is not bigger than 6 bytes), here is my command trace:

1: 0x09 0x00 1E 01 01 00

card's resp: AA 01 (Seem good)

2: 09 00 1B 01 A4 04

card's resp: AB 01

3: 09 00 1A 01 0C 07

card's resp: AA 01

4: 09 00 1B 01 A0 00

card's resp: AB 01

5: 09 00 1A 01 00 02

card's resp: AA 01

6: 09 00 1B 01 47 10

card's resp: AB 01

7: 09 00 0A 01 01

card's resp: 0E 01 10 67 00 (failed :(((( )

and everytime before excute a command, i remember to clear IRQ, set to IDLE state, set PN5180 to transceive, and never turnoff the automatic TX_CRC, RX_CRC calculator.

As u can see, the answer is still '6700'. Ahh, one thing, i am using PN5180 lib for Arduino by Atrappman, u can find it here:

https://github.com/ATrappmann/PN5180-Library.

0 Kudos

1,365 Views
KellyLi
NXP TechSupport
NXP TechSupport

Hello @Minh_Hien_Tran 

To be honest, I can't understand what you are trying to do with these instructions?
But the data interaction between the card reader and the card is at least in the third layer of the protocol, so you must follow the next steps before trying to read or write to your device.

1. RF ON

2. RF Reset 

3. Activate Idle (layer 3 Selection)

4. RATS+PPS (layer 4 Selection, this step is not necessary, it depends on your device, such as requiring authentication)

hope the above reply could help you.

Best Regards,

kelly

0 Kudos

1,466 Views
Minh_Hien_Tran
Contributor I
Anyone :((((
0 Kudos