I am developing a project for a S32K144-based system using S32DS 3.4 on Windows. When creating a new project, the linker file used for the project is stored within the following directory:
"C:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.3\platform\devices\S32K144\linker\gcc"
I will refer to this directory as the "Shared Linker Directory" going forward.
I can see the linker file within the "<project>/Project_Settings/Linker_Files/" directory in the IDE, however it is just a shortcut to the file in the "Shared Linker Directory" and it does not actually exist in the project. Here is an example using the flexcan_encrypted_s32k144 demo.
I would like to store the linker file within the project itself so that changes may be reflected on GitHub, and I have a few questions related to this:
1. I have found that the path in Properties → C/C++Build → Settings → Standard S32DS C Linker → General -> "Script file (-T)" to be:
"${workspace_loc:/${ProjName}/Project_Settings/Linker_Files/S32K144_64_flash.ld}"
It seems to me that this should refer to the internal project directory and not the "Shared Linker Directory". Why is that not the case?
2. I manually changed the directory in question 1 to "../Project_Settings/Linker_Files/S32K144_64_flash.ld", and put a modified linker file in the "<project>/Project_Settings/Linker_Files/" directory. This allows the project to use the modified linker file rather than the default one, and for the file to be pushed to GitHub, as desired. However, the files listed under "<project>/Project_Settings/Linker_Files/" when viewed using the IDE are still the linker files located at the "Shared Linker Directory" directory rather than the linker files located within the project. (I.e., if I open one of the files listed here, it opens the file that is stored at "Shared Linker Directory".)
How can I update the project so that the files listed under the "<project>/Project_Settings/Linker_Files/" directory within the IDE are actually the files that are located within my project?
3. Is there a way when creating a new project or loading in an example project to have all of its project settings files (linker, startup, etc.) be independent immediately and not from the shared s32ds directory? In other words, not have to manually change the directories each time? Let me know.
Thanks in advance!
Solved! Go to Solution.
Hi @aipers,
I see, I think the issue may lie in importing a project, rather than creating a new one to configure. Could you try creating one and copying over the configuration?
"File -> New -> S32DS Application Project"
Best regards,
Julián
Hi @aipers,
1. I am not sure how you have concluded that the linker file shown in the workspace is actually a shortcut. You can actually look for the file by using the "Show in file explorer" option:
This shows the files under the workspace directory. The shared linker directory is used but only as reference for creating the project. Not when editing the file.
"${workspace_loc:/${ProjName}/Project_Settings/Linker_Files/S32K144_64_flash.ld}" does refer to the internal project directory, not the shared one. "workspace_loc" simply returns the workspace directory (e.g. C:\Users\user\workspaceS32DS.3.5) and "project_name" returns the name of the current project, giving a full directory to the current project.
2. I have opened this file from VS Code and edited just to see the changes reflected in S32DS.
Are you unable to edit the linker file in your project?
3. Currently it is not supported to change the configurations for project creation, but I suppose you could edit the tpl.sdk.s32k1xx.4_0_3.xml file which is the template file.
I would not recommend doing this since S32DS has all the configurations for the S32K families to work correctly. Editing any wrong parameter may lead to undesirable behavior out of our scope of support.
Best regards,
Julián
Hi @Julián_AragónM , thank you for the fast response!
1. I am unfortunately unable to emulate the behavior you are showing with your linker file. When I click "Show In -> System Explorer", I am taken to the shared linker filer directory and not the workspace directory, as shown below. I have not changed anything in the settings and the script files -T is still set to " "${workspace_loc:/${ProjName}/Project_Settings/Linker_Files/S32K144_64_flash.ld}".
2. When I open the project in VSCode, the linker file does not appear/exist because it is a shortcut and not actually saved in the workspace as mentioned above.
Please let me know if there was anything you did on your side or if you changed any settings to have the linker file saved in the workspace.
3. That makes sense, I won't touch project setup config for now.
Thanks again!
Hi @aipers,
I see, I think the issue may lie in importing a project, rather than creating a new one to configure. Could you try creating one and copying over the configuration?
"File -> New -> S32DS Application Project"
Best regards,
Julián
Hi @Julián_AragónM,
Yes this works. When I look for the linker file for the new application project it is properly in the project's directory. Thanks for your help!
However, I am hoping to make changes to the linker file of an example projects, but I don't want it to carry across to other example projects, as they will get it from the shared linker directory at the moment. Any solution to that?
I noticed that the linker path in the project settings is different for the new application project:
"${ProjDirPath}/Project_Settings/Linker_Files/S32K144_64_flash.ld"
This clearly represents the project's internal directory, but it is still odd to me that the example project settings do not point to the internal project directory as you mentioned they should with their path in you previous reply. Putting it again here for reference:
"${workspace_loc:/${ProjName}/Project_Settings/Linker_Files/S32K144_64_flash.ld}"
Any ideas?
Thanks, again.
Hi @aipers,
I'm not sure how to modify the direct script when importing an example, since (again) this goes out of scope of support modifying the .xml or script files for eclipse functionality. My recommendation is to either create new projects and copy over the configuration or simply creating a new linker file inside the project settings.
I apologize for the inconveniences.
Best regards,
Julián