Presentation is loading. Please wait.

Presentation is loading. Please wait.

Initiator Peer to Peer (P2P) SNEP Operations using TRF7970A + MSP430 Training Erick Macias & Josh Wyatt 02/19/2013 TI Confidential - Internal Only.

Similar presentations


Presentation on theme: "Initiator Peer to Peer (P2P) SNEP Operations using TRF7970A + MSP430 Training Erick Macias & Josh Wyatt 02/19/2013 TI Confidential - Internal Only."— Presentation transcript:

1 Initiator Peer to Peer (P2P) SNEP Operations using TRF7970A + MSP430 Training Erick Macias & Josh Wyatt 02/19/2013 TI Confidential - Internal Only

2 Peer to Peer (P2P) SNEP Operation Overview P2P SNEP example outline covered here includes: NFC-F Protocol NFC-DEP SNEP NDEF Message Format Logical Disconnection Process  DP = NFCForum-TS-DigitalProtocol-1.0  LLP = NFCForum-TS-Logical_LinkProtocol  SNEP = NFCForum-TS-SNEP_1.0

3 TRF7970A Configuration for P2P Active Initiator In the TRF7970A controlling MCU code, create NFC_Initiator_InitLoop() in Initiator_p2p.c to initialize the TRF7970A as active initiator @ 424kbps. 0x83 (Soft Init Direct Command), 0x80 (Idle Direct Command) 0x00 (Chip Status Control)  0x21 (RF output active, +5 V operation) 0x01 (ISO Control)  0x1B (Active Initiator @ 424 kbps) 0x09 (Modulator Control)  0x21  SYS_CLK (in this case 13.56MHz) out optional, based on system requirements 0x0B (Regulator Control)  0x87 0x14 (FIFO IRQ Level)  0x0F (RX high 96, TX low 32 bytes) 0x96, 0x8F, 0x97 (Disable Decoder, Clear FIFO, Enable Decoder Direct commands)

4 Interaction with an NFC enabled device The typical NFC enabled device (i.e. an Android phone) is polling through different protocols in a “round robin” cycle (illustrated below): In this case, we are the initiator, so we will send SENSF_REQ command to the handset or other NFC P2P device capable of NFC-F in the field. We then follow the data and payload format outlined in the NFC Forum Digital protocol spec (Section 6.4, page 74, Figure 23) Card Emulation NFC Active Type A Type B Type F @ 424kpbs Type F @ 212kpbs ISO 15693

5 1. Send SENSF_REQ SENSF_REQ (See Section 6.6, NFC Digital Protocol v1.0, Table 40) Byte # DescriptionValue (hex) 0Length 06 1Command 00 (DP, SENSF_REQ) 2:3System Code (SC)FF FF (DP, Section 6.6.1.1, default) 4Request Code (RC)00 (DP, no system code information requested) 5Time Slot Number (TSN)03 (DP, Table 42, 4 time slots)

6 2. Receive SENSF_RES SENSF_RES (See Section 6.6.2, NFC Digital Protocol v1.0, Table 43) Byte # DescriptionValue (hex) 0Length 12 (or 14, see note below on RD) 1Command 01 (SENSF_RES) 2:9NFCID 2 01 FE 6F 5D 88 11 4A 0F (for example) 10:11 PAD0C0 C1 12:14PAD1C2 C3 C4 15MRTI CHECK C5 16 MRTI UPDATE C6 17 PAD2C7 18:19Request Data (RD) (only present when RC ≠ 00,sent in SENSF_REQ)

7 3. Send Attribute Request (ATR_REQ) ATR_REQ (See NFC Digital Protocol, Section 14.6, Table 87) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 25 (37 bytes) 1:2Command D4 00 (ATR_REQ) 3:12NFCID3 I NFCID3 I = 01 FE 6F 5D 88 11 4A 0F 00 00 13DID I 00 14BS I 00 15BR I 00 16PP I 32 (max payload 254 bytes) LLCP portion 17:19LLCP Magic #46 66 6D 20:22TLV: Version #01 01 11 (v1.1) 23:26TLV: MIUX02 02 07 80 (128 + MIU (1792) = 1920 bytes) 27:30TLV: Services03 02 00 03 (WKS LLC Link Management) 31:33TLV: LTO04 01 32 (500mSec timeout, Figure 22, LLP) 34:36TLV: Option Param07 01 03 (Class 3) (Table 7, LLP)

