I have some code that works fine from the debugger, but does not run without the debugger. I would like to attach the debugger to see what is going on. However, I don't see an option in VSCode to attach to a running process? How is that done?
I have some code that works fine from the debugger, but does not run without the debugger. I would like to attach the debugger to see what is going on. However, I don't see an option in VSCode to attach to a running process? How is that done?
Hello!
As far as I know this is not possible, as you'll have to start the program in debug mode in order to use the debugger.
But the fact that your code works in debug mode is a good lead towards figuring out what's wrong. I would assume the issue has to do with power or clock configurations, as these are very different when running in debug mode.
What exactly is your code supposed to do that isn't working?
Best regards,
Einar
Rowley Crossworks has the capability to attach the debugger to a running process. That is the IDE I have been using before the required switch to NCS & VSCode. That is the functionality that I'm looking for. Hard to believe this isn't possible in VSCode as it seems a pretty common thing to need to do.
In my case the code never gets to my main. So it seems that it is stuck in the zephyr startup sequence somewhere.
Then I assume there's an issue with how you set up power or clock, it would help with more details on what you're doing.
I can look into attaching the debugger.
Yes, very important feature. Miss that from SES.
Many times your code is running, and in a state where you want to attach and debug it .. but not restart it.
No doubt present state of NCS/VSCode debugging is sorely lacking from what was available in SES.
Very hard to find clear information. Even something simple like setting up a VSCode project to view Cortex Peripherals, referencing a SVD file.
This should actually be possible in NCS using custom debugger settings as explained here:
To attach to a running process, the request field must be set to attach.
Hope this helps, best regards,
Einar