Jlink connection not allowed after Flash Erase

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Jlink connection not allowed after Flash Erase

1,568 Views
emanuelemarracc
Contributor II

Hi All,

I'm using Kinetis MK66FN2M0VMD18 on a Custom Board and I've some problems when performing Flash memory erase using Segger J-link tools (J-Link Commander, J-Flash, J-Flash Lite).

Sometimes after I've performed Flash Memory Erase I'm not able to establish J-link connection and I get the following message when I try to connect using some different tools ( J-Link Commander, J-Flash, J-Flash Lite ):

 --- Fatal Error: Kinetis (connect): Timeout while halting CPU. CPU does not stop. Session aborted!---

If I measure Reset pin voltage on the CPU using an oscilloscope I get a strange behavior when I apply power on: I observe a sawtooth similar signal, as the device is forced to reset state. It seems the device would be exit from reset state but Reset pin cannot reach high level (3.3V in our board) and is periodically forced to 0V.

Please note that in the default behavior when I connect the CPU using J-link the Reset pin goes to high level (3.3V).

After some tests I've been able to get back the CPU to normal behavior forcing reset pin to 0V while attempting to establish the connection using J-link Flash software.

I've looked for this issue and for its cause both on device documents and on the web but I've not been able to find an answer.

Although I'm able to resolve the situation I need to understand the cause of this issue in order to avoid it.

My application is safety critical and I need to avoid every maintenance operation on the field.

Could You please help me?

Best Regards.

Emanuele#

Labels (1)
0 Kudos
2 Replies

924 Views
Jonathan_Iglesias
NXP TechSupport
NXP TechSupport

Dear Emanuele Marraccini,

Hope you are doing great, I apologize for the delay.

I think the problem here is when you  erase your MCU  it gets secured in order to use it again you have to unlock it, there are other ways here is one:

1) go to the KDS folder > segger

2)open the Jlink application this will open a terminal.

3)connect it to the mcu specify the part  and you can use default clock  and values.

4) the write "unlock kinetis"

 this should unlock the mcu  so you can  use it again.

and the sawtooth  I is happening because there is no program in the MCU since you erase it it send the MCU to a hard fault that resets the MCU constantly.

Please try this steps and let me know if this helped you.

Have a great day !

BR 

Jonathan

0 Kudos

924 Views
emanuelemarracc
Contributor II

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

0 Kudos