How do I debug an externally built executable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-14 04:40 PM
I built an elf executable for the STM32H743ZI. I did not create this executable from within STM32CubeIDE. Still, I would like to debug it from within STM32CubeIDE. How do I load the elf file in the STM32CubeIDE and debug the executable on a target (STM32H743ZI). Can this be done?
Solved! Go to Solution.
- Labels:
-
DEBUG
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-16 12:04 AM
The procedure described in the attached PDF works for me.
I used STM32CubeIDE v1.0.0 to generate "external ELF" and then used STM32CubeIDE v1.0.2 to debug this external ELF.
Regards,
Ethan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-14 06:20 PM
I think there is an Atollic type method using the debugger script to pull in, or associate, multiple files with the debug session. I think it was in the context of debugging a loader and application in a single session. The search here is frustrating, I will try and dig it out
In Keil it was possible to create a shell project, build it, then substitute the .AXF (ELF), and download and debug the project you want to look at. Keil also provides for a LOAD directive in the debugger command line, or debugger script.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-08-16 12:04 AM
The procedure described in the attached PDF works for me.
I used STM32CubeIDE v1.0.0 to generate "external ELF" and then used STM32CubeIDE v1.0.2 to debug this external ELF.
Regards,
Ethan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-16 11:30 AM
I found a different way that I prefer.
- File-> New-> C/C++ Project->
- Select ‘C Managed Build’
- Next > ->
- Project name: <this can be anything as long as there is not already a project in the workspace with the same name>
- Unselect ‘Use default location’ <This and the next step are optional, but I wanted to keep my STM32CubeIDE files 'close-to' my other files for the project>
- Location-> <I created a ‘STM32CubeIDEProject’ subfolder of the project to use simply because I didn't want the STM32CubeIDE files to be intermixed with my other project file>
- Select ‘Project type:-> Executable-> Empty Project’
- Select ‘Toolchains:-> MCU ARM GCC’
- Next >->
- Next >->
- <Select the MCU used -STM32H743ZI for this specific question>
- Finish->
- Answer ‘OK’ to override the project settings
- Next >->
- Select the new project name in ‘Project Explorer’->
- Project-> Properties-> Run/Debug Settings->
- New…->
- Select ‘STM32 Cortex-M C/C++ Application’
- OK
- Main->
- Select ‘Disable auto build’
- C/C++ Application: <browse to ELF file you built>
- Apply
- OK
- Apply and Close
- New…->
- Project-> Properties-> Run/Debug Settings->
AT THIS POINT, THE PROJECT CAN BE DEBUGGED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-17 06:34 AM
Even better File > Import > STM32 Cortex M executable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-17 06:53 AM
Absolutely true! Definitely the easiest way to solve the problem posed in the question.
My problem was a little different - I wanted to also be able to build my project via my own makefile using the STM32CubeIDE. Hence the new project creation in my answer. But I'm VERY glad someone else answered this as well - it took way too long for me to determine the solution.