cancel
Showing results for 
Search instead for 
Did you mean: 

stm32cubeide error: debuger connection lost, how to solve it?

1123.2
Associate

Excuse me!

When I used STM32CUBEIDE to run the code, when I add the code in the red box as shown in picture, there existed a problem: debugger connection lost, when I wanna debug, the program runs into the " Hard fault interrupt"function. If I delete the code, the programmer runs successful, how to solve it ?0693W00000AOeKJQA1.png0693W00000AOeJzQAL.png

2 REPLIES 2
Pavel A.
Evangelist III

Should be probably temp.value = result....

You're overwriting the pointer, then dereference it.

-- pa

Hard Faults usually indicate a gross error, you should look at the compiled code, and the registers the CPU reports at the fault.

This is usually easier when the handler outputs actionable data rather than sit in a while(1)

Not sure why the debugger would drop the connection in this case, but it often occurs if the part is put in a low power mode, or the debug pins are meddled with.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..