PSoC6 Programmer COM API PSoC6_WriteProtection()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JeHu_3414236
Level 5
Level 5
10 likes received First like received

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?

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

0 Likes