cancel
Showing results for 
Search instead for 
Did you mean: 

What is the I2C slave address of the ST25DV04K? What is the E2 = 0 or E2 = 1 meant to?

Daniel Brazil
Associate II

Hi,

I'm using a ANT7-T-ST25DV04K, which is basically ST25DV04K with an antenna.

In my project I have a sensor that will take a reading and write to the tag memory to then later retrieve it through RF.

I want to access it through I2C, in the datasheet I can't find its Slave Address, but I in another thread they are 0x53 and 0x57. Both work the same?

Also, in the Datasheet, it says "Device Select E2=0" or "E2=1" depending of the function. What is the E2?

Bonus Question: I saw that the mailbox is a volatile memory, so I can't write it there to later retrieve. Where should I write the memory so when I retrieve through RF I get the information?

Thank you,

Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

​Hi Daniel,

May be to answer better your use case:

Mailbox memory is volatile and small. So you basically don't use it to store data for a long time. EEPROM is there for this.

If you want to transfer data "in live" between the MCU and the reader, when you know the reader is there, then mailbox can be used

If you want to store data from your sensor in background to be read later by a reader, then you should use EEPROM for this.

Best regards.

View solution in original post

7 REPLIES 7
Daniel Brazil
Associate II

Answering my own question:

The first 7 bits for the device select (I2C) work as the following:

1010 E211

Use E2 = 0b for User memory, Dynamic registers, FTM mailbox

Use E2 = 1b for System memory

i.e. the first 7 bits of the I2C are:

1010 011 for User memory, Dynamic registers, FTM mailbox (0x53)

1010 111 for System Memory (0x57)

Which leads to (8 bit address; including W/R bit)

0xA6 - 1010 0110b - User memory, Dynamic registers, FTM mailbox writing

0xA7 - 1010 0111b - User memory, Dynamic registers, FTM mailbox reading

0xAE - 1010 1110b - System memory writing

0xAF - 1010 1111b - System memory reading

However, I'm not sure yet how the FTM Mailbox is populated. I need to write the data in the EEPROM, so I can remove power. Then later, I want to retrieve it through the RF. Do I need to use the Mailbox at all?

Thanks again,

Daniel

S.Ma
Principal

Just started to play with the 64kbit version.

To my understanding, if the MCU is powered, so should be the NFC tag, so I2C should work.

Now, there are 2 ways to access the memory of the NFC tag, either radio or I2C. I guess the first one wins and the other one retries.

There seem to be 2 slave addresses, one which address the EEPROM memory (which also seems to have a mecanism to protect some sectors), and another slave address for the controller and -maybe- the SRAM 256 byte buffer mailbox.

Reading the X-CUBE NFC source code somewhat help even though its tight plumbing with STM32 CubeMX formatting makes the code less intuitive, especially to guess the I2C protocol. You can dig this driver as complement info to understand how the NFC Tag works.

Good luck!

Daniel Brazil
Associate II

Dear .

I will definitely take a look on the X-CUBE NFC source code, however, I don't think my question was very clear.

I will be taking a measurement from a sensor and through de MCU, I will store the data into the EEPROM of the NFC tag. To retrieve this data, I will do afterwards through RF.

As I saw, the FTM Mailbox is used to make a faster way to transfer data from I2C to RF. However, if I write the sensor reading into the Mailbox and power the tag off, I will lose the info since the mailbox memory is volatile. My question is: how the Mailbox is populated?

Let's say I have my whole EEPROM memory full and turn the tag on, will be Mailbox be populated? If I write a part of the EEPROM memory, will the mailbox be populated?

Or the mailbox only will be populated if I write to (2008h to 2107h) and as soon as I turn the power of the tag off that information is gone?

Thank you again,

Daniel

JL. Lebon
ST Employee

​Dear Daniel,

The mailbox is not automatically populated. There is not link between mailbox and eeprom content.

To use the mailbox, you need to have the VCC powered, as you found out.

You also need to authorize the FTM function by writing 0x01 in the MB_MODE configuration register (@0x000D, slave address 0xAE).  In order to write to this register, the configuration security session must first be opened, by presenting the I2C password.

Then, you need to activate the FTM, by writing 0x01 in the MB_CTRL_Dyn dynamic register (@0x2006, slave address 0xA6). no password required here.

You can then write your data into the mailbox, at I2C at address 0x2008, slave address 0xA6 (you must always start at address 2008).

All this is also possible from RF side off course.

Be aware that using mailbox and EEPROM is exclusive. When MB_MODE=0x01, it is still possible to read EEPROM user memory, but you are not allowed to write it.

Example code for FTM are available for the ST25DV-I2C discovery board. It is the FW upgrade demo of the STSW-ST25DV001, available here: https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/stsw-st25dv001.html

Hope this helps you,

Best regards.

JL. Lebon
ST Employee

​Hi Daniel,

May be to answer better your use case:

Mailbox memory is volatile and small. So you basically don't use it to store data for a long time. EEPROM is there for this.

If you want to transfer data "in live" between the MCU and the reader, when you know the reader is there, then mailbox can be used

If you want to store data from your sensor in background to be read later by a reader, then you should use EEPROM for this.

Best regards.

Thank you for the very detailed explanation.

I didn't know about the Mailbox and EEPROM are exclusive, thank you for the heads up.

In the beginning I thought that I would need to use the FTM, but it is not necessary.

Right now, I will use the EEPROM to store my data then to collect through NFC.

To write to the EEPROM was piece of cake. Just a heads up is if you want to an iPhone to read that data, to format using the NDEF.

Daniel Brazil
Associate II

Dear JL. Lebon,

Again, thank you for being above and beyond.

Got it, the FTM is better if you want the data to go from one interface to the other right away.

Best Regards,

Daniel