This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Segger Embedded Studio: Debug and Release build configurations

I created two build configurations a Debug and a Release in SES IDE.

Build > Build Configurations...

I wanted to select the  DEBUG_OPTIMIZATIONS level for the Debug build configuration and the SPEED_OPTIMIZATIONS for the Release one.

In Project Explorer, select the top Solution then select the 'Debug' build Configuration

Project > Configure nRF Connect Project... > DEBUG_OPTIMIZATIONS > Configure > Save solution (if prompted)

Then in Project Explorer, select the top Solution then select the 'Release' build Configuration

Project > Configure nRF Connect Project... > SIZE_OPTIMIZATIONS > Configure > Save solution (if prompted)

However, when I go back and select the 'Debug' build configuration to view its optimisation setting I find

Project > Configure nRF Connect Project... > SIZE_OPTIMIZATIONS   

NOT DEBUG_OPTIMIZATIONS as expected.

It looks like whichever build configuration is set last overwrites the other one.

Can you please tell me what I am doing wrong.

Thank you.

Mohamed Belaroussi

Parents
  • This seems like a bug in SES, I can report it, I assume you are using v4.52?

    In the meantime you can also control this in prj.conf by setting e.g. CONFIG_DEBUG_OPMTIMIZATIONS=y

  • Thank you Kenneth.

    I don't use the command line tools. I am using SES IDE and like any other IDE I used before I should be able to set debug and release configurations within SES Nordic Edition. I tried to get help from Segger but they directed me to Nordic because SES (Nordic Edition) is not supported by Segger. 

    I don't know how this can be done in SES, but

    If you don't know how it can be done maybe you can ask one of your colleagues or even Segger.

    I asked this question over six months ago, I was hoping by now someone somewhere would have figured out how to do this within SES. As I said earlier Segger were not willing to help me but if someone from Nordic approached them they might be be more accommodating.

    While waiting for a resolution to my ticket I am using two project configuration files prj-debug,conf and prj-release.conf, an extract from the two variants is shown below. My question is this,

    Do I need to remove the logging configurations (text in blue below) from the release project file prj-release.conf ?

    prj-debug.conf

    ---------------------

    ...

    ### COMPILER OPTIONS ###
    #
    CONFIG_DEBUG_OPTIMIZATIONS=y

    ### Logging ####
    #
    # For the PID 4 hardware we must set CONFIG_SERIAL=n because otherwise the SPI CS/BUSY
    # pins will be allocated to UART0 CTS/RTS pins.
    CONFIG_SERIAL=n
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    #CONFIG_UART_CONSOLE=n
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_PRINTK=y

    ...

    prj-release.conf

    ----------------------

    ...

    ### COMPILER OPTIONS ###
    #
    #CONFIG_CODING_GUIDELINE_CHECK is not set
    # CONFIG_NATIVE_APPLICATION is not set
    CONFIG_SIZE_OPTIMIZATIONS=y
    CONFIG_SPEED_OPTIMIZATIONS=y
    CONFIG_DEBUG_OPTIMIZATIONS=n
    # CONFIG_NO_OPTIMIZATIONS is not set
    CONFIG_COMPILER_OPT=""
    # end of Compiler Options

    ### Logging ####
    #
    # For the PID 4 hardware we must set CONFIG_SERIAL=n because otherwise the SPI CS/BUSY
    # pins will be allocated to UART0 CTS/RTS pins.
    CONFIG_SERIAL=n
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    #CONFIG_UART_CONSOLE=n
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_PRINTK=y

    ...

    Kind regards

    Mohamed

  • Hi Kenneth,

    Maybe I did not make myself very clear in my previous message.
    I inherited the CMakelists.txt from a colleague not from ncs.
    I would appreciate it a great deal if you could address the following:
    I still cannot create debug and release configurations in SES. I asked this question over a year ago in this ticket but I still don't know how to do it. Can you help?
    Kind regards
    Mohamed
  • If you take a random application example, e.g. nRF Desktop which have a lot of build types:
    nrf\applications\nrf_desktop

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf_desktop/README.html#selecting-a-build-type 
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/nrf_desktop/README.html#nrf-desktop-requirements-build-types 

    Does that work as you expect? I don't understand what problems you may have, since there are examples that already does this that you should be able to compare with.

    Kenneth

  • Thank you Kenneth.

    I should be able to build different build configurations in SES e.g. 'debug' or 'release'

    Build > Build Configurations...

    However, when I try to do this SES stop responding to any subsequent key presses. I have to press the ESC key to get SES to escape from this strange mode. However, this also means I escaped the Build Configurations... menu. So, I cannot build configurations. The only one available is the default Common configuration shown in the top left hand side above the Project explorer in SES IDE.

    Kind regards
    Mohamed

  • Which version of NCS are you working on, and are you using the SES that is bundled with the NCS release or a newer one?

    Kenneth

  • I am using nRF Connect SDK v1.7.0. Zephyr OS build v2.6.99-ncs1
    and SES-Nordic Edition v5.60

    SEGGER Embedded Studio for ARM
    Release 5.60  Build 2021081102.47262
    Nordic Edition
    Windows x64

    © 2014-2021 SEGGER Microcontroller GmbH
    © 1997-2021 Rowley Associates Ltd.

    segger-as: version 2.11
    segger-cc: version 12.2.1
    segger-cc-ng: version 12.91.6
    segger-ld: version 4.12.1
    segger-rtl: version 2.22.0

    Thank you for your support.

    Kind regards
    Mohamed
Reply
  • I am using nRF Connect SDK v1.7.0. Zephyr OS build v2.6.99-ncs1
    and SES-Nordic Edition v5.60

    SEGGER Embedded Studio for ARM
    Release 5.60  Build 2021081102.47262
    Nordic Edition
    Windows x64

    © 2014-2021 SEGGER Microcontroller GmbH
    © 1997-2021 Rowley Associates Ltd.

    segger-as: version 2.11
    segger-cc: version 12.2.1
    segger-cc-ng: version 12.91.6
    segger-ld: version 4.12.1
    segger-rtl: version 2.22.0

    Thank you for your support.

    Kind regards
    Mohamed
Children
Related