[ABANDONED] How to debug elf file that was generated from a make file

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ABANDONED] How to debug elf file that was generated from a make file

    I have managed to instruct SES to build my elf file by calling a makefile (make all)

    Now, when I select debug/Go, I get a error saying No executable to debug.

    How do I instruct SES to point to my .elf file so that it can be debugged?

    I have attached a screenshot of the setting that I think should have worked but didn't.

    I have made sure that the elf file is in the SAME directory as the .emProject project
    Images
    • setting.jpg

      262.93 kB, 1,906×934, viewed 630 times
  • To highlight the problem better I did the following :-

    step 1) I used the project wizard to create a new Hello World program and tested that is ran with debugger. (worked just fine)
    step 2) I then created another project side by side but selected externally built executable (using same processor as above)
    step 3) I then copied the "Output\Debug\Exe\mydebug.elf" that was generated from step 1) to the root of the second project folder.
    ste4 4) I then experimented with the project settings to try and get it to reference the elf file (can't get this to work....!!)

    I even tried to manually edit the project file in notepad++ to see if I could hard code the path to the elf (executable) but that didn't work either...
    The line in question I was editing was :-

    build_output_file_name="$(ProjectDir)/Output/Debug/Exe/Test_Internal_Build.elf" />

    I even tried a direct path :- C:/Users/Robert/Desktop/test/ExternalElfDebug/Output/Debug/Exe/Test_Internal_Build.elf (failed also)

    Really at a loss here...... what is going on?
  • I didn't try an "external built" project yet, but I don't quite understand the purpose.
    If you build it with a make file inside your IDE and want to debug it afterwards in the IDE, you could do a normal "C/C++" project.
    I view it as an option for projects built with other toolchains, or self-build libraries.

    Anyway, one option would be to try Ozone as debugger.

    And second, I would try to set the "Debug->Debugger->Command Arguments" in the project options to the proper executable file name.
  • I already made the project name the same as the ProjectName.elf so the Debug->Debugger->Command Arguments >> $(ProjectName)$(EXE) is already correct.

    The linking that's done by the make file is too complicated for me to try to get SES to do the build/linking on its own hence best stick to just calling the make file as that works..

    I don't really want to use ozone as I'm used to Rowley Crossworks (not much different to SES) as I used that for 7+ years at my old job.

    If I get SES to debug an externally created elf, then I stand a chance of getting new company I work for to pay for a few licences...

    I could try a normal "C/C++" project...edit:- I tried this and this is not an option as there is NO Build command option under External Build options. Clean command is not available either for that matter.

    The post was edited 2 times, last by nibbly78 ().

  • As far as I understand it, Rowley/Crossworks only shares the GUI and some tool interfaces with SES (like the package manager GUI).
    The actual toolchain (compiler, assember, linker) are different, and package format (and thus packages) are different.
    As a consequence, the startup files and libraries ("standard C libs") are different.

    I do quite a few projects for STM32 MCUs, mostly based upon the "old" standard peripheral library which is not supported by ST (and SES) anymore.
    Copying in the old SPL sources and headers is not sufficient, I need to replace the device header (in <project dir>/<device-name>/Device/Include), the CMSIS system files (system_<device>.c and system_<device>.h in the same folder or the ../Source subfolder), and the whole CMSIS header folder. And some other stuff that goes too much into details ...

    This gets a bit tricky at times, but I would try to get the project to build in SES.

    nibbly78 wrote:

    I don't really want to use ozone as I'm used to Rowley Crossworks (not much different to SES) as I used that for 7+ years.
    Have you tried a "release" version built with Crossworks ?
    Their debug versions had the peculiarity to contain an endless loop in the reset handler, waiting for the debugger to connect.
    In other words, a Crossworks debug version does not run without the (appropriate) debugger.
  • This is the layout and settings that I have.

    $(ProjectDir)=C:/Firmware/MotorisedFaders/MyBranch/motor-firmware

    Inside of ProjectDir is another folder called MQ500MotorFader which is where the elf file MQ500MotorFader.elf is generated when the make file is called.
    So, SES has to debug >> C:/Firmware/MotorisedFaders/MyBranch/motor-firmware/MQ500MotorFader/MQ500MotorFader.elf

    Options>Debug>Working Directory = $(ProjectDir)/MQ500MotorFader
    Options>Debug>Command Arguments = MQ500MotorFader.elf

    What more do I need?
  • So, if I "modify" the project type from Externally Built Executable to >> Excutable, debug works which proves my paths etc to the elf file were correct all along. However, I lose the ability to call the make file to build etc.
    I then changed it back to Externally Built Executable to try something out then changed it to Excutable and now it can't find the elf file again even though the projects setting are the same to when it to worked temporarily..

    This feature is broken....

    The post was edited 1 time, last by nibbly78 ().