Dear Jonathan,
thanks for Your reply.
As I wrote in my previous post I'm not able to connect to target neither using J-Flash, nor using J-Link Commander.
If I try to send the "unlock kinetis" command it seems the operation is succeded but if I try to connect I've the same bad result.
The only way I'm able to bring back the CPU to to normal behavior is forcing reset pin to 0V while attempting to establish the connection using J-link Flash software.
But I'm ot able to understand what is the cause of this issue.
Please find here the description of the procedure I follow when sometimes I get the problem:
1. Program flash a running program
2. Power-off the board
3. Connect Jlink debugger to the target (the debugger is connected to my PC via USB cable)
4. Start J-Flash application on my PC and, after I've choosen the right target device in the menu, I perfrom the Connection
5. Launch "Erase" command
6. Sometimes after this step I'm not able to perform connection to the target and I get the following mesage
--- Fatal Error: Kinetis (connect): Timeout while halting CPU. CPU does not stop. Session aborted!---
Could You please better explain me if there is any wrong step in my erase procedure in order to avoid to get in the described issue?
I will appreciate Your help.
Best Regards
Emanuele