cancel
Showing results for 
Search instead for 
Did you mean: 

No source code available for _udivsi3 on STM32G0

Montagny
Associate II

Hi,

I'm trying a simple program with a modulo operator on a STM32G031 MCU. Everything works fine during launch. But when using debug, it says "No source code available for _udivsi3() at 0x08000204".

2023-10-19 18_25_38-STM32_Project - Source not found. - STM32CubeIDE.png

I know that the debugger is unable to find the source code because this MCU can't do hardware division. But I don't understand why the libC can't find any way to implement this. What is the workaround ? Is there a project settings I'm missing?

Thanks for your help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

Only way I can explain the IDE/debugger halting there is if the IDE thinks you have a breakpoint set (perhaps from some previous debugging session).  I've seen this happen occasionally.  What version of the IDE are you using (or which IDE if not CubeIDE)?  You can try setting a breakpoint somewhere (anywhere), then select "delete all breakpoints" and see if that fixes it.

Hmmmm...  look at the call stack and see how it got to that function call.  That may give you a clue.

View solution in original post

7 REPLIES 7
Bob S
Principal

The debugger cannot find the source for that function because it is in the libm library, which only holds object code, no source files).  It doesn't mean the function doesn't exist - is obviously does since your program compiled and linked.  That is a software implementation of the divide instruction on the G0.  It just means that if you want to use the debugging to step INTO that function, you will have to use the disassembly window and step through the raw assembly instructions.

What is the problem you're trying to debug?

Does the lack of source for the helper routine preclude this?

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

Ok many thanks for your replies. But there is still a behavior that puzzles me.

@Bob S I don't have any breakpoints anywhere, but the debugger stops by itself on this specific instruction (telling me that it can't find the source code). The problem is that the application breaks when restarting the debugger.

@Tesla DeLorean : No problem to debug yet, but if the debugger stops I won't be able to use it.
For information, the application is a simple led blinking. I tried both with

1. The code generated by CubeMX.

2. From scratch with an empty project and register assignment.

Bob S
Principal

Only way I can explain the IDE/debugger halting there is if the IDE thinks you have a breakpoint set (perhaps from some previous debugging session).  I've seen this happen occasionally.  What version of the IDE are you using (or which IDE if not CubeIDE)?  You can try setting a breakpoint somewhere (anywhere), then select "delete all breakpoints" and see if that fixes it.

Hmmmm...  look at the call stack and see how it got to that function call.  That may give you a clue.

The absence of source shouldn't preclude the debugger from working, nor the stepping of code in assembler, at least until it gets to code for which it has source.

Libraries typically don't furnish source, at least directly, and may have paths to source that you don't have, or have some place else.

If the code is faulting, perhaps look at why that might be. Are you getting some usage fault due to an attempt to divide, or modulo, by ZERO?

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

Check the stack memory location and size.

Thanks all for your help. As @Bob S  suggests, STM32CubeIDE > Run > Remove All Breakpoints did the trick. Can't believe it was so obvious but I really don't know how these BP set up at this address.

Regards,