Topic: Problems with NFC breakout board communication to SCL3710

Hi

I'm doing a project where I use the superb breakout board from microbuilder.eu coupled to a Cortex-M3. I've managed to do almost all passive communication between both my tags and my desktop reader (SCM SCL3710). But now I have some problems with the active communications. On the SCL3710 side I'm using plain libnfc and on my Cortex side I'm using an own variant.

I can succesfully send the command "InJumpForDEP" and get the response that I suppose to have. After that I'm trying to send the command "InDataExchange", but get nothing back or any response from my SCL3710. My SCL3710 is on "nfc-dep-target"-mode and it says "Waiting for initiator request".

The command I send from my Cortex is { 00 00 FF 07 F9 D4 40 01 11 22 33 44 41 00 },  all in hex (0x).

Anyone got any idea?

Re: Problems with NFC breakout board communication to SCL3710

Today I'ved tried the opposite way and using my SCM SCL3710 with libnfc as the initiator and my breakoutboard as the target. I've managed to establish contact between my devices, but then I can't do anything more. The output I get from the initiator is the following:

Connected to NFC device: Philips / PN531 - PN531 v4.2
D.E.P. (212 kbps) target:
       NFCID3: aa  99  88  77  66  55  44  33  22  11 
           BS: 00
           BR: 00
           TO: 09
           PP: 03
General Bytes: 48  65  6c  6c  6f  20  77  6f  72  6c  64  21 
Sending: Hello World!
nfc_initiator_transceive_bytes: Invalid Received Frame

Which command should I send from my breakout board to read "Hello world!" and  to prevent the error "Invalid Received Frame"?

Re: Problems with NFC breakout board communication to SCL3710

Hello,

I'm trying to look at your problem but I haven't enough data, could you post (prefer pastebin (or similar)) the debug output ?

Thanks.

Romuald Conty

Re: Problems with NFC breakout board communication to SCL3710

I know now that there is not really my software that is struggling, since I can communicate with the software provided by NXP. I think the reason may be the command code that I send to libnfc/SCL3710 is wrong. What is the command bytes (and for example the other bytes too) that it expect that I send to it when it says "Waiting for initiator request"? I'ved tried with 0x40 = InDataExchange.

Re: Problems with NFC breakout board communication to SCL3710

Hello Maax,

maax wrote:

What is the command bytes (and for example the other bytes too) that it expect that I send to it when it says "Waiting for initiator request"? I'ved tried with 0x40 = InDataExchange.

On target side: TgInitAsTarget first to initialise as DEP target; then TgSetData/TgGetData to communicate.
On Initiator side: first, InJumpForDEP to select DEP target; then InDataExchange to communicate.

I hope that is what you looked for.

Romuald Conty

Re: Problems with NFC breakout board communication to SCL3710

Thanks! That was exactly what I was looking for and also have tried. What is the data that libnfc is looking for to get past "Waiting for initiator request" or does it just want an InJumpForDEP?

Re: Problems with NFC breakout board communication to SCL3710

Looks into examples/nfc-dep-target.c, to see the target side; examples/nfc-dep-initiator.c for the initiator side.

Nothing is particulary requiered by libnfc.

Romuald Conty

Re: Problems with NFC breakout board communication to SCL3710

Ok, here is where I got stuck now:

On my SCL3710 with libnfc I have this:

Connected to NFC device: Philips / PN531 - PN531 v4.2
NFC device will now act as: D.E.P. (undefined baud rate) target:
       NFCID3: 12  34  56  78  9a  bc  de  ff  00  00  
           BS: 00
           BR: 00
           TO: 00
           PP: 01
General Bytes: 12  34  56  78  87  65  43  21  
Waiting for initiator request...

On my Cortex side in text I send/receive this:

Initialize NFC...                                                               
...DONE!                                                                        
===================                                                             
SAMConfiguration                                                                
===================                                                             
===================                                                             
GetFirmwareVersion:                                                             
Version: PN532                                                                  
Firmware: 1.6                                                                   
Support: 7                                                                      
===================                                                             
===================                                                             
ReadGPIO:                                                                       
P3: 3F                                                                          
P7: 7                                                                           
I0I1: 0                                                                         
===================                                                             
===================                                                             
InJumpForDEP:                                                                   
00                                                                              
01                                                                              
12                                                                              
34                                                                              
56                                                                              
78                                                                              
9A                                                                              
BC                                                                              
DE                                                                              
FF                                                                              
00                                                                              
00                                                                              
00                                                                              
00                                                                              
00                                                                              
09                                                                              
03                                                                              
12                                                                              
34                                                                              
56                                                                              
78                                                                              
87                                                                              
65                                                                              
43                                                                              
21                                                                              
1C                                                                              
===================

