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

west build freezes with specific config in prj.conf (CONFIG_NVS / CONFIG_SETTINGS_FCB)

Hello,

we are upgrading our application firmware to the v1.3.0 of nrf-sdk. We have now encountered a problem in which the build process just freezes/stops without exiting. NO ERROR IS REPORTED.

The build output:

 west build -p always -b nrf9160_pca10090ns                                                    (irnas) 
-- west build: generating a build system
Including boilerplate (Zephyr base): /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2
-- Zephyr version: 2.3.0-rc1 (/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr)
-- Found Python3: /home/comemaster/anaconda3/envs/irnas/bin/python3.7 (found suitable exact version "3.7.4") found components: Interpreter 
-- Board: nrf9160_pca10090ns
CMake Warning at /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/cmake/app/boilerplate.cmake:210 (message):
  Deprecated BOARD=nrf9160_pca10090ns name specified, board automatically
  changed to: nrf9160dk_nrf9160ns.
Call Stack (most recent call first):
  /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:16 (find_package)


-- Found west: /home/comemaster/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Found dtc: /usr/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/comemaster/gnuarmemb)
-- Found BOARD.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns.dts
-- Generated zephyr.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/Kconfig
Loaded configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160ns_defconfig'
Merged configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/prj.conf'
Configuration saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/zephyr/.config'
Kconfig header saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/comemaster/gnuarmemb/bin/arm-none-eabi-gcc
-- Cache files will be written to: /home/comemaster/.cache/zephyr
Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image spm - nrf9160dk_nrf9160 begin ===
Including boilerplate (Zephyr base): /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/samples/nrf9160/spm
-- Zephyr version: 2.3.0-rc1 (/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr)
-- Found Python3: /home/comemaster/anaconda3/envs/irnas/bin/python3.7 (found suitable exact version "3.7.4") found components: Interpreter 
-- Board: nrf9160dk_nrf9160
-- Found west: /home/comemaster/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Found dtc: /usr/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/comemaster/gnuarmemb)
-- Found BOARD.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/samples/nrf9160/spm/nrf9160dk_nrf9160.overlay
-- Generated zephyr.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/spm/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/spm/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/Kconfig
Loaded configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/spm.conf'
Configuration saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/spm/zephyr/.config'
Kconfig header saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/spm/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/comemaster/gnuarmemb/bin/arm-none-eabi-gcc
-- Cache files will be written to: /home/comemaster/.cache/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/spm
=== child image spm - nrf9160dk_nrf9160 end ===

Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image mcuboot - nrf9160dk_nrf9160 begin ===
Including boilerplate (Zephyr base): /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/cmake/app/boilerplate.cmake
-- Application: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.3.0-rc1 (/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr)
-- Found Python3: /home/comemaster/anaconda3/envs/irnas/bin/python3.7 (found suitable exact version "3.7.4") found components: Interpreter 
-- Board: nrf9160dk_nrf9160
-- Found west: /home/comemaster/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Found dtc: /usr/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/comemaster/gnuarmemb)
-- Found BOARD.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
Parsing /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/bootloader/mcuboot/boot/zephyr/prj.conf'
Configuration saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/mcuboot/zephyr/.config'
Kconfig header saved to '/home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/mcuboot/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 7.3.1
-- The CXX compiler identification is GNU 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/comemaster/gnuarmemb/bin/arm-none-eabi-gcc
-- Cache files will be written to: /home/comemaster/.cache/zephyr
-- Configuring done
-- Generating done
-- Build files have been written to: /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/nrf/applications/asset_tracker2/build/mcuboot
=== child image mcuboot - nrf9160dk_nrf9160 end ===

CMake Warning at /home/comemaster/Synology-Drive/IRNAS-Users/tjaz/Nordic/sdk-1.3.0-env/zephyr/CMakeLists.txt:1384 (message):
  __ASSERT() statements are globally ENABLED


Changed board to secure nrf9160dk_nrf9160 (NOT NS)

at this point the build freezes and i have to ctrl-c to cancel it.

I spent a long time investigating the cause and found it in prf.conf. The following lines are the cause:

# Flash
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

CONFIG_NVS=y

This can be easily reproduced by taking, for example, the asset_tracker application that is shipped with nrf-sdk v1.3.0 and adding those lines to prj.conf.
Commenting out either CONFIG_NVS=y or CONFIG_SETTINGS_FCB=y the build process continues and finishes.

These settings were originally taken from bifravst ( https://github.com/bifravst/firmware ) and we added CONFIG_NVS to be able to store specific application configurations.

Using nrf-sdk v1.1.0, which we used previously, this config was ok, and now it is not anymore (with sdk v1.3.0) - it is unfortunate that the build freezes instead of printing some error message.

To me it seems that FCB and NVS setting are in conflict with each other, but the documentation
http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_FCB.html?highlight=config_fcb#cmdoption-arg-config-fcb
http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_SETTINGS.html?highlight=config_settings#cmdoption-arg-config-settings
http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_SETTINGS_NVS.html?highlight=config_settings#cmdoption-arg-config-settings-nvs
http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_NVS.html?highlight=config_nvs#cmdoption-arg-config-nvs

does not really explain what these setting/libraries are for.
We probably don't even need to enable some of these config options, but I am unable to determine which by just reading the docs, I would have to try changing each one and seeing if the app still works.

Do you have any suggestions on how to improve our process? For now I will continue porting to the new version and at the end verify which settings are even needed in our app. It would be nice if maybe the build process would verify that a selected setting/library is even in use.

Regards,
Tjaž Vračko

  • Hi Tjaž

    What tool are you using to build this application? If you're not already, can you try building with west in order to see if you get any kind of build information or error logs there?

    Please note that we're entering the summer vacation period here in Norway, so delays must be expected as we are low on staff for the month of July. Sorry about the inconvenience!

    Best regards,

    Simon

  • I build with the command:

     

     west build -p always -b nrf9160_pca10090ns  

    The build output can be seen in the first "code block" in my original post.
    Please use the steps described in my post to recreate the situation.

  • Hi

    We tried to set CONFIG_NVS=y and CONFIG_SETTINGS_FCB=y in the hello_world example and got the following warning:

    warning: The choice symbol SETTINGS_FCB (defined at subsys/settings/Kconfig:55) was selected (set=y), but no symbol ended up as the choice selection. See http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_SETTINGS_FCB.html and/or look up SETTINGS_FCB in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
    So there seem to be a few menuconfigs that need changing before setting all these configurations in prj.conf. If we add all the configs you posted initially this is what we get:
    warning: IMG_ERASE_PROGRESSIVELY (defined at subsys/dfu/Kconfig:52) was assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n), IMG_MANAGER (=n). See http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_IMG_ERASE_PROGRESSIVELY.html and/or look up IMG_ERASE_PROGRESSIVELY in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.
    So there seems to be some configurations that need to be edited in your application as well. We were able to reproduce it when trying to build this, but please check the latest "WARNING" and double-check dependencies, etc. with menuconfig.
    Best regards,
    Simon
Related