MCUXpresso Project Explorer does not show source files while debugging an ELF project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCUXpresso Project Explorer does not show source files while debugging an ELF project

835 Views
CurtisL
Contributor I

I have inherited a project where cmake creates an ELF. By following this post (MCUXpresso IDE - NXP Community), I can load the project. Debugging works - I start in my source file with my main function. I can step into other files in my project and set break points.

The only problem is that the Project Explorer windows does not show my source code. It only shows code from the default project for the processor. Is there a way to import my source along with the ELF?

MCUXpresso.png

Steps to create project:

1) Create a new C/C++ Project, choose processor (MK60DN512xxx100), next, finish

2) Run->Debug Configuration, Choose GDM PEMicro Interface Debugger

3) On the main tab, I select my ELF file. Apply, Close

4) Project->Build All

5) Run->Debug Configuration, Click Debug

Windows 11

MCUXpresso Version 11.9.1

PEMicro Multilink Universal FX

 

 

 

0 Kudos
Reply
5 Replies

793 Views
CurtisL
Contributor I

Hi Edwin,

I have all the source file for the ELF files and compiled them on my computer. When I start the debugger, the IDE brings up MY source file (mqx_main.c) that contains the entry point for the executable. This file has the correct code and path. I can step into other files (e.g. mqx.c), set break points and run code.

My problem is that I cannot see my files in the Project Explorer window. This means I have no way set break points in other files.

If you look at my picture, MK60D10_Project.c from the board SDK is in Project Explorer window but neither mqx_main.c or mqx.c are there.

Thank you,

Curtis

0 Kudos
Reply

794 Views
CurtisL
Contributor I

I have the code locally which I have compiled into an ELF file. The IDE can find my file mqx_main.c which contains the entry point for my executable. 

When I start the debugger, execution is halted at the appropriate line in that file. I can step into mqx.c (another of my files) without any problem. 

The problem is I cannot see my file in the Project Explorer window.

0 Kudos
Reply

777 Views
AdrianOltean
NXP Employee
NXP Employee

Please have a look at ch. "Importing existing executables" from MCUXpresso IDE User Guide. The IDE offers a dedicated import wizard for executables. Please pay attention to all the project settings (e.g. memory map, core, device, board, etc.) because they can all have an impact on the debug experience. You won't be able to build project though (you do this externally with your CMake build system).

Regarding the availability of the source files in Project Explorer, you can link the actual (locally hosted) source folders to the newly created project. Note that once you import an executable, the resulted project is simply a container for the executable and for a set of settings that allow debugging. You can even debug an executable that's built on some other machine, copy sources from the remote machine and then create a source mapping further used by GDB during debug. The use case can get pretty complicated...

Thanks,

Adrian

0 Kudos
Reply

758 Views
CurtisL
Contributor I

"Regarding the availability of the source files in Project Explorer, you can link the actual (locally hosted) source folders to the newly created project"

This is exactly what I need to do but I do not know how to do it. 

0 Kudos
Reply

806 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @CurtisL,

I'm not sure I quite understand what your setup is like. Do you have the original project, or are you uploading an ELF file of a project you currently don't have? If this is the case, I'm afraid you would require the original project files in order to see the sources of said project. You are not able to obtain a whole project's sources files only from the generated ELF file, I'm afraid.

BR,
Edwin.

0 Kudos
Reply