Hi Kan_Li,
I have tried to develop the code for the Code Read and Write protection in application("phExccid") bin file, not in the EEPROM Bin file. So, that application bin didn't get copied if some one try to do it.
But after developing that code I am not able to get it(it normally get copied after applying such setting using API's).
After flashing that code in the PN7462, It allow to copy the application bin file(which I want to stop).
As you have shared the screenshot for the various "Code Read Protection" & "Code Write Protection" levels, In which I need to set the level 2 No Read Only Write is possible.
For your information here I am sharing function in which I have developed the function using the API's available in "phhalSysSer".
So, Please correct me & guide me if I have set the wrong parameter if any.
Looking forward for your support.
Thanks & Regards
Manva
Here is code below :
void CRP(void){
wStatus = phhalSysSer_USB_Config(PH_SYSRV_GET_DATA, &sUsbInfo);
/* Update Product ID. */
sUsbInfo.USBDesc_PID[0] = 0x01;
sUsbInfo.USBDesc_PID[1] = 0x68;
wStatus = phhalSysSer_USB_Config(PH_SYSRV_SET_DATA,
&sUsbInfo);
wStatus = phhalSysSer_USB_Config(PH_SYSRV_GET_DATA, &sUsbInfo);
/* Update Vendor ID. */
sUsbInfo.USBDesc_VID[0] = 0x25;
sUsbInfo.USBDesc_VID[1] = 0x2A;
wStatus = phhalSysSer_USB_Config(PH_SYSRV_SET_DATA,
&sUsbInfo);
wStatus = phhalSysSer_OTP_SecrowConfig(PH_SYSRV_GET_DATA,
&sSecrowConfig);
/* Block SWD. */
sSecrowConfig.bBlockSWD[0] = 1;
wStatus = phhalSysSer_OTP_SecrowConfig
(PH_SYSRV_SET_DATA, &sSecrowConfig);
wStatus = phhalSysSer_OTP_SecrowConfig(PH_SYSRV_GET_DATA,
&sSecrowConfig);
/* Enable Code Write Protection. */
sSecrowConfig.bEnableCWP[0] = 1;
wStatus = phhalSysSer_OTP_SecrowConfig
(PH_SYSRV_SET_DATA, &sSecrowConfig);
wStatus = phhalSysSer_USB_PrimaryDnldConfig(PH_SYSRV_GET_DATA,
&sPriDwnlCfg);
/* Disable primary download. */
sPriDwnlCfg.CRP_Level[0] = 1;
wStatus = phhalSysSer_USB_PrimaryDnldConfig
(PH_SYSRV_SET_DATA, &sPriDwnlCfg);
wStatus = phhalSysSer_OTP_SetSecrowLock();
}