Using breakpoints to debug STM32 source code in Keil MDK

Hello Dears,

Here is my concerne:
In a debug mode I want to make a stop on the Line of the while loop so that I Can easly see what happens inside my loop. But it is possible to put a stop on that Line and I want to know why.

Please let me know if you have understood.
Thanks!!!

1 Like

Are you using any language translator? I didn’t get your issue here. I didn’t even get the title. Please edit it ( both title and topic ).

It seems to be like you have some issue with the while loop. But what issue you are facing, I can’t understand. Please use proper English.

1 Like

I am making my best effort in order to be well underatood. I do not live an English speaking country and each day while Reading English datasheets I acquire proper words to explain well.
I often write in English from the technical knowledge that I have in french. That’s why it Can seem tricky to understand.

I apologize from my technical English. I will try to explained well.

That’s okay. You don’t have to apologize. I see you have edited the topic.

Regarding the topic, you have issues debugging the while loop. You may use Breakpoints and the Step into icon on the toolbar to debug the while loop.

https://www.keil.com/support/man/docs/uv4/uv4_db_dbg_breakpnts.htm
https://www.keil.com/products/uvision/db_exe_step.asp

1 Like

Okay I will check your links. Thanks! You may have noticed that in the screen sent, I can’t use a breakpoint at the line at my “while” loop. the debug mode doesn’t allow me to make a breakpoint and it’s difficult to me to focus my attention on the body of my “while” loop.

As a matter of fact I want to put breakpoints at empty lines (lines 15 and 17). How is it possible?

Lines 15 and 17 are not empty lines in your code.

Do you get any specific error or warning, like Target Device does not support conditional breakpoints. when you run the debugger?

No, I don’t. I do no have any type of message

Sorry for the late reply. What option do you get when you right-click on the number? Do you get any option to add breakpoint when you right-click on the numbers 15 & 17?

I can just insert/remove bookmark

So you can insert a breakpoint at lines 15 and 17 but not halt when run the debugger. Right?

Yes I can insert a breakpoint before getting to the debug mode (As a matter of fact the possibility to insert breakpoint disappear at those line in the debug mode)

Your problem with the debugger is quite similar to the one listed in the below link. Try the recommended solution in the link. I think the issue is due to the high optimisation level in the compiler. Go through the link, you will get it.

https://developer.arm.com/documentation/ka004242/latest

2 Likes

Okay I will do that.

1 Like

My concern has been solved. Thanks @Prototype

3 Likes