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

  • Can you please try building from command line using west and/or transition to Visual Studio code? 

    Best regards,
    Kenneth

  • Good morning Kenneth,

    I appreciate you are trying to get me to migrate to VS Code but unfortunately, the team and management are reluctant to make the switch right now. So, we need to get this sorted as soon as possible. If you cannot solve this problem maybe you can consult with other members in your team.

    These are the outstanding questions I would like help with.

    Q1/ 

    From the link you sent me, it is stated in step 4 Do not select Clean Build Directory.
    Why is this the case?

    Q2/ 

    That said, the description for SES should be as stated here (seems there are two different ways it can be done in SES if you see the Note also below the first suggestion): https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_modifying.html?highlight=dconf_file#selecting-a-build-type-in-ses 

    If I choose to select the project conf file using the second method as shown below

    Tools > Options > nRF Connect > Additional CMake Options -DCONF_FILE=prj_release.conf

    File > Open nRF Connect SDK Project... to re-open the project

    Can I select to do a 'Clean Build Directory'?

    Q3/ 
    What is the difference between re-opening and re-loading a project?

    Q4/ When I open the project after performing the actions in Q2/ above, I see in SES logs that prj_debug.conf is being merged instead of prj_release.conf as specified in -DCONF_FILE=prj_release.conf. See logs below.

    Creating solution HomeBeacon_dev_sb.emProject                                    C:/Zypher/v1.7.0/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf52833dk_nrf52833 -DBOARD_DIR=C:\Zypher\v1.7.0\zephyr\boards\arm\nrf52833dk_nrf52833 -BC:\Sandbox\HomeBeacon_dev_sb\build_nrf52833dk_nrf52833_rel_v1_3_99 -SC:\Sandbox\HomeBeacon_dev_sb -DNCS_TOOLCHAIN_VERSION=1.7.0 -DCONF_FILE=prj_release.conf -DDTC_OVERLAY_FILE=C:/Sandbox/HomeBeacon_dev_sb/nrf52833dk_nrf52833.overlay -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=C:\Zypher\v1.7.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
    -- Application: C:/Sandbox/HomeBeacon_dev_sb
    -- Zephyr version: 2.6.99 (C:/Zypher/v1.7.0/zephyr), build: v2.6.99-ncs1
    -- Found Python3: C:/Zypher/v1.7.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
    -- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
    -- Board: nrf52833dk_nrf52833
    -- Cache files will be written to: C:/Zypher/v1.7.0/zephyr/.cache
    -- Found dtc: C:/Zypher/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (C:/Zypher/v1.7.0/toolchain/opt)
    -- Found BOARD.dts: C:/Zypher/v1.7.0/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833.dts
    -- Found devicetree overlay: C:/Sandbox/HomeBeacon_dev_sb/nrf52833dk_nrf52833.overlay
    -- Generated zephyr.dts: C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/dts.cmake
    Parsing C:/Sandbox/HomeBeacon_dev_sb/Kconfig
    Loaded configuration 'C:/Zypher/v1.7.0/zephyr/boards/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833_defconfig'
    Merged configuration 'C:/Sandbox/HomeBeacon_dev_sb/prj_debug.conf'
    Configuration saved to 'C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/.config'
    Kconfig header saved to 'C:/Sandbox/HomeBeacon_dev_sb/build_nrf52833dk_nrf52833_rel_v1_3_99/zephyr/include/generated/autoconf.h'

    ...

    Kind regards

    Mohamed

  • Hi,

    I am not sure why the documentation says not to choose clean build directory, unless there are some configurations you have set using menuconfig in SES that you may want to keep. 

    > What is the difference between re-opening and re-loading a project?

    If you close and open the same project with "clean build directory" not chosen, then this can cause items from the cache/build folder to impact configuration, and that changes in prj.conf. cmakelist.txt is not applied. To ensure the changes are applied then CMake must run, which can be done by either of the following:

    - Open the project again with "Open nRF Connect SDK project", make sure to choose "clean build directory".

    OR

    - Run Cmake with Project > Run CMake.

    > When I open the project after performing the actions in Q2/ above, I see in SES logs that prj_debug.conf is being merged instead of prj_release.conf as specified in -DCONF_FILE=prj_release.conf

    This is likely because you don't clean the build folder and/or CMake does not run.

    If you reload the project with Project > Reload <project name>, then CMake does not run.

    Best regards,
    Kenneth

  • Hi Kenneth,

    Thank you for your answers.

    I am not sure why the documentation says not to choose clean build directory, unless there are some configurations you have set using menuconfig in SES that you may want to keep. 
    I am not aware of any configurations I have in SES that I would like to keep.
    How do I check whether I have configurations set in SES using menuconfig?

    > When I open the project after performing the actions in Q2/ above, I see in SES logs that prj_debug.conf is being merged instead of prj_release.conf as specified in -DCONF_FILE=prj_release.conf

    This is likely because you don't clean the build folder and/or CMake does not run.

    I have tried both with and without selecting the 'Clean Build folder' option and I still see prj_debug.conf instead of prj_release.conf being merged in .config. as reported in my previous post.

    Kind regards
    Mohamed

  • Have you tried the other option also? 
    - Run Cmake with Project > Run CMake. 

    Kenneth

Related