cancel
Showing results for 
Search instead for 
Did you mean: 

Write command sent to ST25DV64K-I through I2C always write 0x00

FHerm.1
Associate

Hello!

I am trying to write the memory of a ST25DV64K-I with an EFR32MG13.

I created a wrapper on top of the I2C driver of this micro-controller.

I can send read and write command with no error. But the write command is not working.

For example,

  • I set 4 bytes starting at the address 0x0000 to 0x01 using the RF interface.
  • When I reading it though I2C I can see the value is 0x01. It is good.
  • Then, when I am trying to change the value to 0xFF with a I2C write command, it is changed to 0x00 instead of 0xFF. I triple checked the sent buffer contains 0xFF not 0x00. I tried with other value (0x05) but the tag always ends up setting the memory to 0x00.

If I am trying the set only one byte at specific address it is working but it always set the memory to 0x00.

I cannot find why. Can you help me understand this behavior?

Thanks a lot.

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

Hello,

The problem may be in your I2C write or in your I2C read commands. Several things can be wrong:

  • theI2C write command may not be correct and is not writing
  • the I2C write command may be correct but not write at the address you intend to write.
  • the I2C read command may be correct but not read at the address you intend to read.

For the last point, it is easy to check by reading from the RF interface, Just be careful when translating RF addresses that are in blocks of 4 Bytes and I2C that addresses that are in Bytes. If you choose address 0000h for both it is simpler.

For the write command, can you post here the exact byte stream that is going to the ST25DV ? Just to check that the I2C write command is correct.

For info, the correct command to write 4 Bytes of 01h at user memory address 0000h (equivalent of a write of block 0000h from RF) would be:

s/A7/a/00/a/00/a/01/a/01/a/01/a/01/a/p where s=start bit, a=acknowledge bit and p=stop bit.

Best regards.

View solution in original post

2 REPLIES 2
JL. Lebon
ST Employee

Hello,

The problem may be in your I2C write or in your I2C read commands. Several things can be wrong:

  • theI2C write command may not be correct and is not writing
  • the I2C write command may be correct but not write at the address you intend to write.
  • the I2C read command may be correct but not read at the address you intend to read.

For the last point, it is easy to check by reading from the RF interface, Just be careful when translating RF addresses that are in blocks of 4 Bytes and I2C that addresses that are in Bytes. If you choose address 0000h for both it is simpler.

For the write command, can you post here the exact byte stream that is going to the ST25DV ? Just to check that the I2C write command is correct.

For info, the correct command to write 4 Bytes of 01h at user memory address 0000h (equivalent of a write of block 0000h from RF) would be:

s/A7/a/00/a/00/a/01/a/01/a/01/a/01/a/p where s=start bit, a=acknowledge bit and p=stop bit.

Best regards.

FHerm.1
Associate

Hello,

Thanks for your answer!

Thanks to your help, I checked my write command which was good. As a result, I looked at the hardware around the I2C connection and found a problem. Indeed a resistor had a wrong value.

After changing it, the problem was solved.