cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor

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
Reply
1 Solution
Moderator
Moderator

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
Moderator
Moderator

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

New Contributor

This is working perfect! you are brilliant 🙂

0 Likes
Reply