cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging stops midway (operation becomes impossible) when using STM32CubeIDE and STM32L452RE

YO
Associate II

Debugging stops midway and the only options are to stop debugging or start over.

0693W00000Y8jjDQAR.png

Indicates what is currently known about this condition

・Pressing "Step Over" repeatedly or "Resume" to stop debugging. There are certain points where debugging stops.

・​Place a breakpoint just before the point where debugging stops, turn on "instruction step mode" there, and repeat "Step Over" to avoid debugging stops.

・However, even if "instruction step mode" is continued after that, debugging still stops if "step-in" is not pressed at the "bl" part of the instruction in "reverse assembly".

It is difficult to debug a long program in �?instruction step mode", i.e., manually, to the end, so I do not know if it is possible to debug to the end.​I would prefer to debug semi-automatically instead of using this technique.

Also, when debugging stops, the console displays the following

NVIC_DFSR_REG = 0x00000001 
GDB session, device event: 3
GDB session, device event: 3
GDB session, device event: 1
GDB session, device event: 1
ST-LINK device status: RESET_MODE
ST-LINK device status: RUN_MODE

If anyone knows of this situation, I would appreciate an answer.

I am using machine translation for this text. I am also new to STM32. Thank you in advance for your help.

5 REPLIES 5
gbm
Lead III

Try to reduce SWCLK frequency in ST-Link settings. Make sure you don't disable SWD in your code (GPIOA configuration changes - MODER, PUPDR).

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
YO
Associate II

Thanks for the reply.

I figured I could apply the settings you gave me in sTM32cubeIDE as follows

From menu,go to

"Run"→"Debug Configuration"→"debugger"→"debug probe"→"interface"

then

・check "SWD"

・change interval(kHz)

Is my understanding correct? By the way, I changed the interval, but it didn't solve the problem.​

Rim LANDOLSI
ST Employee

Hello @YO,

At first let me thank you for posting your issue.

The project that you are working on is not too much clear, it will be helpful if you could share it.

unless, you are working on a low power application I wonder you to enable low power debug mode and connect under reset as shown in the screenshot below:

0693W00000Y92lSQAR.pngAlso, you have to mass erase the flash memory using the following link that may help you to do that:

How to solve debugger connection issues (st.com)

Regards,

Rim

YO
Associate II

Sorry for the delay in replying.

I am trying to run a program that worked on a Nucleo-L476RG on a L452RE microcontroller

I tried what you told me to do, but alas, I failed.

Perhaps move away from the need to single step everything to understand how your code works.

Instrument the code to use the UART or SWV to provide dynamic analysis of program flow, or status reporting.

Do better static analysis were you walk the code and understand the logic and expectations.

Have the HardFaultHandler and ErrorHandler report actionable information if you end up there.

The ErrorHandler works much better passed __FILE__ and __LINE__ details.

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