This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot build application_update example

Hi community

I'm trying to build the nrf9160/http_update/application_update example but it keeps failing (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_update/application_update/README.html)

Then I've added a build configuration for the nrf9160dk_nrf9160_ns target.

The Terminal output is the following:

Building http_update
west build --build-dir c:\Users\moss\Code\http_update\build c:\Users\moss\Code\http_update --pristine --board nrf9160dk_nrf9160_ns -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONF_FILE:STRING="c:/Users/moss/Code/http_update/prj.conf"

-- west build: generating a build system
Including boilerplate (Zephyr base): C:/Users/moss/ncs/v1.7.0/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/moss/Code/http_update
-- Zephyr version: 2.6.99 (C:/Users/moss/ncs/v1.7.0/zephyr), build: v2.6.99-ncs1
-- Found Python3: C:/Users/moss/ncs/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: nrf9160dk_nrf9160_ns, Revision: 0.7.0
-- Cache files will be written to: C:/Users/moss/ncs/v1.7.0/zephyr/.cache
-- Found dtc: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (c:/Users/moss/ncs/v1.7.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
-- Generated zephyr.dts: C:/Users/moss/Code/http_update/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/moss/Code/http_update/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/moss/Code/http_update/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/Users/moss/Code/http_update/build/zephyr/dts.cmake
Parsing C:/Users/moss/Code/http_update/Kconfig
Loaded configuration 'C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
Merged configuration 'c:/Users/moss/Code/http_update/prj.conf'
Configuration saved to 'C:/Users/moss/Code/http_update/build/zephyr/.config'
Kconfig header saved to 'C:/Users/moss/Code/http_update/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
-- Application: C:/Users/moss/ncs/v1.7.0/nrf/samples/spm
-- Zephyr version: 2.6.99 (C:/Users/moss/ncs/v1.7.0/zephyr), build: v2.6.99-ncs1
Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image spm -  begin ===
Including boilerplate (Zephyr base): C:/Users/moss/ncs/v1.7.0/zephyr/cmake/app/boilerplate.cmake
-- Found Python3: C:/Users/moss/ncs/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: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: C:/Users/moss/ncs/v1.7.0/zephyr/.cache
-- Found dtc: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/Users/moss/ncs/v1.7.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: C:/Users/moss/ncs/v1.7.0/nrf/samples/spm/nrf9160dk_nrf9160.overlay
-- Generated zephyr.dts: C:/Users/moss/Code/http_update/build/spm/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/moss/Code/http_update/build/spm/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/moss/Code/http_update/build/spm/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/Users/moss/Code/http_update/build/spm/zephyr/dts.cmake
Parsing C:/Users/moss/ncs/v1.7.0/zephyr/Kconfig
Loaded configuration 'C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration 'C:/Users/moss/ncs/v1.7.0/nrf/samples/spm/prj.conf'
Merged configuration 'C:/Users/moss/ncs/v1.7.0/nrf/samples/spm/boards/nrf9160dk_nrf9160.conf'
Merged configuration 'C:/Users/moss/ncs/v1.7.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Merged configuration 'C:/Users/moss/Code/http_update/build/spm/zephyr/misc/generated/extra_kconfig_options.conf'
Configuration saved to 'C:/Users/moss/Code/http_update/build/spm/zephyr/.config'
Kconfig header saved to 'C:/Users/moss/Code/http_update/build/spm/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
-- Configuring done
CMake Warning (dev) at C:\Users\moss\ncs\v1.7.0\nrfxlib\nrf_security\cmake\extensions.cmake:652:
  Syntax Warning in cmake code at column 32

  Argument not separated from preceding token by whitespace.
Call Stack (most recent call first):
  C:\Users\moss\ncs\v1.7.0\nrfxlib\nrf_security\CMakeLists.txt:185 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at C:\Users\moss\ncs\v1.7.0\zephyr\CMakeLists.txt:1612 (message):
  __ASSERT() statements are globally ENABLED


-- Generating done
-- Build files have been written to: C:/Users/moss/Code/http_update/build/spm
=== child image spm -  end ===

Changed board to secure nrf9160dk_nrf9160 (NOT NS)

=== child image mcuboot -  begin ===
Including boilerplate (Zephyr base): C:/Users/moss/ncs/v1.7.0/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/Users/moss/ncs/v1.7.0/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.6.99 (C:/Users/moss/ncs/v1.7.0/zephyr), build: v2.6.99-ncs1
-- Found Python3: C:/Users/moss/ncs/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: nrf9160dk_nrf9160, Revision: 0.7.0
-- Cache files will be written to: C:/Users/moss/ncs/v1.7.0/zephyr/.cache
-- Found dtc: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/Users/moss/ncs/v1.7.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
-- Found devicetree overlay: C:/Users/moss/ncs/v1.7.0/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: C:/Users/moss/Code/http_update/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/moss/Code/http_update/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/moss/Code/http_update/build/mcuboot/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: C:/Users/moss/Code/http_update/build/mcuboot/zephyr/dts.cmake
Parsing C:/Users/moss/ncs/v1.7.0/bootloader/mcuboot/boot/zephyr/Kconfig
Loaded configuration 'C:/Users/moss/ncs/v1.7.0/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
Merged configuration 'C:/Users/moss/ncs/v1.7.0/bootloader/mcuboot/boot/zephyr/prj.conf'
Merged configuration 'C:/Users/moss/ncs/v1.7.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
Configuration saved to 'C:/Users/moss/Code/http_update/build/mcuboot/zephyr/.config'
Kconfig header saved to 'C:/Users/moss/Code/http_update/build/mcuboot/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/moss/ncs/v1.7.0/toolchain/opt/bin/arm-none-eabi-gcc.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/moss/Code/http_update/build/mcuboot
MCUBoot bootloader key file: C:/Users/moss/ncs/v1.7.0/bootloader/mcuboot/root-ec-p256.pem
=== child image mcuboot -  end ===

CMake Warning at C:\Users\moss\ncs\v1.7.0\nrf\modules\mcuboot\CMakeLists.txt:204 (message):
  

        ---------------------------------------------------------
        --- WARNING: Using default MCUBoot key, it should not ---
        --- be used for production.                           ---
        ---------------------------------------------------------
        



CMake Warning at C:\Users\moss\ncs\v1.7.0\zephyr\CMakeLists.txt:1612 (message):
  __ASSERT() statements are globally ENABLED


Dropping partition 'nrf_modem_lib_trace' since its size is 0.
-- Configuring done
CMake Error at C:\Users\moss\ncs\v1.7.0\zephyr\cmake\extensions.cmake:418 (add_library):
  Cannot find source file:

    ../common/src/update.c
Call Stack (most recent call first):
  C:\Users\moss\ncs\v1.7.0\zephyr\cmake\app\boilerplate.cmake:661 (zephyr_library_named)
  C:\Users\moss\ncs\v1.7.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:24 (include)
  C:\Users\moss\ncs\v1.7.0\zephyr\share\zephyr-package\cmake\ZephyrConfig.cmake:35 (include_boilerplate)
  c:\Users\moss\Code\http_update\build\CMakeLists.txt:9 (find_package)


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
FATAL ERROR: command exited with status 1: 'c:\Users\moss\ncs\v1.7.0\toolchain\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\Users\moss\ncs\v1.7.0\toolchain\opt\bin\python.exe' '-Bc:\Users\moss\Code\http_update\build' '-Sc:\Users\moss\Code\http_update' -GNinja -DBOARD=nrf9160dk_nrf9160_ns -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONF_FILE:STRING=c:/Users/moss/Code/http_update/prj.conf

Does anybody have an idea what I'm doing wrong?

Thanks!

  • Hi,

     

    It cannot find the common files:

    CMake Error at C:\Users\moss\ncs\v1.7.0\zephyr\cmake\extensions.cmake:418 (add_library):
      Cannot find source file:
    
        ../common/src/update.c


    The http_update samples require this common folder to be present:

    https://github.com/nrfconnect/sdk-nrf/tree/master/samples/nrf9160/http_update/common 

     

    Kind regards,

    Håkon

  • I see. It works now. I had to copy that common folder to the parent directory. Thanks!

    Inside the samples of the SDK the parent folder of the application_update folder contains that common folder.

    But if I just "Create a new application from sample..." via the Welcome Page this is not the case, since the plugin only copies the actual sample with the CMake that contains the hardcoded "../common/src/update.c" instead that it would copy the common folder too or refer correctly to the http_update folder inside the SDK. (Also doesn't do it correctly if I choose "Workspace" where it downloads the complete SDK.)

    So what I did is that I just copied both the application_update and common folders and then chose "Add an existing application to workspace...".

    So I must admit I could have come up with that solution by myself but still its not very handy how that plugin works in this case.

    Thanks for your help anyway!

Related