I was playing around with a psoc 4200 dev board and put one of them into protected mode. Documentation says I am able to change it back to open mode after erasing flash. I have tried calling the Erase All API followed by the Write Protection API but it does not seem to be working.

Anybody can help to guide me on a step by step to change it back to open mode?