cancel
Showing results for 
Search instead for 
Did you mean: 

Debug inline assembler code

berait
Associate II

Hi,

I have a inline assembly code to implement some math, like:

************************************
C-Code...

asm(

" push {%5};"

" lsl %5, 1;"

" add %5, %3;"

...

);

C-Code

*******************************************************
Unfortunately I`m not able to step through this code. What I have done so far:

1. Set breakpoints inside asm code -> not reached
2. Set breakpoint before asembly code and try to step inside the inline asm code -> By the time I step inside the asm code, the debuger is "busy" as if it would be in run mode and sometimes it crashes and the debug session is over.

3. In Project build settings I have selcted the maximum debug level -g3 -> no effect

4. I have set optimization to "none" -> no effect

5. open the disassembly perspective and try to debug the code there -> same behavior as in 2.

I only can say that the debug code is doing the math, I can see the results, but for some changes I`d like to debug this asm code.

Anyone has any idea of what else I can do to get it done?

Thank you for any hint.

Benedikt

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you Semer CHERNI!

I have solved it by generating a dedicated assembler file and add it to my project. Inline assembly is

not suitable for debugging. 

 

regards

View solution in original post

3 REPLIES 3
Semer CHERNI
ST Employee

Hello @berait 

First le me thank you for posting.

Please try to check this post it should helps Solved: How to run assembly code in stm32 cube ide? (NUCLE... - STMicroelectronics Community

KR,
Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you Semer CHERNI!

I have solved it by generating a dedicated assembler file and add it to my project. Inline assembly is

not suitable for debugging. 

 

regards


@berait wrote:

I have solved it


then please mark your post as the Solution.