[SOLVED] Project template configurations

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] 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. <configuration name="CortexM0"> <property name="c_preprocessor_definitions" value="__CM0__" />
    2. <property name="c_user_include_directories" value="$(CPPLibrary)/CortexM0;$(CBZCPPLibrary)" />
    3. <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. <configuration name="Debug M0" inherited_configurations="CortexM0;Debug" />
    2. <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
  • 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
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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. <configuration Name="Debug M0" inherited_configurations="CortexM0;Debug" />
    2. <configuration
    3. Name="CortexM0"
    4. c_preprocessor_definitions="__CM0__"
    5. c_user_include_directories="$(CPPLibrary)/CortexM0;$(CPPLibrary)/devices;$(CPPLibrary)"
    6. hidden="Yes" />
    7. <configuration
    8. Name="Debug"
    9. c_preprocessor_definitions="DEBUG"
    10. gcc_debugging_level="Level 3"
    11. gcc_optimization_level="None" />
    12. <configuration
    13. Name="Release M0"
    14. inherited_configurations="CortexM0;Release" />
    15. <configuration
    16. Name="Release"
    17. c_preprocessor_definitions="NDEBUG"
    18. gcc_debugging_level="None"
    19. gcc_omit_frame_pointer="Yes"
    20. gcc_optimization_level="Level 1" />
    Display All


    and this is the actual template:

    Source Code

    1. <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">
    2. <configuration name="Debug M0" inherited_configurations="CortexM0;Debug"/>
    3. <property configuration="Debug" name="hidden" value="Yes" />
    4. <configuration name="Release M0" inherited_configurations="CortexM0;Release"/>
    5. <property configuration="Release" name="hidden" value="Yes" />


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

    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. <project Name="YourProjectname">
    2. ...
    3. </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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.