cancel
Showing results for 
Search instead for 
Did you mean: 

Able to read and write in both I2C security session close and open mode even though setting password

RP.305
Associate

Hi, I interface Controller with ST25DV04K and able read and write registers , when i am working on I2C protection on Area1 to 4, In both I2C security session close and open mode i was able to read and right even though i set the Area 1 to Area 4 permission in I2SS register , Could you pls let me know any additional things need to handle ?

1 ACCEPTED SOLUTION

Accepted Solutions
JL. Lebon
ST Employee

Hello,

Thank you for using the St25DV04K.

For I2C access protection to memory, the I2CSS register should be programmed properly and security session must be opened and closed correctly.

Here are the steps:

  1. Present I2C password : this opens I2C security session, and you can write I2C registers.
  2. Configure areas size: write values in ENDA1, ENDA2 and ENDA3 registers.
  3. Configure I2C memory protection:  write I2CSS register with correct value.
  4. Close I2C security session: present wrong I2C password or VCC off.
  5. Access to protected I2C memory => fails.
  6. Present I2C password (open I2C security session)
  7. Access to protected I2C memory => works

Here is an example:

  1. Present I2C password : by default all 0
  2. configure Areas:
    1. write ENDA1=00: area 1 is from byte 0000h to 001Fh
    2. write ENDA2=01: area 2 is from byte 0020h to 003Fh 
    3. write ENDA3=02: area 3 is from byte 0040h to 005Fh
    4. area 4 is from 0060h to 007Fh (please refer to table 4 in datasheet for area size configuration)
  3. write I2CSS = E4h
    1. Area 1 will be always readable and always writable
    2. Area 2 will be always readable, but can be written only if security session is opened
    3. Area 3 will be always writeable, but can be read only if security session is opened
    4. Area 4 can be read or written only is security session is opened
  4. close security session: present wrong password, i.e. all FF
  5. Access to memory with security session closed:
    1. Area 1 access with security session closed:
      1. read byte 0000h => should work
      2. write byte 0000h => should work
    2. Area 2 access  with security session closed:
      1. Read byte 0020h => should work
      2. write byte 0020h => should fail
    3. Area 3 access: with security session closed
      1. read byte 0040h => should fail
      2. write byte 0040h => should work
    4. Area 4 access: with security session closed
      1. read byte 0060h => should fail
      2. write byte 0060h => should fail
  6. Access to memory with security session opened:
    1. Present correct password (by default all 0)
    2. Area 1 access with security session opened:
      1. read byte 0000h => should work
      2. write byte 0000h => should work
    3. Area 2 access with security session opened:
      1. Read byte 0020h => should work
      2. write byte 0020h => should work
    4. Area 3 access: with security session opened
      1. read byte 0040h => should work
      2. write byte 0040h => should work
    5. Area 4 access: with security session opened
      1. read byte 0060h => should work
      2. write byte 0060h => should work
  7. Close security session again: present wrong password or VCC off.

Do not forget to close the security session, otherwise the access remains opened.

This is for I2C access to memory and registers.

I2C security session and I2CSS register have no effect on RF access control. For RF, you must use the RFAxSS registers.

Hope this helps.

Best regards.

JL.

View solution in original post

1 REPLY 1
JL. Lebon
ST Employee

Hello,

Thank you for using the St25DV04K.

For I2C access protection to memory, the I2CSS register should be programmed properly and security session must be opened and closed correctly.

Here are the steps:

  1. Present I2C password : this opens I2C security session, and you can write I2C registers.
  2. Configure areas size: write values in ENDA1, ENDA2 and ENDA3 registers.
  3. Configure I2C memory protection:  write I2CSS register with correct value.
  4. Close I2C security session: present wrong I2C password or VCC off.
  5. Access to protected I2C memory => fails.
  6. Present I2C password (open I2C security session)
  7. Access to protected I2C memory => works

Here is an example:

  1. Present I2C password : by default all 0
  2. configure Areas:
    1. write ENDA1=00: area 1 is from byte 0000h to 001Fh
    2. write ENDA2=01: area 2 is from byte 0020h to 003Fh 
    3. write ENDA3=02: area 3 is from byte 0040h to 005Fh
    4. area 4 is from 0060h to 007Fh (please refer to table 4 in datasheet for area size configuration)
  3. write I2CSS = E4h
    1. Area 1 will be always readable and always writable
    2. Area 2 will be always readable, but can be written only if security session is opened
    3. Area 3 will be always writeable, but can be read only if security session is opened
    4. Area 4 can be read or written only is security session is opened
  4. close security session: present wrong password, i.e. all FF
  5. Access to memory with security session closed:
    1. Area 1 access with security session closed:
      1. read byte 0000h => should work
      2. write byte 0000h => should work
    2. Area 2 access  with security session closed:
      1. Read byte 0020h => should work
      2. write byte 0020h => should fail
    3. Area 3 access: with security session closed
      1. read byte 0040h => should fail
      2. write byte 0040h => should work
    4. Area 4 access: with security session closed
      1. read byte 0060h => should fail
      2. write byte 0060h => should fail
  6. Access to memory with security session opened:
    1. Present correct password (by default all 0)
    2. Area 1 access with security session opened:
      1. read byte 0000h => should work
      2. write byte 0000h => should work
    3. Area 2 access with security session opened:
      1. Read byte 0020h => should work
      2. write byte 0020h => should work
    4. Area 3 access: with security session opened
      1. read byte 0040h => should work
      2. write byte 0040h => should work
    5. Area 4 access: with security session opened
      1. read byte 0060h => should work
      2. write byte 0060h => should work
  7. Close security session again: present wrong password or VCC off.

Do not forget to close the security session, otherwise the access remains opened.

This is for I2C access to memory and registers.

I2C security session and I2CSS register have no effect on RF access control. For RF, you must use the RFAxSS registers.

Hope this helps.

Best regards.

JL.