8 4. Receive Attribute Response (ATR_RES) ATR_RES (See NFC Digital Protocol Table 92, LLP Spec Section 6.2.3.2) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 1F (31 bytes) 1:2Command D5 01 (ATR_RES, fixed values) 3:12NFCID3 T NFCID3 T = F3 95 62 DF C3 28 BD 9D 94 E0 13DID T 00 14BS T 00 15BR T 00 16TO0E 17PP T 32 (max payload 254 bytes) LLCP portion 18:20LLCP Magic #46 66 6D 21:23TLV: Version #01 01 11 (ver1.1) 24:27TLV: Services03 02 00 13 (WKS LLC Link Management) 28:30TLV: LTO04 01 96 (1.5 sec)

9 5. Send DEP_REQ SYMM PDU SYMM PDU (See Logical Link Protocol Tech Spec, Fig 4) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 06 1:2Command D4 06 (DEP_REQ, Table 103, DP doc) 3PFB00 (info PDU, PNI 0, Table 105, DP doc) LLCP portion 4:5DSAP,PTYPE,SSAP00 00 (SYMM PDU)

10 6. Receive DEP_RES SYMM PDU SYMM PDU (See Logical Link Protocol Tech Spec, Fig 4) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 06 1:2Command D5 07 (DEP_RES, Table 104, DP doc) 3PFB00 (info PDU, PNI 0, Table 105, DP doc) LLCP portion 4:5DSAP,PTYPE,SSAP00 00 (SYMM PDU)

11 7. Send DEP_REQ SYMM PDU SYMM PDU (See Logical Link Protocol Tech Spec, Fig 4) Byte # DescriptionValue (hex) NFC-DEP portion 0Len 06 1:2Command D4 06 (DEP_REQ, Table 103, DP doc) 3PFB01 (info PDU, PNI 1) LLCP portion 4:5DSAP,PTYPE,SSAP00 00 (SYMM PDU)

12 8. Receive DEP_RES SYMM PDU SYMM PDU (See Logical Link Protocol Tech Spec, Fig 4) Byte # DescriptionValue (hex) NFC-DEP portion 0Len 06 1:2Command D5 07 (DEP_RES) 3PFB01 (info PDU, PNI 1) LLCP portion 4:5DSAP,PTYPE,SSAP00 00 (SYMM PDU)

13 9. Send CONNECT PDU CONNECT PDU (See Logical Link Protocol Spec, Section 4.3.5, Fig 9) Byte # DescriptionValue (hex) NFC-DEP portion 0Len 1E 1:2Command D4 06 (DEP_REQ) 3PFB01 ( info PDU, PNI 1) note: PNI value varies based on where process is LLCP portion 4:5DSAP,PTYPE,SSAP05 20 (CONNECT PDU) 6Type06 ( Service Name) 7Length0F 8:22Service Name“urn:nfc:sn:snep” 23:26 TLV: MIUX02 02 07 80 27:29TLV: RWS05 01 04 NOTE: (Section 5.6.2.2, LLP doc, this # can go up to 0F, which canincrease throughput to the initiator)

14 10. Receive Connection Complete (CC) PDU CC PDU (See Logical Link Protocol Spec, Section 4.3.7, Fig 11) Byte # DescriptionValue (hex) NFC-DEP portion 0Len 0A 1:2Command D5 07 (DEP_RES) 3PFB02( info PDU, PNI 2) LLCP portion 4:5CC PDU (DSAP,PTYPE,SSAP) 81 84 (DSAP = 20, PTYPE = 6, SSAP = 04) 6Type02 (Figure 20, LLP Spec) 7Length02 (Figure 20, LLP Spec) 8:9MIUX00 78 (Maximum Information Unit Extension)

15 11. Send I PDU (SNEP mode) I PDU (See Logical Link Protocol Spec, Section 4.3.10, Fig 14) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 2C (44 bytes) 1:2Command D4 06 (DEP_REQ) 3PFB00 (info PDU, PNI 0) LLCP portion 4:5I_PDU (DSAP,PTYPE,SSAP) 13 20 (DSAP 04, PTYPE = C, SSAP = 20) 6Sequence00 SNEP Request Message 7SNEP Protocol Version10 (SNEP v1.0) 8Request Field02 (Put – Section 3.1.2, SNEP) 9:12Length00 00 00 1F (31 bytes of payload) See next slide for payload (NDEF Message)

16 11. Send I PDU (SNEP mode, cont.) NDEF Text Record Type Byte # DescriptionValue (hex) 13Message InfoD1 (Short record, NFC well-known RTD) 14 Length of Record Name01 15Payload Length1B (27 bytes) 16Payload Type54 (‘T’ = Text) 17Status byte02 (UTF-8, 2 byte lang. code) 18:19Language65 6E (“en” = English) 20:43Payload“NFC powered by Stollmann”

17 12. Receive RR PDU RR PDU (See Logical Link Protocol Spec Section 4.3.11, Fig 15) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 07 1:2Command D5 07 (DEP_RES) 3PFB00 ( info PDU, PNI 0) LLCP portion 4:5PP PDU 83 44 (DSAP=20,PTYPE=D,SSAP=04) 6Sequence01 (Sequence Number N(R))

