Tuesday, May 22nd 2018, 8:21am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Gossamer

Beginner

Date of registration: Apr 23rd 2018

Posts: 2

1

Tuesday, April 24th 2018, 12:56pm

Project template configurations

Hi,

I would like to make a template for different type of uC that would use some generic parameters across. I was looking at the configuration and couldnt find a proper way to do it.
What I want is to have configuration for CortexM0 (which would append something to preproc definitions and add user include directories) similar for CortexM3 and M4.
I dont want to see other build settings then Debug and Release.
I was trying to achieve this with following:

Source code

1
2
3
<configuration name="CortexM0">      <property name="c_preprocessor_definitions" value="__CM0__" />    
      <property name="c_user_include_directories" value="$(CPPLibrary)/CortexM0;$(CBZCPPLibrary)" /> 
      <property name="hidden" value="Yes" />     </configuration>


and then in my project configuration to do something like:

Source code

1
<configuration name="Debug" inherited_configurations="CortexM0;Debug" />


that doesnt seem to work. It just creates Debug but does not inherit anything

Other idea was to use something like:

Source code

1
2
<configuration name="Debug M0" inherited_configurations="CortexM0;Debug" />
<property configuration="Debug" name="hidden" value="Yes" />


Which I would expect to have only Debug M0 in the options, but it also shows Debug as build option... So I have ("Debug", "Debug M0", "Release", "Release M0" which is just clatter in UI.

Any neat way to achieve such functionality ?

Thanks

SEGGER - Johannes

Super Moderator

Date of registration: Aug 31st 2012

Posts: 379

2

Wednesday, April 25th 2018, 10:55am

Hi,

Your idea is going into the right direction.

Embedded Studio has two types of configurations:
Public Configurations, which are the build configurations you can select
and Private Configurations, which can only be inherited by Public Configurations.

In your case you would want the private configurations Debug, Release, CortexM0 and CortexM3 and the public configurations Debug M0 (inherits Debug and CortexM0), Debug M3 (inherits Debug and CortexM3), Release M0, and Release M3.

What probably went wrong is that you already have the public configurations Debug and Release.
You can remove them (or make them private by adding <property name="hidden" value="Yes" />).

You will also need to make sure that configuration names are unique.
You cannot have a public and private configuration with the same name.

Regards
Johannes

Gossamer

Beginner

Date of registration: Apr 23rd 2018

Posts: 2

3

Wednesday, April 25th 2018, 8:55pm

I am not sure if I am doing something wrong, but I am still getting "Debug, Debug M0, Release, Release M0". And if I delete Debug or Release it also deletes all of the settings, so I dont have DEBUG preproc in "Debug M0".

this is what I am getting after the code is generated

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 <configuration Name="Debug M0" inherited_configurations="CortexM0;Debug" />
  <configuration
    Name="CortexM0"
    c_preprocessor_definitions="__CM0__"
    c_user_include_directories="$(CPPLibrary)/CortexM0;$(CPPLibrary)/devices;$(CPPLibrary)"
    hidden="Yes" />
  <configuration
    Name="Debug"
    c_preprocessor_definitions="DEBUG"
    gcc_debugging_level="Level 3"
    gcc_optimization_level="None" />
  <configuration
    Name="Release M0"
    inherited_configurations="CortexM0;Release" />
  <configuration
    Name="Release"
    c_preprocessor_definitions="NDEBUG"
    gcc_debugging_level="None"
    gcc_omit_frame_pointer="Yes"
    gcc_optimization_level="Level 1" />


and this is the actual template:

Source code

1
2
3
4
5
6
  <project cpu_manufacturer="Generic" cpu_generic_name="Cortex-M" name="Cortex-M Executable" description="A C/C++ executable for a CM0." type="Executable" template_name="CM_EXE" order="-3" target_select="yes">

      <configuration name="Debug M0" inherited_configurations="CortexM0;Debug"/>
      <property configuration="Debug" name="hidden" value="Yes" />
      <configuration name="Release M0" inherited_configurations="CortexM0;Release"/>
      <property configuration="Release" name="hidden" value="Yes" />


why are Debug and Release still visible ? how do you distinguish between private and public configuration?

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Friday, April 27th 2018, 9:21am

Hello,

Quoted

how do you distinguish between private and public configuration?

For reference, if you open the emproject file from a generic ES project generated by the project wizard you will see one private configuration which is Common and two public ones which are Debug and Release.
Debug and Release inherit from Common.
The difference syntax wise is that Common is encapsulated by:

Source code

1
2
3
<project Name="YourProjectname"> 
...
</project>


The public configs simply follow below that.
What you can do with public configs is to hide them so only public configs that you really want to have displayed are shown.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/