1 Reply Latest reply on Jul 1, 2019 10:22 PM by DheerajK_81

    PSoC6 Programmer COM API PSoC6_WriteProtection()

    JeHu_3414236

      I am trying to use the PSoC6_WriteProtection() API to change the lifecycle but the API documentation does not say what the lifecycle values are.  It just says it is one byte.  I asked what the values are earlier and Cypress responded with the wrong answer in this post:

       

      Program lifecycle with custom app

       

      STATE is 0: UNKNOWN state.
      STATE is 1: VIRGIN state.
      STATE is 2: NORMAL state.
      STATE is 3: SECURE state.
      STATE is 4: DEAD state.

       

      I tried changing to secure with value=3 but PSoC Programmer detects this value as Secure with Debug.  I already destroyed some boards before I figured out Secure seems to require value=4.  Can somebody verify 4 is the correct value for Secure state?

        • 1. Re: PSoC6 Programmer COM API PSoC6_WriteProtection()
          DheerajK_81

          Please note that there is a thin line between the lifecycle stages and the protection states and hence can be confusing.

           

          The protection states include:

          STATE is 0: UNKNOWN state.
          STATE is 1: VIRGIN state.
          STATE is 2: NORMAL state.
          STATE is 3: SECURE state.
          STATE is 4: DEAD state.

           

          The lifecycle stages are controlled using four bits:

          ("0001") NORMAL state

          ("001x") SECURE WITH DEBUG state.

          ("01xx") SECURE

          ("1xxx") RMA

           

          So, as far as the lifecycle parameter in the API is concerned, use bit shifting to set the correct lifecycle stage:

          lifecycle = (1 << 0)  ---> NORMAL

          lifecycle = (1 << 1)  ----> SECURE WITH DEBUG

          lifecycle = (1 << 2) ---> SECURE

          lifecycle = (1 << 3)  ---> RMA (Not allowed)

           

          Example usage for SECURE lifecycle mode:

          hr = pp.PSoC6_WriteProtection(1 << 2, secureRestrict, deadRestrict, false, out m_sLastError);
          

           

          Sorry about the inconvenience you faced. We will be updating the documentation to give more information about the parameters.

           

          Please note: This API doesn't allow transition to RMA stage.

           

          Regards,

          Dheeraj