18 13. Receive I-PDU (SNEP mode) I PDU (See Logical Link Protocol Spec, Section 4.3.10, Fig. 14) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 0D (13 bytes) 1:2Command D5 07 (DEP_RES) 3PFB01 (info PDU, PNI 1) LLCP portion 4:5I_PDU (DSAP,PTYPE,SSAP) 83 04 (DSAP 20, PTYPE = C, SSAP = 04) 6Sequence01 SNEP Response Message 7SNEP Protocol Version10 (SNEP v1.0) 8Response81 (Success, Table 3, SNEP) 9:12Length00 00 00 00 (no information)

19 14. Send RECEIVE READY (RR) PDU RR PDU (See Logical Link Protocol Spec Section 4.3.11, Fig 15) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 07 1:2Command D4 06 (DEP_REQ) 3PFB02 ( info PDU, PNI 2) LLCP portion 4:5 RR I-PDU 13 60 (DSAP = 04,PTYPE = D,SSAP=20) 6Sequence N(R)01

20 15. Send DISCONNECT (DISC) PDU DISC PDU (See Logical Link Protocol Spec, Section 4.3.6, Fig 10) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 06 1:2Command D4 06 (DEP_REQ) 3PFB03 ( info PDU, PNI 3) LLCP portion 4:5 DISC PDU 11 60 (DSAP = 04,PTYPE = 5,SSAP = 20)

21 16. Receive DISCONNECTED MODE (DM) PDU DM PDU (See Logical Link Protocol Tech Spec Fig 12 and Table 3, Pages 15-16) Byte # DescriptionValue (hex) NFC-DEP portion 0Length 07 1:2Command D5 07 (DEP_RES) 3PFB03 ( info PDU, PNI 3) LLCP portion 4:5DISC PDU 81 C4 (DSAP = 20,PTYPE = 7,SSAP = 04) 6Reason00 Note: Table 4, LLP, the Reason Byte indicates that the LLC has received a DISC PDU and is now logically disconnected from the data link connection.

22 Thank you

23 TI Private– Strictly Private Information BACKUP SLIDES (these are older ones from NPP ops)

24 TI Private– Strictly Private Information TRF7970A Configuration for P2P Target See NFC_Target_InitLoop() in android_p2p.c 0x83 (Soft Init cmd) 0x80 (Idle cmd) 0x00 (Chip Status Control) – 0x21 (RF output active, 5 V operation) 0x01 (ISO Control) – 0x23 (Passive Target – 424 kbps) 0x09 (Modulator Control) – 0x21 (13.56 MHz) 0x0A (RX Special Settings) – 0x1C 0x0B (Regulator Control) – 0x01 0x14 (FIFO IRQ Level) – 0x0F ( RX high 96, TX low 32 bytes) 0x16 (NFC Low Detection) – 0x01 0x37 (NFCID) – 0x01, 0xFE, etc. (01 FE needed as first 2 bytes to indicated support of NFC-DEP protocol in the NFC-F SENSF_RES) 0x18 (NFC Target Level) – 0x86 (NFCID length of 10 bytes) 0x96, 0x97 (Disable Decoder, Enable Decoder cmds)

25 TI Private– Strictly Private Information Interaction with Android Handset The Android phone polls through different protocols: We will receive an IRQ for RX start (Register 0x1C – 0x40) and check the target protocol for Felica/NFC-F (0x59 – 0xD3). Else reset the TRF. Card Emulation NFC Active Type A Type B Type F @ 424 kpbs Type F @ 212 kpbs ISO 15693

26 TI Private– Strictly Private Information 1. Receive SENSF_REQ SENSF_REQ (See NFC Digital Protocol Table 40) Bit # DescriptionValue (hex) 0Len 06 1Command 00 (SENSF_REQ) 2:3SCFF FF (default) 4RC01 (System Code request) 5TSN01 (2 time slots)

27 TI Private– Strictly Private Information 2. Transmit SENSF_RES SENSF_RES (See NFC Digital Protocol Table 43) Bit # DescriptionValue (hex) 0Len 12 / 14 ( See the Note below) 1Command 01 (SENSF_RES) 2:11NFCIDt01 FE etc. (NFC-DEP support) 12:13 PAD0FF FF (don’t care) 14:15PAD1C2 C3 C4(don’t care) 17MRTIcheckC5 (don’t care) 18 MRTIupdateC6 (don’t care) 19 PAD2C7 (don’t care)

