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:
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.
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
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.
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
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:
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
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.
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:
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():
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