cancel
Showing results for 
Search instead for 
Did you mean: 

AN5633: ST25DVxxK vs ST25DVxxKC - read behaviour w. locking

Andrew Neil
Evangelist III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

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.

View solution in original post

3 REPLIES 3
JL. Lebon
ST Employee

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.

@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.

JL. Lebon
ST Employee

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.