Hi, Alessandro,
Regarding your requirement, I do not think it is feasible to change the CRP level, after test has completed, restore the original CRP level, because the CRP level is valid only after power off and power on.
Pls refer to part in section 8. Code Read Protection (CRP) in UM10237 Reversion 04.
Important: any CRP change becomes effective only after the device has gone
through a power cycle.
It means that after you change the CRP value, it is not valid until you power off and power on.
The CRP purpose is to block the JTAG port even block bootloader so that invader can not read your code and data from flash or RAM.
Hope it can help you
BR
XiangJun rong