cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain the dwarf2 file to simulate with proteus isis

VRami.1
Associate III

Hi all, I'm trying to simulate a project for an STM32F103C6 in proteus ISIS but for debug purposes labcenter's people says that I need the .elf file and the dwarf2 file (both of them in the same folder), then I' found that GCC generates the dwarf 2 file with the option -gdwarf-2 what I've put in Project Properties -> Build steps and in the pre-build command I've wrote the command -gdwarf-2, it didn't worked so I've changed the command to the post-build commands in the same tab. I've also noted that in Tool Settings are several options for what I think is to choose the type of dwarf file that is going to be made during compilation but the only options are none, minimal (-g1), default (g) and maximum (-g3).

After I did this the output of the compilations shows the following message:

20:27:10 **** Incremental Build of configuration Debug for project Cubex ****

make -j4 all 

gdwarf-2

make (e=3): El sistema no puede encontrar la ruta especificada.

make[1]: [makefile:81: pre-build] Error 3 (ignored)

arm-none-eabi-size  Cubex.elf 

  text   data   bss   dec   hex filename

 16752    20   1796  18568   4888 Cubex.elf

Finished building: default.size.stdout

20:27:28 Build Finished. 0 errors, 0 warnings. (took 17s.509ms)

What I suppose means that it couldn't make the dwarf2 file due the message "El sistema no puede encontrar la ruta especificada" (The system can not find the specified path).

Can anyone help me and explain how to obtain the needed files. Thanks in advance for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
VRami.1
Associate III

Finally solved, a more experienced friend found where to put the flag -gdawrf-2 in STM32Cube IDE and its shown in the attached picture

0693W000003BcemQAC.png

It was in the Properties -> C/C++ Build -> Settings -> Tools Settings -> MCU GCC Compiler, then the flag could be added in the Other flags fields.

After that we can debug code inside Proteus.

View solution in original post

3 REPLIES 3

Going to want to query the specific tools running what parameters they are expecting, and look at a) the command line sent to the linker, and b) what the error reports exactly.

These aren't my tools, you'll need to look at the expectations, and fulfill them. As far as I'm aware .ELF files could contain significant debug info and symbols. Also default debug output modes without explicitly doing -gdwarf-2 or -gdwarf-3, or whatever version that is inherently output.

Proteus support might have better ideas about what specific tools need which settings to get the desired combination of files.

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

Hi Clive, well, labcenter's people specifficaly designed their suite to work with dwarf2 files, they say that the project in Proteus needs the .elf file and the dwarf2 file but in their example projects are debug files with only the .elf and I read around there that .elf files and have the complete information so if I obtain the .elf in dwarf2 format I'll be grateful.

Originally STM32Cube IDE gives a .elf file but if I remember well the format is dwarf4 and I need dwarf2. in the options for the project in the IDE

like is seen in the following image can be seen the dwarf possible options to make the debug file but I think none of those are the needed options

0693W000001ryFzQAI.png

then I saw the tab Build steps and I after that I included the command -gdwarf-2 like is seen in the following image but it didn't work nor in pre-build steps nor in post-build steps.

0693W000001rsMGQAY.png

Today I know (I think) that the error

gdwarf-2
make (e=3): El sistema no puede encontrar la ruta especificada.
make[1]: [makefile:81: pre-build] Error 3 (ignored)

is because make is looking for something that it coulnd't find and because of that the dwarf 2 file is not created but I don't know if I'm following the correct steps to do what I need, I really need detailed instructions because I'm very new to this. Even I don't know if I need to deactivate the default dwarf options shown in the first image to obtain the dwarf-2 file or I need to put some aditional route somewhere tho avoid the error "El sistema no puede encontrar la ruta especificada" (The system cannot obtain the specified path).

Almost forgot, proteus gives me the following error when I try to simulate the project with de default dwarf that STM32Cube gives

[ELF] Unrecognized attribute form code 17 [U61_CM3CORE]
[ELF] ELF file corrupt or loader error at location 131150 [U61_CM3CORE]
Failed to load ELF file '..\..\..\..\Desktop\Cube\Cubex2\Debug\Cubex.elf' [U61_CM3CORE]
Firmware can't be loaded due to error [U61_CM3CORE]
Real Time Simulation failed to start.

so, labcenter usually ask for the complete project but when they see that the file doesn't have the format needed then they announce it and put the development of the loader in the queue (I suppose that if enough people ask for that then they creates the loader), this is one of those cases.

Roughly the above error simply means that the .elf file is not in the format supported by proteus so my only option is to solve the problem in the IDE or take all the files to the proteus IDE and I want to try first here.

Any help to obtain the dwarf-2 file will be greatly appreciated.

NOTE: Like

VRami.1
Associate III

Finally solved, a more experienced friend found where to put the flag -gdawrf-2 in STM32Cube IDE and its shown in the attached picture

0693W000003BcemQAC.png

It was in the Properties -> C/C++ Build -> Settings -> Tools Settings -> MCU GCC Compiler, then the flag could be added in the Other flags fields.

After that we can debug code inside Proteus.