Debugger reports: Can't find a source file at "C:\Projects\USB-MSD-2\Debug/../Sources/main.c"

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

Debugger reports: Can't find a source file at "C:\Projects\USB-MSD-2\Debug/../Sources/main.c"

Jump to solution
4,450 Views
davepfaltzgraff
Senior Contributor I

I renamed a project to start a new effort. When I defined a new debug (SEGGER J-Link) configuration, everything seemed to be OK until I tried to step through the program. At that point the debugger shows a blank screen with the message:

 

Can't find a source file at "C:\Projects\USB-MSD-2\Debug/../Sources/main.c"

 

My project is located at C:\Projects\MQX-HelloWorld and I am unable to find where the debugger is getting the old information.

 

Where is this information defined, or where can I find the documentation on (correctly) setting up a new debugger configuration?

 

Thanks

Labels (1)
0 Kudos
1 Solution
2,672 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

1) Sometimes , after build , if there is no .elf file , please refresh the project :

pastedImage_0.png

then when you debug , you will see the file and the debug configuration . please try .

2) if it still have not the debug configuration you need, double click "SEGGER J-Link Debugging"

pastedImage_1.png

Pay attention : use SEGGER J-Link Debugging , we need configure the "Device name" manually .

pastedImage_2.png

3) if you still not solve it , please send you project to me .

View solution in original post

0 Kudos
11 Replies
2,672 Views
davepfaltzgraff
Senior Contributor I

If you follow the thread, it becomes clear that the problem originated with my sequence of renaming the project as well as the the subdirectory. The specifics of what happened are unknown.

In this case, I regenerated the entire project from scratch and was successful in taking the project through compile to full debug. This was then submitted to version control and replicated on a different PC. This was one of my primary objectives in that now I have a working base on which to build other projects.

Along the way, I found that it is VERY important to "delete" the project (NOT the files) in KDS when moving from one system to another.

This issue is now closed. (Finally!)

0 Kudos
2,672 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi David,

Do you use the KDS ? Which version ?

And in the same time , i recommend you open only one project .

Could you tell me how to repeate your problem ?  i will test on my side .

BR

Alice

0 Kudos
2,672 Views
davepfaltzgraff
Senior Contributor I

I'm using the latest KDS - 2.0.0.

Generally I have only one project active at a time. I can try going back to an empty workspace and re-importing this one to see if it makes a difference (tomorrow).

I started a project at C:\Projects\USB-MSD-2. When I realized that this was not an appropriate name, I renamed it and changed the name of the directory in Windows. (Not sure of the exact order there.) When I finished writing my code and got a clean compile, I went to debug it. For whatever reason, the was no debug configuration in the list for the SEGGER J-Link. So, I created a new one and worked from there. It wasn't until I went to set a breakpoint that I ran into the problem.

In an attempt to correct this, I deleted the other debugger configurations that were there (PE and ??), but the problem remained.

When the message pops up, I am given an opportunity to select the file directly, but that seems to be a temporary thing. It's not long until the message pops up again.

Knowing my luck, I rather doubt you'll be able to replicate it, but...?

Thanks

0 Kudos
2,673 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David,

1) Sometimes , after build , if there is no .elf file , please refresh the project :

pastedImage_0.png

then when you debug , you will see the file and the debug configuration . please try .

2) if it still have not the debug configuration you need, double click "SEGGER J-Link Debugging"

pastedImage_1.png

Pay attention : use SEGGER J-Link Debugging , we need configure the "Device name" manually .

pastedImage_2.png

3) if you still not solve it , please send you project to me .

0 Kudos
2,672 Views
davepfaltzgraff
Senior Contributor I

Hi Alice,

Earlier today I marked this as "Answered", but something is still not right. When I did the "Refresh" operation it seemed to be OK. I had a meeting to go to, so I closed KDS and came back to it a bit ago. I was not able to set breakpoints properly. I would set a breakpoint in the code view, but when I clicked on the breakpoint in debug view, it would merely report "No details to display for the current selection."

I deleted the debug configuration file I had and generated a new one. It didn't help, so attached is my project file. In my system, the directory structure is C:\Projects\MQX-HelloWorld.

Thanks for looking this over.

0 Kudos
2,672 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello David ,

I found you refer to here : How To: Create a New MQX RTOS for KSDK Project in KDS ,

so i refer to it create a test ,it can work well ,please see the attachment.

And i also checked your project , for you have did a lot , so in short time i can not find the problem.

And my project is the same with yours , so could you  try it on your side , if it can work well , could you use it ?

Best Regards,

Alice

------------------------------------------------------------------------------------------

If this post answers your question, please click the Correct Answer button.

-----------------------------------------------------------------------------------

If this post help your question, please click the helpful Answer button.

0 Kudos
2,672 Views
davepfaltzgraff
Senior Contributor I

Hi Alice,

When I got into the details of the project, I found the following:

pastedImage_0.png

See the highlighted section. This is clearly a remnant from your system and as such cannot be ported to any other system. As it stands, I cannot make sense of the various project settings as you have given them to me. For example the C compiler include parameters are different if I look at the properties for the project versus the properties for the Sources folder.

Also, I don't understand the little icon at the Sources folder. What does that mean?

0 Kudos
2,672 Views
mike1974
Contributor III

"Also, I don't understand the little icon at the Sources folder. What does that mean?"


I had this same problem, took me a while to figure it out.


What happened was, at some point in the past you right clicked on the Sources folder, and changed something in the properties (such as an include path).  Once you've done that, KDS thinks you want special "per file" properties for this folder instead of just using the properties for the whole project.


To fix this, simply right click on the folder, and select "Resource Configurations --> Reset to Default".  A window pops up asking you to select the resource (your Sources folder in this case).  Select it and click "Ok".


Also this helps explain some of the icons you may see in KDS:

Icon and Label Decorators in Eclipse | MCU on Eclipse


Hope this helps,


Mike

0 Kudos
2,672 Views
davepfaltzgraff
Senior Contributor I

Hi Alice,

I downloaded the file and unzipped it into C:\Projects\mqx_hello_frdmk22_test1 and then imported it into KDS. When I did the import, I got:

pastedImage_0.png

I clicked on "yes" and then did a "clean" and tried to build. I got:

====

../Sources/main.c:3:17: fatal error: bsp.h: No such file or directory

#include <bsp.h>

====

I will investigate later, but I have some meetings to run to.

Thanks

0 Kudos
2,672 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi David,

Please put the project into your " workspace.kds " .

,

.

I have test it on my side, change the project to other workspace ,then open KDS in that workspace , the import the project ,it also show the screenshot you said,\

while after click yes , build, debug ,it can work well .

BR

Alice

0 Kudos
2,672 Views
davepfaltzgraff
Senior Contributor I

It appears that the "Refresh" took care of the problem.

I was able to reconstruct what I did wrong. The sequence that I did was:

1. Rename the project

2. Close KDS

3. Rename the directory in Windows

4. Opened KDS

5. Deleted the project in KDS

6. Imported the project from the new directory.

My mistake is that after renaming the project, I should have deleted the project before closing KDS - a step 1a.

Thanks for your help.

0 Kudos