Program lifecycle with custom app

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 want to develop a Windows app that does nothing but set the lifecycle to Secure.  I think I can use the PSoC Programmer example from Programmer\Examples\Programming\PSoC6\SWD\C_Sharp and this API:

PSoC6_WriteProtection(byte IN lifeCycle, nvector IN secureRestrict, nvector IN deadRestrict, bool IN voltageVerification, string OUT strError)

I tried first to read the protection with this code:

            byte chipProtect;

            hr = pp.PSoC6_ReadProtection(out chipProtect, out strError);

            if (SUCCEEDED(hr))

            {

                Console.WriteLine(string.Format("Chip protection data: {0}", chipProtect));

            }

            else

                Console.WriteLine(strError);

It gives the error "This PSoC device doesn't support PSoC6_ReadProtection() API".  In PSoC Programmer this is the chip info:

                                                               | Automatically Detected Device: CY8C6136FTI-F42

                                                              | Silicon: 0xE236, Family: 0x100, Rev.: 0x23 (*C)

                                                              | SROM Firmware: 4.01, Flash Boot: 1.20.1.42 (*C)

                                                              | Protection state: 0x02 (NORMAL), Life Cycle stage: 0x01 (NORMAL)

I don't want to destroy any boards testing the PSoC6_WriteProtection() function so I want to know why the PSoC6_ReadProtection() fails first.  Does anyone have a working app that sets lifecycle to Secure so I can test?

0 Likes
1 Solution
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

Whether the necessary preparations have been completed in your code before call PSoC6_ReadProtection() API, for example, when i try to call this API in PPCLI, i must connect the port, acquire chip, set SWD interface etc.

Capture.JPG

View solution in original post

0 Likes
3 Replies
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

Whether the necessary preparations have been completed in your code before call PSoC6_ReadProtection() API, for example, when i try to call this API in PPCLI, i must connect the port, acquire chip, set SWD interface etc.

Capture.JPG

0 Likes

Thanks.  I can get it to work now.  What are the definitions for the lifecycle stages?  It returns 0x02 for the normal stage.  What is the value for the secure stage?

0 Likes

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.

Recommend you refer this document search necessary info, it explained each block of PSoC6 in detail.

PSoC® 6 MCU: PSoC 63 with BLE Architecture Technical Reference Manual

0 Likes