2020-04-15 03:26 PM
Have a working code set that I was modifying. As I have a million times before, I set a breakpoint to check a couple variables. The breakpoints worked fine (with STlink 2). So I removed the breakpoints, and restarted the debug operation.
To my surprise, the debugger stopped at the same line I had previously been breaking. The debugger window says:
Temporary breakpoint
1, main () at ..\Src\main.c:164
164 {
No breakpoint number 2.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x080046a2 in main () at ..\Src\main.c:295
295 if (HAL_CAN_Receive(&hcan, CAN_FIFO0,50) != HAL_TIMEOUT)
Thinking I corrupted my .project file, I went back to an old repository version of the code (different .project file and everything) and still, the debugger hangs. As I add code, the location of this phantom breakpoint seems to change.
I have tried I have tried skipping all breakpoints, deleting all breakpoints, etc. I have tried deleting all the debug files and settings from the project an regenerating them. I have rebuilt the code with CubeMX. I have restarted the software, even the computer. I have changed STlink programmers. Nothing fixes the problem.
The fact this won't work with an old good version of the software that I am confident ran the debugger just fine, makes me think something is wrong with the TrueStudio program itself. I also noticed, that it is calling a "SIGTRAP" instead of a breakpoint, which I am unsure the implications.
ETA: When running the code (not actively debugging) the software runs just fine. I simply can't use the debugger anymore, as it continuously hangs on this phantom breakpoint.
TrueStudio 9.0.1
2020-04-15 03:50 PM
Did you have too many breakpoints at once?
https://community.st.com/s/question/0D50X0000C21PzlSQE/debugger-stuck-on-random-line
JW
2020-04-15 04:02 PM
Well, I suppose I answered my own question, sort of.
I needed to continue writing code, so I simply avoided running in debug mode. After a few more minutes of making some code changes here and there (added 6 or 7 lines of code), and running the code without the debugger, the phantom breakpoint disappeared.
Make no mistake, I spent the better part of 2 hours trying to get this debugger working. Perhaps this will help someone in the future who may run into this problem.
2020-04-15 05:09 PM
@Community member
Sorry, I did not see your response until now.
Yes, I recall at least a couple times today (prior to the problem) I had too many breakpoints set and got a warning.
Thank you for linking the other discussion. Very similar to my problem.
I am always anxious about problems that solve themselves without me knowing how. All of my deliberate attempts did nothing, but randomly writing code, compiling, loading, etc, did in just a few minutes.