Hi
Once the CSEc is enabled by partitioning, it’s not possible to run mass erase (Erase All Blocks command). To be able to perform the mass erase, it’s necessary to destroy the partition by CMD_DBG_CHAL and CMD_DBG_AUTH commands with knowledge of MASTER_ECU_KEY. If MASTER_ECU_KEY is not programmed yet (i.e. only CSEc is enabled by partitioning but nothing more), it’s necessary to load some MASTER_ECU_KEY and then you will be able to destroy the partition by mentioned commands.
Once CSEc is enabled, tools from Pemicro (OpenSDA on EVB, Multilink probes…) should work as expected when loading new project because these tools are not using mass erase. The Pemicro tools erase the flash using Erase Flash Block command, so there’s no problem. However, J-Link uses mass erase when loading new project, so it doesn’t work. If I can remember, this was also mentioned in SDK documentation.
The scenario you described suggests that the flash was erased, the FSEC was not restored to unsecured state and now the debuggers cannot establish the connection because mass erase needed for unsecuring is blocked by enabled CSEc.
But one thing is not clear to me – you showed the screenshot of registers. Do you mean that you can’t load new project but you can still connect the debugger?
Regards,
Lukas