How do I remove protection on PSoC4

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

cross mob
lock attach
Attachments are accessible only for community members.
KlJe_3653291
Level 2
Level 2
First like received First solution authored 5 replies posted

When use of ppcli.exe with the PSoC4_EraseAll command we get Error when PSoC4_ProtectAll has been used.

How do I remove the protection again?

I can write to the device again with "PSoC Programmer" but I cannot find a way to erase/overwrite it again with ppcli.exe

see attached script.

First time it run successfull but second time it fails.

GetPorts

<MiniProg3/1519DD000B2E

0 OK

OpenPort MiniProg3/1519DD000B2E .

<

0 OK

HEX_ReadFile "c:\\SW\\psco4.hex"

<0x00040000

0 OK

SetAcquireMode "reset"

<

0 OK

SetProtocolClock 152

<

0 OK

SetProtocolConnector 0

<

0 OK

SetPowerVoltage 3.0

<

0 OK

DAP_AcquireChip

<

0 OK

PSoC4_GetSiliconID

<1a 08 13 aa

0 OK

PSoC4_GetFlashInfo

<0x00000400

0x00000100

0 OK

PSoC4_EraseAll

E

SWD respond packet contains Failed status!

PSoC4_EraseAll returned 80004005

80004005 OK

PSoC4_ProgramRowFromHex 0x00

E

SWD respond packet contains Failed status!

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi KlJe_3653291​,

This is a known issue and I tried this to reproduce the issue.

1. Change ChipProtection to Protected in PSoC Creator and build the program.

2. Program using PSoC Programmer.

3. Using PPCLI acquire the device and perform erase all as shown -

pastedImage_0.png

As a workaround you can try the following -

1. Acquire the device and then change the chip protection to 1 (Open) using PSoC4_WriteProtection() API. PSoC4_WriteProtection() performs an erase internally and thus the entire flash will be erased.

2. Reaquire DAP

pastedImage_3.png

I performed a read to log action after this using PSoC Programmer and confirmed that this erases entire flash -

pastedImage_4.png

You can also perform erase all after changing the protection setting as shown -

pastedImage_5.png

Hope this helps.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

2 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi KlJe_3653291​,

This is a known issue and I tried this to reproduce the issue.

1. Change ChipProtection to Protected in PSoC Creator and build the program.

2. Program using PSoC Programmer.

3. Using PPCLI acquire the device and perform erase all as shown -

pastedImage_0.png

As a workaround you can try the following -

1. Acquire the device and then change the chip protection to 1 (Open) using PSoC4_WriteProtection() API. PSoC4_WriteProtection() performs an erase internally and thus the entire flash will be erased.

2. Reaquire DAP

pastedImage_3.png

I performed a read to log action after this using PSoC Programmer and confirmed that this erases entire flash -

pastedImage_4.png

You can also perform erase all after changing the protection setting as shown -

pastedImage_5.png

Hope this helps.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

This is working perfect! you are brilliant 🙂

0 Likes