How to erase a installed Read+Write Protection

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

cross mob
User11996
Level 3
Level 3
Hi.

I've problems to remove a installed global read an Sector wrrite protection.

What is the correct sequence to remove the protection?

If i install only a write protection (for example on S2) with:


XMC_FLASH_InstallProtection( 0, 0x0004, (uint32_t) PW1 , (uint32_t) PW2 ); // Write protect on sector 2.
// all Parameter are direct (not as pointer)
XMC_FLASH_ConfirmProtection(0);


The protection is there.

If i try to remove the protection with:

XMC_FLASH_EraseUCB( (uint32_t*) XMC_FLASH_UNCACHED_BASE );

i get a PROER in FLASH0->FSR.


If i try to remove the protection with:

XMC_FLASH_lDisableSectorWriteProtectionCommand(0 , (uint32_t) PW1 , (uint32_t) PW2 );

XMC_FLASH_EraseUCB( (uint32_t*) XMC_FLASH_UNCACHED_BASE );


the protection war removed. That's easy if you know, that you have to disable the write protection first, and than remove the protection.


But how to do this, if i have both protections activ (Read AND Write)?

If i try to disable the write protection, it works
If i than try erase the UCB, i get a PROER.


If i try to disable the read protection, i get a PROER. After this i can't erase the UCB.



XMC_FLASH_lDisableSectorWriteProtectionCommand(0 , (uint32_t) PW1 , (uint32_t) PW2 ); // FSR: 0x02250000 -> ok
XMC_FLASH_lDisableSectorReadProtectionCommand( (uint32_t) PW1, (uint32_t) PW2); //FSR: 0x02250800 -> Error: PROER set
XMC_FLASH_EraseUCB( (uint32_t*) XMC_FLASH_UNCACHED_BASE ); // not working....



Do you have a idea why XMC_FLASH_lDisableSectorReadProtectionCommand isn't working?

The Password's are correct! I've checked the password's with Memtool BSL/ASC: Memtool can disable the protection!

It does not matter if i first try to disable Read- and than Write-Protection or in the other way around.


How can i disable and remove the combined read/write protection?
???
0 Likes
0 Replies