Forum: System Workbench for STM32

Cannot Step Through Source Code

I have this error appear when I start a debugging session:

 
No source available for "main() at 0x800d520"

I cannot step through source code, but I can step through assembly code.

This is an STM32CubeMX Version 4.14 generated project. When the project was imported into Eclipse the “Copy projects into workspace” checkbox was unchecked. That the files are linked to is confirmed in the Microsoft WIndows Explorer where I see the source code related directories are empty, and I see mostly files with the extension .o in the Debug directory.

STM32CubeMX did generate code in the System Workbench workspace, just I set it up to do.

To be sure that nothing go accidentally corrupted I deleted the Eclipse project files, regenerated the code in STM32CubeMX, and imported the project into Eclipse exactly as instructed in:
http://www.openstm32.org/Importing+a+STCubeMX+generated+projectQuestion
The debugger was still not able to find the source code.

What do I need to do to make the source code available to be stepped through?

This problem is solved. This is what I did to solve it:

With the project selected in the Project Explorer panel I did these settings:

Project => Properties => C/C++ Build (Tree) => Settings => Tool Settings (Tab) => MCU GCC Compiler (Tree) => Optimization
In the “Optimization Level” list box field I selected “Optimize for Debug (-Og)

Project => Properties => C/C++ Build (Tree) => Settings => Tool Settings (Tab) => MCU GCC Compiler (Tree) => Debugging
In the “Debug Level” list box field I selected “Maximum (-g3)”