NFC Shield (pn532) and Nexus S (Data Exchange Protocol)

Hello, I’m trying to use the NFC Shield and a Nexus S (android 2.3.6) to transmit data between the two, using DEP and NDEF messages. I want to use the pn532 chip as a target, so that the phone can read data from it. Some info about my setup first, I do not use the shield with an arduino, but with a mbed (connected by SPI too). The SPI communication works well, I can do the getFirmwareInfo for example.

So, I setup the chip with TgInitAsTarget. When I swipe the phone, I get an answer (424kbps, DEP, framing Active). So I do the TgGetData command to get the DEP command from the phone, but the answer is always an error code, error 0x29 “The PN532 configured as target has been released by its initiator”. I tried with another Nexus S, and it also did not work.

Just to be sure, I also tested between the two Nexus S and NDEF message exchange worked.

I also forced passive mode, the communication gets setup as 106kbps, DEP, framing Mifare, but I again get the same error.

I found this document here and I do like it says, but I always get the error. Looks like this person here had the same problem too.

So my question is, has anyone succeded in exchanging data between the pn532 and a Nexus S?

Also, I saw that the firmware version of the chip I have on my NFC Shield is v1.4, when the user manual from NXP is for version 1.6. Is this normal? Can I upgrade the firmware of my pn532? Maybe my bug is fixed in the new firmware version?

Replying to my own thread :blush:

I did more research, and to establish a P2P connection with an Android device, you need to implement the NFC Logical Link Control Protocol (LLCP) over NFC-DEP. You also need to implement a NFC Service Discovery Protocol. I guess Android uses the Simple NDEF Exchange Protocol (SNEP) so you would need to implement that too. After that, you can exchange NDEF Messages.

This is way overkill for my needs, I’ll check how to emulate a tag instead :stuck_out_tongue:

hi guy,
how is ur progress now? I am doing the same job as yours. But I had met problem at the beginning, when I use the commands
TgInitAsTarget and TgGetData. Firstly, For the TgInitAsTarget, I follow the instruction of AN10609_3 PN532 C106, and get the output: 0 FF 27 D9 D5 1 0 0 0 0 0 0 0
and the following output of command TgGetData is : 0 0 FF 3 FD D5 87 25 7F 0 AA AA AA AA as I use nexus s for testing.
It seems that they not the right result of output. Could you please tell how can I get the right result.
Besides, do u implement the communication between nexus s and arduino uno with seeedstudio nfc?
I think it not easy to implement it right, because of not many supported materials in internet.

hi kimmitanto,
Thank you for sharing your experience, my question is if I just want to realize the read/write between nexus s and pn 532(as a tag) what I should do? thank you

hi kimmitanto,
do you solve the problem? I have an idea about emulating a tag.
According to the document PN532 C106 application note and PN532 User Manual, we can emulate ISO14443-4 card and meanwhile the android os does provide class IsoDep to handle this case. I am try to do that but have no idea work out. you can try to do that. if you like, we could work together to work it out. give me a reply once you read my post. i look forwards to that :slight_smile: