- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
■ 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.