How to parse Memory Writes via Cockpit I2C App for NTAG 5 device

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

How to parse Memory Writes via Cockpit I2C App for NTAG 5 device

Jump to solution
1,126 Views
PK2021
Contributor II

I am evaluating the usage of NTP5332 using the OM2NTP5332 evaluation board. I am using the LPC11U37H controller board. Using NTAG_I2C_Cockpit_v1.1, I am able to read/write user memory to NTP5332. I write 4 bytes to user memory at block 0 from Cockpit application, as shown on the UI snippet below.

PK2021_0-1632887504051.png

When I read the memory using the NXP TagInfo app from Android phone, I see the above 4 bytes written at block 0.

The Cockpit log window shows the following:

> Writing 4 bytes from memory @0000h:

I2C>> S A8 00 00 01 02 03 04 P

The above command stream does not make sense to me. I do see the bytes I am trying to write,e.g., 01 02, 03 04, but the rest is very confusing. What is the meaning of – ‘S A8?’ What is it encoding? What’s the formula?

If I want to achieve the same result programmatically from a micro-controller, what bytes do I need to send over I2C? Would sending the following byte stream over I2C work?

00 D4 04 00 00 03 01 02 03 04

I have come up with the above stream using my understanding of section 8.2.3.8.1 in NTP53x2 datasheet where:  

00 – Option flag

D4 – Command Code

04 – Manufacturer Code for NXP (I would think this value is ignored by the slave device)

00 00 – 16 bit address [all zeros in this example]

03 – because I am writing (3+1) x 8 bits right after this

01 02 03 04 – My data bytes.

Is my understanding correct? If not, please help me the details.

Thank you!

0 Kudos
1 Solution
1,099 Views
Fabian_R
NXP TechSupport
NXP TechSupport

About your first question, the meaning of "S A8" S stands for START procedure, and then the 7-bit slave address, the LSB which indicates if the frame is for writing or reading.

If you please check the 8.3 Section, regarding the wired interface (I2C) you will notice that this entirely complies with the I2C standard.

This stream you are referring to:

00 D4 04 00 00 03 01 02 03 04

Is a frame for the interface between NFC products (It is possible to read and write addresses from the memory map using only de NFC interface)

 

Please check the UM10204 regarding the I2C manual, where it will be clear that the frame:

 

 S A8 00 00 01 02 03 04 P

 

S

Start condition

A8

7-bit Address

00

Block Address B0

00

Block Address B1

01

Data 00

02

Data 01

03

Data 02

04

Data 03

P

Stop Condition

 

This explanation can be also checked in section 8.3.1.4 of the Datasheet, please take a look at Figure 10. Were it is shown typical R/W examples.

 

Also please notice that the memory map for the I2C and NFC are a little different, please take a look at section 8.1.2 User memory of the NTAG 5 Datasheet. Table 6. and Table 7. how the Block Adress both interface addresses are separated, especially in Table 11. To access the actual NFC readable memory.

 

Another recommendation I would say is to please take a look at the UM11406 in order to get a little more explanation about the usage of the NTAG 5 I2C Cockpit application.

Best Regards,
Fabian

View solution in original post

1 Reply
1,100 Views
Fabian_R
NXP TechSupport
NXP TechSupport

About your first question, the meaning of "S A8" S stands for START procedure, and then the 7-bit slave address, the LSB which indicates if the frame is for writing or reading.

If you please check the 8.3 Section, regarding the wired interface (I2C) you will notice that this entirely complies with the I2C standard.

This stream you are referring to:

00 D4 04 00 00 03 01 02 03 04

Is a frame for the interface between NFC products (It is possible to read and write addresses from the memory map using only de NFC interface)

 

Please check the UM10204 regarding the I2C manual, where it will be clear that the frame:

 

 S A8 00 00 01 02 03 04 P

 

S

Start condition

A8

7-bit Address

00

Block Address B0

00

Block Address B1

01

Data 00

02

Data 01

03

Data 02

04

Data 03

P

Stop Condition

 

This explanation can be also checked in section 8.3.1.4 of the Datasheet, please take a look at Figure 10. Were it is shown typical R/W examples.

 

Also please notice that the memory map for the I2C and NFC are a little different, please take a look at section 8.1.2 User memory of the NTAG 5 Datasheet. Table 6. and Table 7. how the Block Adress both interface addresses are separated, especially in Table 11. To access the actual NFC readable memory.

 

Another recommendation I would say is to please take a look at the UM11406 in order to get a little more explanation about the usage of the NTAG 5 I2C Cockpit application.

Best Regards,
Fabian