Skip to main content
1123.2
Visitor II
May 17, 2021
Question

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

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

This topic has been closed for replies.

2 replies

Pavel A.
May 17, 2021

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

You're overwriting the pointer, then dereference it.

-- pa

Tesla DeLorean
Guru
May 17, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..