cancel
Showing results for 
Search instead for 
Did you mean: 

Code Generator in an example project insists on linked files

tinkerer42
Associate III

Hi,

The folder structure of example projects is different than a project created from scratch: Most source files sit outside the root folder of the Eclipse project (which is where the .project and .cproject files are) and are therefore added to the project as linked resources. This is inconvenient for me and I actually changed that successfully (moved source folders, fixed include paths etc) and it compiles and runs as before. So far,  so good. However, when re-generating with the Device Configuration Tool (Code Generator), it gets back to as it was before (linked files), and I can't find anywhere to control this annoying behavior!

The example project was created by going to File-->New-->STM32 Project-->Example Selector tab. This is in contrast with my normal way of creating a new project - File-->New-->STM32 Project-->MCU/MPU Selector tab.

To illustrate the problem, some screenshots:

This is how the project looks like when it was created. Notice that almost all the source files have the little arrow in the bottom-right of their icon, noting they are linked resources (they actually live outside the Eclipse project's root):

tinkerer42_0-1691533864366.png

I fixed it by moving the Eclipse project files to the root of the project, removing the "Application" folder that hosted mostly links, moving the very few "real" files from there to their "usual" place (usual as in projects created normally, not with the "example selector"), fixed include paths etc. It compiles and runs. It looks like this (see how the files are real files under the project root, not linked resources, and the "Application\User" folder is removed):

tinkerer42_3-1691534544581.png

Seems like all is good, right? well, now I want to start tailoring the example for my use-case, so I want to make some changes in the .ioc file ("Device Configuration Tool"). But if I re-generate code in the tool (even without making any actual changes in the configuration), I get this ugly thing back:

tinkerer42_1-1691534490292.png

See how this "Application\User" folder came back from the dead, with its linked resources. I searched for a long time to find where can I change this behavior of the Device Configuration Tool, but didn't find it. The Code Generator doesn't do this for projects created from scratch.

I tried deleting the .mxproject file as well as the .extSettings file (which mentions some folders) but it didn't have any effect. I even searched all the project's folder structure for the text string "Application\User" (or "Application/User"), hoping to find some settings file that instructs it to create this folder, but couldn't find such a string. Deleting files under the ".settings" folder also didn't have any effect.

How can I make the Code Generator behave "normally", like in all my other projects that weren't created from an example? I have some external tools and other working conventions that clash with this "linked resources" approach, so I really want to change it.

Any help or insight would be appreciated!

Thanks,

Guy.

 

1 REPLY 1
tinkerer42
Associate III

For anyone interested, I solved this on my own some time after I asked here.

I did two things that helped: added the following line to the .ioc file:

ProjectManager.UnderRoot=true

I also removed this line from the .ioc:

ProjectManager.ExampleSource=MxCubeFw

and removed these lines from the .project file (this might happen automatically after code generation when doing the above changes, don't remember):

<nature>com.st.stm32cube.ide.mcu.MCUNonUnderRootProjectNature</nature>
<nature>com.st.stm32cube.ide.mcu.MCUCubeImportedExampleProjectNature</nature>

This solved my issue.