Hi,
I am trying to use CSEcc, so run CSec_ Boot_ Protection_ S32K144 project, register status is as follows:
1. After erasing the chip with j-flash, it cannot be connected again. Click on' connect' but display ERROR: InitTarget(): PCode returned with error code -1. Use the J-link commander to unlock kinesis, display OK but still unable to connect.
2. Download the program using PE and display Device is secure Erase to unsecure? Clicking 'yes' does not work.
May I ask if this chip is unusable? Is there any other way to save it?
Thank you.
Best regards,
YE
Solved! Go to Solution.
If the flash was erased but the Flash Configuration Field was not restored to unsecured state AND if CSEc is enabled, I'm afraid that there's no way to recover.
If CSEc is enabled, the mass erase is blocked regardless of MEEN configuration.
Regards,
Lukas
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
If the flash was erased but the Flash Configuration Field was not restored to unsecured state AND if CSEc is enabled, I'm afraid that there's no way to recover.
If CSEc is enabled, the mass erase is blocked regardless of MEEN configuration.
Regards,
Lukas