FW updating the CYPD3120

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
Idohamdi
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hi all,

How can I lock the device from future programming or FW updates? 

Would like to know for sure - What are the avaliable ways to program the CYPD3120 or change its firmware?

I'm aware of the USB option and the I2C but is there a way to change the product firmware with CC lines or SBU lines or any other way? 

Thanks in advance,

Ido

0 Likes
1 Solution

Hi Lisa,

Let me explain what i did to solve the problem.

First i used the ppcli in PSOC Programmer to change the device into KILL mode using the PSoC4_WriteProtection command.

You can only use this command after using the following commands (for other users):

OpenPort "YourSWDDevice-MiniProg3/4"
SetProtocol 8
SetPowerVoltage 5.0
PowerOn
DAP_Acquire

In the PSoC_WriteProtection command there are 2 fields - The first one is the mode you want to set the device on - 0x04 is KILL mode.
The second field is what parts of the flash you want to lock - 128 time 00 is unlocked and 128 0xFF is locked.

Like you said is did - PSoC_WriteProtection(0x04,00 00 00 ...) so the device is in KILL mode - but after reseting and making sure i cannot connect again using the SWD pins (since its locked) - i still managed to program the flash using the EZ-PD...

BUT! - if u use  PSoC_WriteProtection(0x04,0xFF 0xFF ...) now your flash is also locked and you cannot program the device using the USB or EZ-PD as well and you cannot unlock the flash using the SWD since the device is on KILL mode as well.

 

So  i believe what you wrote is not 100% correct and i hope this comment will help future users.

 

Best regard,

Ido

View solution in original post

0 Likes
11 Replies
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hello Ido,

1. The way to lock the device can be supported by SWD programming of One-Time Programmed feature. After this lock, the device cannot be upgrade firmware anymore. 

2. CYPD3120 supporting USB bootloading and SWD programming for changing/upgrading firmware by default. 

 

Best Regards,

Lisa

0 Likes

Hi Lisa,

So clear this one out for me, lets say i want to change something in EZ-PD and then upload it to the CYPD3120 but once i uploaded it - i want *no one* to be able to change it - not with SWD, USB Bootloader, I2C or any other way.

How do i do that step by step?

 

Thanks in advance,

Ido

0 Likes
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hello Ido,

If the "no one" is specified to other person without you, I think you are looking for security upgrade for CCG3 firmware/configuration. Currently, CCG3 default firmware is not support this. You need additional firmware customize to make the security check for CCG3 configurations/firmware upgrade.  

If the no one is meaning of no one really, SWD programming of One-Time Programmed is the one you are looking for.

Best Regards,

Lisa

0 Likes

Hi Lisa,

So lets say i do want to one time program the CYPD3120 using SWD as you said.

Does the normal CYPD3120 support this OTP feature? If not, which CCG3 device does and how do i make it work as a dongle exactly like the normal CYPD3120?

 

Maybe if i program the normal CYPD3120 using SWD i cant program it anymore using SWD or USB? seems unlikely... 

Can you clarify for me exactly how do i make the CYPD3120 one time programmable where "no one" means no one including me.

 

Thanks'

Ido

0 Likes
lock attach
Attachments are accessible only for community members.
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hello Ido,

1. The normal CYPD3120 supporting this OTP feature. Please refer CCGx(CYPDxxxx) programming specification. The Lock will set CYPD3120 silicon as KILL MODE.

ShifangZ_26_0-1647441615008.png

 

2. For the PSoC Programmer supporting CCGx could set the mode by this way. After this setting, the CYPD3120 will not be programmed any more. The third party also support this as per CCGx(CYPDxxxx) programming specification (attached file).

ShifangZ_26_1-1647441704195.png

Best Regards,

Lisa

Hi lisa!

Thank you for your reply...

I've been trying all day to modify the code to put my CYPD3120 in KILL MODE with no success...

Can you please tell me how to modify my CYPD3120-DP dongle base code of yours to make it go into KILL MODE?

Let me add i also modified the config.c file with an EZ-PD saved configuration and it worked.

To conclude, I would love to know where and how do i modify the code so the chip goes into KILL mode after in configured it using my config.c code.

Thanks,

Ido

0 Likes

Update!

Hi Lisa!

I managed to change the Protection of the chip to KILL using the CLI and MiniProg4.

But as i mentioned before i would like the chip to be completly locked! - now i cannot access it using the SWD but EZ-PD workes normally!

How do i block the USB Bootloader as well?

 

Thanks,

Ido

0 Likes

Or even Protect all the Flash from a change (kind of WriteProtect everything)

0 Likes

update for the last time!

I managed to protect the flash after digging in the PSoC4_WriteProtection and finding out the second attribute is Flash protection (did all 0xFF there) 

Now my question is - if i go into KILL mode AND do flash protection - is there a way someone can change the flash using the USB bootloader or any other way?

 

Thanks,

Ido

0 Likes
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hello Ido,

It is impossible to upgrade by flash using the USB bootloader or any other way with KILL mode.

Best Regards,

Lisa

0 Likes

Hi Lisa,

Let me explain what i did to solve the problem.

First i used the ppcli in PSOC Programmer to change the device into KILL mode using the PSoC4_WriteProtection command.

You can only use this command after using the following commands (for other users):

OpenPort "YourSWDDevice-MiniProg3/4"
SetProtocol 8
SetPowerVoltage 5.0
PowerOn
DAP_Acquire

In the PSoC_WriteProtection command there are 2 fields - The first one is the mode you want to set the device on - 0x04 is KILL mode.
The second field is what parts of the flash you want to lock - 128 time 00 is unlocked and 128 0xFF is locked.

Like you said is did - PSoC_WriteProtection(0x04,00 00 00 ...) so the device is in KILL mode - but after reseting and making sure i cannot connect again using the SWD pins (since its locked) - i still managed to program the flash using the EZ-PD...

BUT! - if u use  PSoC_WriteProtection(0x04,0xFF 0xFF ...) now your flash is also locked and you cannot program the device using the USB or EZ-PD as well and you cannot unlock the flash using the SWD since the device is on KILL mode as well.

 

So  i believe what you wrote is not 100% correct and i hope this comment will help future users.

 

Best regard,

Ido

0 Likes