cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, Im using ST25DV04 with ESP32. Im unable to write tags onto NFC. I2C Communication fails.

Shruthi
Associate II

0693W00000DpfBTQAZ.jpgDuring initialization of CC, as I understand we should have values 0xe1,0x40,0x40,0x00

But I am getting 0xe1,0x40,0x40,0x43. Im trying to manually write 0xe1,0x40,0x40,0x00 at address 0xa6, 0x00 which is failing.

I ignored that and tried to write a text NDEF tag to it which is also failing.

Please check the screenshot.

Step1 : Im writing CC at 0xa6,0x00 address- which failed.

Step2 : Writing length at 0xa6,0x04 address - success

Step3 : writing text NDEF tag at 0xa6,0x06 address - fail

Step4 : reading NDEF data- reading old text NDEF tag present on NFC.

Why is the write operation failing ? Are there any other registers to be set before writing?

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

Hello,

"While addressing the device itself, there is no acknowledgement": do you mean after the first byte (the device slave address) there is not acknowledgement ?

This means that the device is not available for processing an I2C command. This can happen in 3 cases:

  • the device is not powered with Vcc.
  • the device is busy on the RF interface, processing an RF command.
  • the device is busy writing data into EEPROM after an I2C write command.

I guess you may be in the third case. I suppose you are writing the terminator TLV right after updating the NDEF message content ?

When updating the NDEF message, you are writing into the EEPROM memory. The I2C bus is then unavailable during the programming time of the EEROM: the device needs 5ms to program each 4 bytes of data. The write is starting at the stop bit of the I2C write command.

So, you should wait the end of EEPROM programming before being able to access the tag again.

This is explained in the datasheet, in chapter "6.4.2 I2C Sequential write".

Best regards.

View solution in original post

15 REPLIES 15
Brian TIDAL
ST Employee

Hi,

I would first suggest to make sure the byte write in not inhibited (see §6.4.1 in ST25DV04 datasheet)

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Shruthi
Associate II

Hi,

Thanks for the suggestion. I made the necessary changes and now I2c is writing without any return errors.

But I don't see the tag updated on NFC. I'm using NFCTools mobile app to scan, and the tag is not updated.

I'm writing a media type tag from program to NFC.

0693W00000DlOreQAF.jpg

Brian TIDAL
ST Employee

Hi,

can you read back the content of the tag through I2C after writing to check the content ?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

0693W00000DlPFXQA3.jpg 

This the NFC content I'm reading after my write function.

Im writing media type tag, whereas, there is already an existing text type tag which is not updated after my write.

Brian TIDAL
ST Employee

Hi,

can you connect a logic analyzer on the I2C and provide a trace of the I2C communication (including ACK and NAK bits)?

Thanks

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

0693W00000Dm4noQAB.jpg0693W00000Dm4kvQAB.jpg 

This is how I'm seeing on logic analyzer.

0693W00000Dm4q4QAB.jpg

Brian TIDAL
ST Employee

Hi,

can you share the logic analyzer trace file so that I can see the full frame and do some analysis? (Please indicate whether this is Salae or digiview or picoscope, or other tool)

Thanks

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Hi,
Im attaching the logic capture file.
This is generated using Saleae.