Reply
Posts: 3,100
Registered: ‎02-07-2002

Simplicity Studio linker script

[ Edited ]

Hi,

 

How is one supposed to change the linker script in Simplicity Studio for reducing the memory available to an application? I'm trying to build a bootloader and the Simplicity Studio flow is not described in the 4 bootloader AN's.

 

I found Project->Properties->C/C++ Build->Settings->GNU ARM C Linker->General->"Use custom linker script" but it doesn't create a default linker script for me. So I copied the one in "./GNU ARM v4.8.4 - Debug/" to the root of my project. But the linker cannot find it there if I reference it relatively. Please don't tell me that I have to use an absolute path to get it working.

 

Maarten

Posts: 210
Registered: ‎08-05-2013

Re: Simplicity Studio linker script

Hi

 

You may not have to create your own linker script if you only want to make some simple changes.

 

You can change the Stack and Heap sizes by setting an assembler macro __HEAP_SIZE and __STACK_SIZE.

 

In our next update, there will be an option in the project settings to change the default Flash and Ram Origin/Length settings. But as of now, you will have to copy the linker script into your project and edit the settings there.

 

You will want to use a macro to reference your script in Studio. The standard macro that we use is ${workspace_loc:/${ProjName}/[ file folder path in your project]}.

 

--Will

Posts: 2,027
Registered: ‎07-14-2007

Re: Simplicity Studio linker script

Hi Will,

 

In our next update, there will be an option in the project settings to change the default Flash and Ram Origin/Length settings.

Will there be also support for additional segments in the project settings? For example, changing the default sizes as you described, but also add some segments at given locations, etc. I haven't needed it yet, but maybe it's necessary for one of the next projects.

 

Regards,

 

Scotty

Posts: 3,100
Registered: ‎02-07-2002

Re: Simplicity Studio linker script

Thanks Will,


wicollin wrote:

In our next update, there will be an option in the project settings to change the default Flash and Ram Origin/Length settings. But as of now, you will have to copy the linker script into your project and edit the settings there.

 

You will want to use a macro to reference your script in Studio. The standard macro that we use is ${workspace_loc:/${ProjName}/[ file folder path in your project]}.

 

--Will


Since I don't have the next update yet, I'll use a copy Robot wink

Is copying from the output directory the recommended approach? It seems odd to do, but maybe it's perfectly ok.

 

Is there any place where I can find out about those macros? When I google "workspace_loc" I get an eclipse documentation page that has different macros from yours. Instead of your complex macro it has ${project_loc} but SS does not accept that.

 

Maarten

 

Highlighted
Posts: 210
Registered: ‎08-05-2013

Re: Simplicity Studio linker script

Hi

 

Will there be also support for additional segments in the project settings? For example, changing the default sizes as you described, but also add some segments at given locations, etc. I haven't needed it yet, but maybe it's necessary for one of the next projects.

 

The UI settings will only be for the basic Ram and Flash sizes. You'll need to override the linker script to add more support.

 

Is copying from the output directory the recommended approach? It seems odd to do, but maybe it's perfectly ok.

 

 

Yes, Studio copies the linker scripts directly from the SDKs for your current part family.

 

 

Is there any place where I can find out about those macros? When I google "workspace_loc" I get an eclipse documentation page that has different macros from yours. Instead of your complex macro it has ${project_loc} but SS does not accept that.

 

The linker script location option uses CDT macros, which unfortunately aren't the same as Eclipse macros. You could use ${ProjDirPath} but I wouldn't recommend it since that won't work with linked files.

 

--Will