The commands I send throughout the whole process:

55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 04 FC D4 14 01 01 16 00  // Initialize with SAMConfiguration
00 00 FF 00 FF 00  // ACK
00 00 FF 02 FE D4 02 2A 00  // GetFirmwareVersion
00 00 FF 00 FF 00 00 00  // ACK
FF 02 FE D4 0C 20 00  // Read GPIO
00 00 FF 00 FF 00  // ACK
00 00 FF 05 FB D4 56 01 00 01 D4 00  // InJumpForDEP
00 00 FF 00 FF 00  // ACK
00 00 FF 07 F9 D4 40 01 48 45 4A 21 F3 00  // InDataExchange, sending "H" "E" "J" "!" (Hello! in swedish)
00 00 FF 07 F9 D4 40 01 48 45 4A 21 F3 00  // InDataExchange, sending "H" "E" "J" "!" (Hello! in swedish)
00 00 FF 07 F9 D4 40 01 48 45 4A 21 F3 00  // InDataExchange, sending "H" "E" "J" "!" (Hello! in swedish)
00 00 FF 07 F9 D4 40 01 48 45 4A 21 F3 00  // InDataExchange, sending "H" "E" "J" "!" (Hello! in swedish)

I can't get my SCL3710 to indicate that it replies. My InJumpForDEP command is successfully sent and it finds my SCL3710.

Re: Problems with NFC breakout board communication to SCL3710

Here is my problem when I'm trying the opposite way:

On my SCL3710 with libnfc I got:

Connected to NFC device: Philips / PN531 - PN531 v4.2
D.E.P. (212 kbps) target:
       NFCID3: aa  99  88  77  66  55  44  33  22  11  
           BS: 00
           BR: 00
           TO: 09
           PP: 03
General Bytes: 48  65  6c  6c  6f  20  77  6f  72  6c  64  21  
Sending: Hello World!
nfc_initiator_transceive_bytes: Invalid Received Frame

Cortex side:

Initialize NFC...                                                               
...DONE!                                                                        
===================                                                             
SAMConfiguration                                                                
===================                                                             
===================                                                             
GetFirmwareVersion:                                                             
Version: PN532                                                                  
Firmware: 1.6                                                                   
Support: 7                                                                      
===================                                                             
===================                                                             
ReadGPIO:                                                                       
P3: 3F                                                                          
P7: 7                                                                           
I0I1: 0                                                                         
===================                                                             
===================                                                             
TgInitAsTarget                                                                  
=================== 

And at last, here is the commands/data that I send:

55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 04 FC D4 14 01 01 16 00 
00 00 FF 00 FF 00 
00 00 FF 02 FE D4 02 2A 00 
00 00 FF 00 FF 00 
00 00 FF 02 FE D4 0C 20 00 
00 00 FF 00 FF 00 
00 00 FF 33 CD D4 8C 00 08 00 12 34 56 40 01 FE A2 A3 A4 A5 A6 A7 C0 C1 C2 C3 C4 C5 C6 C7 FF FF AA 99 88 77 66 55 44 33 22 11 0C 48 65 6C 6C 6F 20 77 6F 72 6C 64 21 00 B8 00 
00 00 FF 00 FF 00 
00 00 FF 02 FE D4 86 A6 00 
00 00 FF 02 FE D4 86 A6 00

What is the correct frame that libnfc expect me to send? Apparently this is wrong somehow

Re: Problems with NFC breakout board communication to SCL3710

Ok, I found some bugs in libnfc's trunk version. The main one that can be affecting you setup is fixed in r1011.
On non-PN532 devices, a bad command was used to send/receive data in DEP mode.

http://code.google.com/p/libnfc/source/detail?r=1011

Could you give it a try ?

PS: Please note that the problem could have been located sooner if you post a debug output as requested wink

Romuald Conty

Re: Problems with NFC breakout board communication to SCL3710

Unfortunately I still get the same error...

Re: Problems with NFC breakout board communication to SCL3710

Hi maax,

Is is now fixed in development version ?

Romuald Conty