Skip to main content
Visitor II
September 14, 2017
Solved

ST25TA read/write password protection

  • September 14, 2017
  • 1 reply
  • 2354 views
Posted on September 14, 2017 at 09:00

Hello,

I got stuck while trying to make changes in code of ST25TA02K-P NFC tag for  read/write access protection through password. I'm using X-NUCLEO-NFCC03A1 as reader and writter .

So does ST25TA support  protection through password . If yes ,how we can do this and what changes is required in code and what is the memory mapping of tag .

https://community.st.com/tags♯/?tags=nfc03a1

‌ 

https://community.st.com/tags♯/?tags=st25ta02k-p

 

https://community.st.com/tags♯/?tags=nfc%20tags

 

https://community.st.com/tags♯/?tags=password

#st25ta02k-p #nfc-tags #password #nfc03a1
    This topic has been closed for replies.
    Best answer by Thomas Q.
    Posted on September 20, 2017 at 12:26

    Hello,

    The commented code of lib_nfctype4pcd.c you are refering to was meant to be informative,

    by showing a transcription of procedure 7.4 of the datasheet into the X-CUBE-NFC3 environment.

    As you noticed it can not be compiled directly. You have to place it in some function

    corresponding to the procedure, that you would call from your scenario.

    For your information, the PCDNFCT4_ReadNDEF function from file lib_nfctype4pcd.c

    corresponds to procedure 7.2 of the datasheet. You may implement in a similar fashion

    a new PCDNFCT4_ProtectNDEF function corresponding to procedure 7.4.

    Let me know it this clears things up.

    Best regards

    1 reply

    ST Employee
    September 15, 2017
    Posted on September 15, 2017 at 09:59

    Hello,

    Read/write access protection through password is supported on the ST25TA02K-P for the NDEF file.

    Section 3 of the

    http://www.st.com/resource/en/datasheet/st25ta02k-p.pdf

     gives the memory mapping of the tag, and Section 7 gives some examples

    of procedures regarding the read access :

    - 7.4 : activation of the read protection (Enable verification refering to section 5.7.3)

    - 7.3 : accessing a read protected NDEF file

    - 7.5 : deactivation of the read protection (Disable verification refering to section 5.7.4)

    The same procedures can be applied for write access using 0x0002 as security attribute for

    Enable Verification Requirement and Disable Verification Requirement commands.

    When using procedure 7.4 for the write access , the RF session must be closed in an additional step

    (with a S(DESELECT) command or with a shutdown of the RF field) for the write protection to be activated.

    If you provide a code sample, i can elaborate an example based on it.

    Best regards

    Visitor II
    September 15, 2017
    Posted on September 15, 2017 at 12:42

    Thanks for support, I have some questions to ask:

    1-What is verify command and how to use it in the code? explain by code.

    2- What does it mean by NDEF file? Is it NDEF.c in code of X-CUBE-NFC3?

    3- What is the memory address in tag where we have to write the password?

    5- What changes wil be made for ;

        - 7.4 : activation of the read protection (Enable verification refering to section 5.7.3)

        - 7.3 : accessing a read protected NDEF file

        - 7.5 : deactivation of the read protection (Disable verification refering to section 5.7.4)

    ST Employee
    September 15, 2017
    Posted on September 15, 2017 at 17:41

    Hello,

    The Verify command is described in section 5.7.1 of the

    http://www.st.com/resource/en/datasheet/st25ta02k-p.pdf

    .

    The NDEF file is the memory area used to store the NDEF message

    length and content on the tag (see section 3, with a focus on 3.1.3).

    The Read and Write passwords are not memory mapped and thus can not

    be accessed with ReadBinary or UpdateBinary commands.

    A password value to access the NDEF file is presented using the Verify command.

    A password value can be modified by first presenting it with the Verify command,

    then it is modified with the ChangeReferenceData command (see section 5.7.2).

    The

    X-CUBE-NFC3 software is not dedicated to custom features from ST tags.

    Regarding

    the ST25TA02K-P, only standard NFCT4 commands are implemented.

    The archive in attachment contains 3 source files from the original

    package, that were modified to implement the Verify, ChangeReferenceData,

    EnableVerificationRequirement and Dis

    ableVerificationRequirement commands.

    I suggest you use them as a replacement to the 3 files from the original package,

    it should ease your implementation of password authentication on the ST25TA02K.

    If you need to implement more custom commands from the ST25TA02K, it can be

    achieved in a similar way by adding more content to

    these

    3 files.

    At lines 227 and 235 of the modified lib_nfctype4pcd.c file, you will also find in

    comment a suggested implementation of procedure 7.4, and of password modification.

    Let me know if you need further clarifications.

    Best regards

    ________________

    Attachments :

    STM32CubeExpansion_NFC3_V1.2.0_ST25TA02K.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyRg&d=%2Fa%2F0X0000000b7j%2FPn4FsDZ6TB5AOvEPspuCRJbwH3r4e5NXjS97or6ua2o&asPdf=false