28 TI Private– Strictly Private Information 3. Receive ATR_REQ ATR_REQ (See NFC Digital Protocol Table 87) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 1E 1:2Command D4 00 (ATR_REQ) 3:12NFCIDi NFCID random # 13DIDi0 14BSi0 15BRi0 16PPi32 LLCP portion 17:19LLCP Magic #46 66 6D 20:22TLV: Version #01 01 11 (ver 1.1) 23:26TLV: Services03 02 00 13 (WKS LLC Link Management) 27:29TLF: LTO04 01 96 (1.5s timeout)

29 TI Private– Strictly Private Information 4. Transmit ATR_RES ATR_RES (See NFC Digital Protocol Table 92) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 1C 1:2Command D5 01 (ATR_RES) 3:12NFCIDt NFCID of target 13DIDi0 14BSi0 15BRi0 16TO0E 17PPi32 LLCP portion 17:19LLCP Magic #46 66 6D 20:22TLV: Version #01 01 10 (ver 1.0) 23:26TLV: Services03 02 FF FF (all Services)

30 TI Private– Strictly Private Information 5. Receive SYMM PDU SYMM PDU (See Logical Link Protocol Tech Spec Fig 4) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 06 1:2Command D4 06 (DEP_REQ) 3PFB00 ( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP00 00 (SYMM PDU)

31 TI Private– Strictly Private Information Communication flow once the NFC-DEP connection is established To send message from MSP430 to phone: (Phone in tag discovery/reader mode) 1.Receive SYMM. 2.Reply CONNECT. 3.Receive CC. 4.Reply I PDU with message. 5.Receive RR. 6.Send DISC. 7.Receive DM. To receive message from phone on MSP430 (Phone in NDEF Push mode) 1.Receive CONNECT (once the screen is tapped). 2.Reply CC. 3.Receive I with message. 4.Reply SYMM. 5.Receive DISC. 6.Send DM.

32 TI Private– Strictly Private Information 6. Transmit CONNECT PDU CONNECT PDU (See Logical Link Protocol Tech Spec Fig 9) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 17 1:2Command D4 07 (DEP_RES) 3PFB00 ( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP05 21 (CONNECT PDU) 6Type06 ( Service Name) 7Length0F 8:22Service Name“com.android.npp”

33 TI Private– Strictly Private Information 7. Receive CC PDU CC PDU (See Logical Link Protocol Tech Spec Fig 11) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 06 1:2Command D4 06 (DEP_REQ) 3PFB02( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP85 90 (DSAP 21, SYMM PDU, SSAP 10) 6Type02 (MIUX) 7Length02 8:9MIUX00 78

34 TI Private– Strictly Private Information 8. Transmit I PDU I PDU (See Logical Link Protocol Tech Spec Fig 14) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 26 1:2Command D4 07 (DEP_RES) 3PFB02( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP43 21 (DSAP 10, I PDU, SSAP 21) 6Sequence00 NPP Header 7NPP Protocol Version01 8:11# of NDEF entries00 00 00 01 NPP NDEF Entry 12 Action Code01 (default) 13:16NDEF Length00 00 00 15

35 TI Private– Strictly Private Information 8. Transmit I PDU (cont.) Bit # DescriptionValue (hex) NDEF 17Message InfoD1 (Short record, NFC RTD) 18 Type Length01 19Payload Length11 20Payload Type54 (‘T’ = Text) 21Status byte02 (UTF-8, 2 byte lang. code) 22:23Language65 6E (“en” = English) 24:37Payload“Hello Android” (Text Message)

36 TI Private– Strictly Private Information 9. Receive RR PDU RR PDU (See Logical Link Protocol Tech Spec Fig 15) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 07 1:2Command D4 06 (DEP_REQ) 3PFB03 ( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP87 50 (RR PDU) 6Sequence00 ( Sequence Number N(R) )

37 TI Private– Strictly Private Information 8. Transmit PDU (cont.) Bit # DescriptionValue (hex) NDEF 17Message InfoD1 (Short record, NFC RTD) 18 Type Length01 19Payload Length11 20Payload Type54 (‘T’ = Text) 21Status byte02 (UTF-8, 2 byte lang. code) 22:23Language65 6E (“en” = English) 24:37Payload“Hello Android” (Text Message)

38 TI Private– Strictly Private Information 9. Transmit DISC PDU DISC PDU (See Logical Link Protocol Tech Spec Fig 10) Bit # DescriptionValue (hex) NFC-DEP portion 0Len 06 1:2Command D4 07 (DEP_RES) 3PFB03 ( info PDU, PNI 0) LLCP portion 4:5DSAP,PTYPE,SSAP41 31 (DISC PDU)


Download ppt "Initiator Peer to Peer (P2P) SNEP Operations using TRF7970A + MSP430 Training Erick Macias & Josh Wyatt 02/19/2013 TI Confidential - Internal Only."

Similar presentations


Ads by Google