Edit: The problem was caused by me. Solution is in replies.
I was testing read back protection functionality. For one device I've set protection using openOCD by setting APPROTECT to 0xFFFFFF00.
Currently my openOCD code can't connect after APPROTECT is enabled, so I tested with nrfjprog (nrfjprog version: 10.5.0, JLinkARM.dll version: 6.54c)
nrfjprog can't remove protection. I tested with:
nrfjprog --family NRF52 --recover
Recovering device. This operation might take 30s.
ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.
also like this:
nrfjprog --recover
Recovering device. This operation might take 30s.
Erasing user code and UICR flash areas.
However, I can check that after this cmd read back returns some garbage data not erased memory. Also I can verify that using openOCD.
After this I tested if I can set protection using nrfjprog:
nrfjprog --rbp all
Protected the device against read and debug. Only a --recover, --debugreset,
or --pinreset operations will work from now on.
But I could still connect to device and read memory using openOCD/stlink.
It looks to me that this doesn't work.