Skip to main content
Andrew Neil
Super User
April 29, 2022
Solved

AN5633: ST25DVxxK vs ST25DVxxKC - read behaviour w. locking

  • April 29, 2022
  • 2 replies
  • 1383 views

For RF access, if the requested read is entirely within a locked area, the document shows that both device variants will give an error:

0693W00000LzVAIQA3.png 

But the document doesn't show the corresponding case for I2C - it only shows the case where part of the requested range is locked:

0693W00000LzVBQQA3.pngSo what happens in the case where the requested read is entirely within a locked area?

Is there a specific error returned? Or does the entire read give FFs? Or what?

What is the recommended way to detect that a read has failed due to locking?

ie, how do we know if its genuine FF data, or just FF due to locking?

This topic has been closed for replies.
Best answer by JL. Lebon

Hello Andrew,

For I2C, in case the read is entirely within a read locked area, invalid data (FFh) is read.

In case the I2C read is staring in a read locked area and ending in a readable area, only invalid data is read (FFh) as well. This is both true for ST25DVxxK and ST25DVxxKC.

The rule is that ST25DV releases the I2C SDA line as soon as a un-readable byte is encountered.

In ST25DVxxK, it can be a read protected byte, an area border or end of user memory.

In ST25DVxxKC, it can be a read protected byte or end of dynamic registers area.

Due to the very nature of I2C bus, there is no specific error returned. The only thing the ST25DV is doing is releasing the SDA line, which creates the FFh value.

Normally, the I2C master knows which area is read protected and which is not and does not need to determine it with the returned value.

Best regards.

2 replies

JL. Lebon
JL. LebonBest answer
ST Employee
May 3, 2022

Hello Andrew,

For I2C, in case the read is entirely within a read locked area, invalid data (FFh) is read.

In case the I2C read is staring in a read locked area and ending in a readable area, only invalid data is read (FFh) as well. This is both true for ST25DVxxK and ST25DVxxKC.

The rule is that ST25DV releases the I2C SDA line as soon as a un-readable byte is encountered.

In ST25DVxxK, it can be a read protected byte, an area border or end of user memory.

In ST25DVxxKC, it can be a read protected byte or end of dynamic registers area.

Due to the very nature of I2C bus, there is no specific error returned. The only thing the ST25DV is doing is releasing the SDA line, which creates the FFh value.

Normally, the I2C master knows which area is read protected and which is not and does not need to determine it with the returned value.

Best regards.

Andrew Neil
Super User
May 4, 2022

@JL. Lebon_O​ - "The rule is that ST25DV releases the I2C SDA line as soon as a un-readable byte is encountered"

Thanks - that's the key.

"Due to the very nature of I2C bus, there is no specific error returned"

Is there anything noted in any status registers, or similar?

"Normally, the I2C master knows which area is read protected and which is not and does not need to determine it with the returned value"

Fair point.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
JL. Lebon
ST Employee
May 4, 2022

Hello Andrew,

Is there anything noted in any status registers, or similar?

Unfortunately, there is no status register for this.

And in the I2C signaling, the only way to report an error for the salve is a NACK, but during a read, the master is driving the ACKs so the slave cannot signal an error.

Best regards.