After debugging and using "attach running target", clicking restart cannot return the software to th

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

After debugging and using "attach running target", clicking restart cannot return the software to th

410 Views
Janeting123
Contributor I

Because I need to know how some functions are running during a cold start, I used the attach function.

After debugging and using "attach running target", clicking restart cannot return the software to the initialization stage.

 

My debug settings are as follows:

Snipaste_2024-05-16_09-58-57.png

Set a breakpoint in the running phase and initialization phase, and then click restart. The program skips the breakpoint in the initialization phase and stops at the running phase Task.

Snipaste_2024-05-16_10-01-18.png

 

0 Kudos
7 Replies

381 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Janeting123,

PEmicro's Eclipse plugin supports the "attach" type of debug session. During an "attach" the GDB client is launched in a way that does not disturb the state of a target device, i.e. it skips the FLASH programming and reset steps which are a part of a standard PEmicro debug session.

It seems you cannot issue a reset when attaching, you could try halting the sessions before disconnecting, then attaching again, but if you are trying to see the cold start, shouldn't it be easier to debug and flash normally and then issue a restart operation?

Best regards,
Julián

0 Kudos

371 Views
Janeting123
Contributor I

Dear, it seems that you didn't understand what I meant. After the device was cold-started, I connected the debugger and started debugging using the "attach" method. There was no problem until this step, but after I debug for a while, I need to reset to let the program start running again. At this time, I don't need to refresh the software and cold start. I just want to keep the current connection status and click the "restart" button to return the program to the initialization stage. However, I encountered a problem. Regardless of whether the current program is running or stopped, clicking restart will not achieve the effect.

0 Kudos

363 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Janeting123,

You cannot issue a reset when attaching to running target with PE Micro's implementation, as I've said in the previous reply, "it skips reset steps which are a part of a standard PEmicro debug session."

Best regards,
Julián

0 Kudos

291 Views
Janeting123
Contributor I
I still can't understand that whether to issue a reset during the connection process and whether to actively issue a reset after being connected should be two different things. Maybe the restart button is not equal to reset? Is there any other way for me to actively issue a reset after being connected?
0 Kudos

278 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Janeting123,

It seems the "restart" is different from a reset, but I do not know exactly what the difference is since this is implementation by the PE Micro plugin.

You can try issuing "monitor reset" from the debugger console to restart the code back into main:

Julin_AragnM_2-1716244813019.png

Please try this and see if this works in your debug session. I've tested it and it seems to work correctly.

Best regards,
Julián

 

240 Views
Janeting123
Contributor I

Hello, this method is not successful. After many tests, this method is only effective when the program stays in the initialization phase. At other times, it will cause the debugger connection to be disconnected.Snipaste_2024-05-22_13-57-44.png

0 Kudos

216 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Janeting123,

Could you clarify how you tested this? I can see the command working correctly when being in the while loop from this example:

Julin_AragnM_0-1716409957200.png

Then issuing a "monitor reset" I can see from the console that the CPU has been reset by debugger back to the initialization breakpoint in main():

Julin_AragnM_1-1716410076878.png

Even if this doesn't work on your side, this is unfortunately out of scope for the community support as the implementation of the restart and resets from the debugger comes from the PEMicro implementation. I apologize for the inconveniences.

Best regards,
Julián

0 Kudos