Build & Debug broken after Renaming a Project

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

Build & Debug broken after Renaming a Project

Jump to solution
924 Views
brianheisler
Contributor II

With...

Kinetis Design Studio 3.1.0

Kinetis SDK 1.3.0

FRDM-K22F

OpenOCD

 

I have a demo project, "experiment", that builds with no errors or warnings. I can debug it successfully, set breakpoints, view variables, etc. This is great!

 

Then I rename the project to "helloworld" and from there forward the project goes to pieces.

 

Build works but it creates "experiment.elf" instead of "helloworld.elf". The IDE's debug feature won't launch "experiment.elf" so I fix the debug configuration to build "helloworld.elf" but it still creates "experiment.elf". (Yes, this is the only debug configuration.) From this point, there is little I haven't tried in terms of getting "helloworld.elf" to build, and I can force it to happen by manually editing the configuration file and doing clean builds (via the menu and by manually wiping out target files) but at no point do I seem to be headed in the right direction - the errors and bugs grow exponentially.

 

So... it's time to go back to the beginning.

 

How do I rename a project without breaking ANYTHING? (I say it this way because the solutions I've found on the web do not address this problem - the old naming persists and getting the debug to build and actually function properly as it did before just doesn't happen.)

 

Thanks for your help.

Labels (1)
0 Kudos
Reply
1 Solution
713 Views
brianheisler
Contributor II

Erich-

Thank you for the link.

That article pulls together most of what I'd learned the hard way and gave me a missing piece of the puzzle (Filter Deleted/Unavailable Projects in Debug Configurations). It seems that, even though it wasn't showing up, one of these hidden debug configurations was still being used (due to other project configuration problems?) which made everything fall apart upon launch. (This explains why I kept seeing the old elf file reappear.)

Furthermore, I suspect that workspace folder settings problems were contributing to the difficulties I was having in resolving this problem. For testing, I would import my “known good” project from a backup workspace into my active workspace then delete the project when it went bad. I repeated this process dozens of times all in the same active workspace. Then, at one point, I closed KDS, deleted the active workspace, restarted KDS (which triggered the creation of a new active workspace), and again imported my “known good” project from a backup workspace. This reduced the variety and frequency of strange errors I was having (missing files, etc.) and in concert with the information in the link you provided, a resolution to my issue soon followed.

I managed to reproduce my solution in a sequence of steps and will include documentation of it here for the sake of others who may experience similar difficulty.

(01)  (Project Explorer --> <OldProjectName>) : Rename <OldProjectName> to <NewProjectName>

(02)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Refresh Policy --> Resources) : Delete <OldProjectName> and add resource <NewProjectName>

(03)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Settings --> Build Artifact --> Artifact Name) : Delete <OldProjectName> and replace it with ‘${ProjName}’

(04)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Settings) : Click ‘OK’

(05)  (Run --> Debug Configurations --> <Icon: Filter Launch Configurations…: Down Arrow>) : Click to clear ‘Filter Deleted/Unavailable Projects’

(06)  (Run --> Debug Configurations) : Delete all debug configurations under ‘GDB OpenOCD Debugging’ that apply to <OldProjectName>

(07)  (Run --> Debug Configurations) : Select the remaining debug configuration under ‘GDB OpenOCD Debugging’ and change it’s name to ‘<NewProjectName>_Debug_OpenOCD’

(08)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Main --> Project) : Set to ‘<NewProjectName>‘

(09)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Main --> C/C++ Application) : Set to ‘Debug/<NewProjectName>.elf’

(10)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Debugger --> OpenOCD Setup --> Config options) : Set to ‘-f kinetis.cfg’

(11)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Debugger --> GDB Client Setup --> Other options) : Set to ‘-f kinetis.cfg’

(12)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD) : Click ‘Apply’

(13)  (Run --> Debug Configurations) : Click ‘Close’

(14)  (Project Explorer --> <NewProjectName> --> Debug) : Delete this folder (and it’s contents)

(15)  Open the project file ‘.cproject’ and replace each instance of <OldProjectName> with <NewProjectName> then save and close the file

(16)  (Run) : Debug

Thanks again for your assistance.

View solution in original post

0 Kudos
Reply
2 Replies
713 Views
BlackNight
NXP Employee
NXP Employee

Hi Brian,

I recommend that you have a read here: Renaming Eclipse CDT Projects | MCU on Eclipse

I hope this is helpful,

Erich

0 Kudos
Reply
714 Views
brianheisler
Contributor II

Erich-

Thank you for the link.

That article pulls together most of what I'd learned the hard way and gave me a missing piece of the puzzle (Filter Deleted/Unavailable Projects in Debug Configurations). It seems that, even though it wasn't showing up, one of these hidden debug configurations was still being used (due to other project configuration problems?) which made everything fall apart upon launch. (This explains why I kept seeing the old elf file reappear.)

Furthermore, I suspect that workspace folder settings problems were contributing to the difficulties I was having in resolving this problem. For testing, I would import my “known good” project from a backup workspace into my active workspace then delete the project when it went bad. I repeated this process dozens of times all in the same active workspace. Then, at one point, I closed KDS, deleted the active workspace, restarted KDS (which triggered the creation of a new active workspace), and again imported my “known good” project from a backup workspace. This reduced the variety and frequency of strange errors I was having (missing files, etc.) and in concert with the information in the link you provided, a resolution to my issue soon followed.

I managed to reproduce my solution in a sequence of steps and will include documentation of it here for the sake of others who may experience similar difficulty.

(01)  (Project Explorer --> <OldProjectName>) : Rename <OldProjectName> to <NewProjectName>

(02)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Refresh Policy --> Resources) : Delete <OldProjectName> and add resource <NewProjectName>

(03)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Settings --> Build Artifact --> Artifact Name) : Delete <OldProjectName> and replace it with ‘${ProjName}’

(04)  (Project Explorer --> <NewProjectName> --> Properties --> C/C++ Build --> Settings) : Click ‘OK’

(05)  (Run --> Debug Configurations --> <Icon: Filter Launch Configurations…: Down Arrow>) : Click to clear ‘Filter Deleted/Unavailable Projects’

(06)  (Run --> Debug Configurations) : Delete all debug configurations under ‘GDB OpenOCD Debugging’ that apply to <OldProjectName>

(07)  (Run --> Debug Configurations) : Select the remaining debug configuration under ‘GDB OpenOCD Debugging’ and change it’s name to ‘<NewProjectName>_Debug_OpenOCD’

(08)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Main --> Project) : Set to ‘<NewProjectName>‘

(09)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Main --> C/C++ Application) : Set to ‘Debug/<NewProjectName>.elf’

(10)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Debugger --> OpenOCD Setup --> Config options) : Set to ‘-f kinetis.cfg’

(11)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD --> Debugger --> GDB Client Setup --> Other options) : Set to ‘-f kinetis.cfg’

(12)  (Run --> Debug Configurations --> GDB OpenOCD Debugging --> <NewProjectName>_Debug_OpenOCD) : Click ‘Apply’

(13)  (Run --> Debug Configurations) : Click ‘Close’

(14)  (Project Explorer --> <NewProjectName> --> Debug) : Delete this folder (and it’s contents)

(15)  Open the project file ‘.cproject’ and replace each instance of <OldProjectName> with <NewProjectName> then save and close the file

(16)  (Run) : Debug

Thanks again for your assistance.

0 Kudos
Reply