PN7160 stuck in wait for discovery

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

PN7160 stuck in wait for discovery

1,065 Views
phemidal
Contributor I

Hi,

I work with the PN7160B1 on an STM32 microcontroller and try to run the RW example. If I start the example, the first runs works fine (tested with an android phone), but after 2 or 3 runs it stucks in the function 'NxpNci_WaitForDiscoveryNotification' in this line:

while(Answer != 0) NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS)

The PN7160 is supplied with 3.3V, so i changed the tvdd_conf to: '0x20, 0x02, 0x0F, 0x01, 0xA0, 0x0E, 0x0B, 0x11, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0C' (changed byte 7 and byte 9 otherwise i got RF_TXLDO_ERROR_NTF errors). The SPI speed is 5.25 MHz.

The complete log until it hangs:

Spoiler

NCI >> 20 00 01 01

NCI << 40 00 01 00

NCI << 60 00 09 02 01 20 04 04 61 12 50 05

NCI >> 20 01 02 00 00

NCI << 40 01 1e 00 1a 7e 06 02 01 d0 02 ff ff 01 ff 00 08 00 00 01 00 02 00 03 00 80 00 82 00 83 ...

NCI >> 2f 00 01 00

NCI << 4f 00 01 00

NCI >> 20 02 05 01 00 02 fe 01

NCI << 40 02 02 00 00

NCI >> 20 03 03 01 a0 14

NCI << 40 03 25 00 01 a0 14 20 54 68 75 20 4a 75 6e 20 32 33 20 32 32 3a 32 35 3a 34 34 20 32 30 ...

NCI >> 20 00 01 00

NCI << 40 00 01 00

NCI << 60 00 09 02 00 20 04 04 61 12 50 05

NCI >> 20 01 02 00 00

NCI << 40 01 1e 00 1a 7e 06 02 01 d0 02 ff ff 01 ff 00 08 00 00 01 00 02 00 03 00 80 00 82 00 83 ...

NCI >> 2f 02 00

NCI << 4f 02 05 00 00 01 aa dd

NCI >> 21 00 10 05 01 01 01 02 01 01 03 01 01 04 01 02 80 01 80

NCI << 41 00 01 00

NCI >> 21 03 07 03 00 01 01 01 06 01

NCI << 41 03 01 00

 

WAITING FOR DEVICE DISCOVERY

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 11 a1 ba 01 20 00 00 00 00 05 04 78 80 44 00

NCI >> 21 06 01 03

NCI << 41 06 01 00

NCI << 61 06 02 03 00

NCI << 61 05 19 01 02 04 01 ff 01 0c 0b 31 66 5f 28 00 00 00 00 80 81 44 01 00 00 02 01 00

NCI >> 21 06 01 03

NCI << 41 06 01 00

NCI << 61 06 02 03 00

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 70 67 37 01 20 00 00 00 00 05 04 78 80 44 00

- POLL MODE: Remote T4T activated

SENS_RES = 0x04 0x00

NFCID = 08 11 a1 ba

SEL_RES = 0x20

NCI >> 00 00 14 00 a4 04 00 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 00

NCI << 60 06 03 01 00 01

NCI << 00 00 38 6f 34 84 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 a5 22 bf 0c 1f 61 1d 4f 07 ...

Select PPSE Application succeed

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...

CARD REMOVED

NCI >> 21 06 01 00

NCI << 41 06 01 00

NCI << 6f 11 01 00

NCI >> 21 03 07 03 00 01 01 01 06 01

NCI << 61 06 02 00 00

NCI >> 21 03 07 03 00 01 01 01 06 01

NCI << 41 03 01 00

 

WAITING FOR DEVICE DISCOVERY

NCI << ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...

NCI << 41 03 01 a0

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 0c 63 10 01 20 00 00 00 00 05 04 78 80 44 00

NCI >> 21 06 01 03

NCI << 41 06 01 00

NCI << 61 06 02 03 00

NCI << 61 05 19 01 02 04 01 ff 01 0c 0b 99 0b 0c 2d 00 00 00 00 80 81 44 01 00 00 02 01 00

NCI >> 21 06 01 03

NCI << 41 06 01 00

NCI << 61 06 02 03 00

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 9e a7 f0 01 20 00 00 00 00 05 04 78 80 44 00

- POLL MODE: Remote T4T activated

SENS_RES = 0x04 0x00

NFCID = 08 0c 63 10

SEL_RES = 0x20

NCI >> 00 00 14 00 a4 04 00 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 00

NCI << 60 06 03 01 00 01

NCI << 00 00 38 6f 34 84 0e 32 50 41 59 2e 53 59 53 2e 44 44 46 30 31 a5 22 bf 0c 1f 61 1d 4f 07 ...

Select PPSE Application succeed

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << 6f 11 01 01

NCI >> 2f 11 00

NCI << 4f 11 01 00

NCI << ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...

CARD REMOVED

NCI >> 21 06 01 00

NCI << 41 06 01 00

NCI << 6f 11 01 00

NCI >> 21 03 07 03 00 01 01 01 06 01

NCI << 61 06 02 00 00

NCI >> 21 03 07 03 00 01 01 01 06 01

NCI << 41 03 01 00

 

WAITING FOR DEVICE DISCOVERY

NCI << 41 03 01 a0

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 78 ec f2 01 20 00 00 00 00 05 04 78 80 44 00

NCI >> 21 06 01 03

NCI << 41 06 01 00

NCI << 61 06 02 03 00

NCI << 61 05 19 01 02 04 01 ff 01 0c 0b da d8 48 9e 00 00 00 00 80 81 44 01 00 00 02 01 00

NCI >> 21 06 01 03

NCI << ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...

NCI << 41 06 01 00

NCI << ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ...

NCI << 61 06 02 03 00

NCI << 61 05 1a 01 02 04 00 ff 01 0a 04 00 04 08 9b 6a 5c 01 20 00 00 00 00 05 04 78 80 44 00

If i define 'REMOVE_P2P_SUPPORT' the code works but does not detect correctly when the card is removed (prints 4-6 times the same text).

Can somebody help me to check if the config and the communication with the IC is correct?

0 Kudos
Reply
1 Reply

1,022 Views
michael_d_1983
Contributor I

i has this problem too, seems to be an copy paste error.

i think it should be:

while(AnswerSize != 0)

    NxpNci_WaitForReception(Answer, sizeof(Answer), &AnswerSize, TIMEOUT_100MS)

0 Kudos
Reply