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

Error while building a project using SEGGER Embedded Studio (nRF Connect SDK 1.4.0)

Environment:

Windows 10
nRF Connect SDK 1.4.0


I followed all of the steps described in nRF connect SDK documentation and tried to build "Blinky" sample from zephyr as shown in attached screen shot. (board selection: nrf5340pdk_nrf5340_cpuappns)

The project was able to populate correctly, but when I tried to "build" it, the error occurred  as show in attached screen shot. Full log is also pasted below, and I have highlighted the errors in red.

I think it occurred because, a path to the ZEPHYR_BASE from (C:\) is too long.

The original path to the "ZEPHYR_BASE" when error occurred was "C:\Users\kpatel\Documents\BitBucket\hardened-gateway-v1_mlh_firmware\_sdk\ncs\zephyr".

After this, I moved the "ncs" folder up the order in hierarchy. The new path became "C:\Users\kpatel\Documents\BitBucket\_sdk\ncs\zephyr", and performed the same process, and it built without any errors. 

Please provide a solution so that we can keep using the original path.






Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-mkdir’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-mkdir’
Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-download’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-download’
Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-update’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-update’
Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-patch’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-patch’
Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-configure’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-configure’
Building ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-build’ from solution ‘build’ in configuration ‘Common’
Combining ‘modules/nrf/samples/spm_subimage-prefix/src/spm_subimage-stamp/spm_subimage-build’
zephyr/arch/arch/arm/core/aarch32/cortex_m/tz/CMakeFiles/arch__arm__core__aarch32__cortex_m__tz.dir/arm_core_tz.c.obj
/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/drivers/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/mdk -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/. -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm/kernel/include -isystem ../../../../../lib/libc/minimal/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/samples/basic/blinky/build_nrf5340pdk_nrf5340_cpuappns/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -mcmse -std=c99 -nostdinc -MD -MT zephyr/arch/arch/arm/core/aarch32/cortex_m/tz/CMakeFiles/arch__arm__core__aarch32__cortex_m__tz.dir/arm_core_tz.c.obj -MF zephyr\arch\arch\arm\core\aarch32\cortex_m\tz\CMakeFiles\arch__arm__core__aarch32__cortex_m__tz.dir\arm_core_tz.c.obj.d -o zephyr/arch/arch/arm/core/aarch32/cortex_m/tz/CMakeFiles/arch__arm__core__aarch32__cortex_m__tz.dir/arm_core_tz.c.obj -c
C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/arch/arm/core/aarch32/cortex_m/tz/arm_core_tz.c
opening dependency file zephyr\arch\arch\arm\core\aarch32\cortex_m\tz\CMakeFiles\arch__arm__core__aarch32__cortex_m__tz.dir\arm_core_tz.c.obj.d: No such file or directory
zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/CMakeFiles/arch__arm__core__aarch32__cortex_m__cmse.dir/arm_core_cmse.c.obj
/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/drivers/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/mdk -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/. -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm/kernel/include -isystem ../../../../../lib/libc/minimal/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/samples/basic/blinky/build_nrf5340pdk_nrf5340_cpuappns/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -mcmse -std=c99 -nostdinc -MD -MT zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/CMakeFiles/arch__arm__core__aarch32__cortex_m__cmse.dir/arm_core_cmse.c.obj -MF zephyr\arch\arch\arm\core\aarch32\cortex_m\cmse\CMakeFiles\arch__arm__core__aarch32__cortex_m__cmse.dir\arm_core_cmse.c.obj.d -o zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/CMakeFiles/arch__arm__core__aarch32__cortex_m__cmse.dir/arm_core_cmse.c.obj -c C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/arch/arm/core/aarch32/cortex_m/cmse/arm_core_cmse.c
opening dependency file zephyr\arch\arch\arm\core\aarch32\cortex_m\cmse\CMakeFiles\arch__arm__core__aarch32__cortex_m__cmse.dir\arm_core_cmse.c.obj.d: No such file or directory
zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_core_mpu.c.obj
/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/drivers/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/mdk -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/. -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm/kernel/include -isystem ../../../../../lib/libc/minimal/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/samples/basic/blinky/build_nrf5340pdk_nrf5340_cpuappns/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -mcmse -std=c99 -nostdinc -MD -MT zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_core_mpu.c.obj -MF zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\CMakeFiles\arch__arm__core__aarch32__cortex_m__mpu.dir\arm_core_mpu.c.obj.d -o zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_core_mpu.c.obj -c C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/arch/arm/core/aarch32/cortex_m/mpu/arm_core_mpu.c
opening dependency file zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\CMakeFiles\arch__arm__core__aarch32__cortex_m__mpu.dir\arm_core_mpu.c.obj.d: No such file or directory
zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_mpu.c.obj
/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/cmsis/CMSIS/Core/Include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/drivers/include -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/nrfx/mdk -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/modules/hal/nordic/. -IC:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm/kernel/include -isystem ../../../../../lib/libc/minimal/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include -isystem c:/users/kpatel/ncs/downloads/ncs-toolchain-v1.4.0-20201030-2750604/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/include-fixed -isystem C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrfxlib/crypto/nrf_cc312_platform/include -Os -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/samples/basic/blinky/build_nrf5340pdk_nrf5340_cpuappns/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m33 -mthumb -mabi=aapcs -imacros C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/nrf/samples/spm=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs=WEST_TOPDIR -ffunction-sections -fdata-sections -mcmse -std=c99 -nostdinc -MD -MT zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_mpu.c.obj -MF zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\CMakeFiles\arch__arm__core__aarch32__cortex_m__mpu.dir\arm_mpu.c.obj.d -o zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/CMakeFiles/arch__arm__core__aarch32__cortex_m__mpu.dir/arm_mpu.c.obj -c
C:/Users/kpatel/Documents/BitBucket/hardened-gateway-v1_mlh_firmware/_sdk/ncs/zephyr/arch/arm/core/aarch32/cortex_m/mpu/arm_mpu.c
arm_mpu.c
opening dependency file zephyr\arch\arch\arm\core\aarch32\cortex_m\mpu\CMakeFiles\arch__arm__core__aarch32__cortex_m__mpu.dir\arm_mpu.c.obj.d: No such file or directory

in definition of macro 'Z_DECL_ALIGN'
in expansion of macro 'Z_INIT_ENTRY_DEFINE'
in expansion of macro 'SYS_INIT'
build stopped: subcommand failed.
Build failed




Parents
  • Hi Kishan,

    I suspect this is caused by path length limitation from Windows OS, but after I Remove the 260 Character Path Limit, the problem still exists.

    There is still path length limit on the building system. I have two suggestions if you want to avoid this problem: 

    1. Avoid putting ncs folder into a deep folder as you did the second time. The best option is to put ncs under the disk root. 

    2. Change the build folder manually to another position like a disk root.

    Looking forward to seeing other solutions that can solve this issue in a better way.

    Best regards,

    Charlie

  • Hi Charlie,

    Thanks for the quick response!  I really appreciate it. We would have liked keeping our original path location. But will move it for now as a quick solution.

    This is definitely something SDK developers should look at, may be modifying the build environment in the next release to allow for longer path, or at least have documentation somewhere. I suspect many people will have the longer path, especially if they are cloning the NCS directly to their github/bitbucket location, or if they like to use NCS as completely detached repository, by eschewing git and west as described in User Workflow 1, Or somebody might just have a really long user name. 
     

    Kishan

Reply
  • Hi Charlie,

    Thanks for the quick response!  I really appreciate it. We would have liked keeping our original path location. But will move it for now as a quick solution.

    This is definitely something SDK developers should look at, may be modifying the build environment in the next release to allow for longer path, or at least have documentation somewhere. I suspect many people will have the longer path, especially if they are cloning the NCS directly to their github/bitbucket location, or if they like to use NCS as completely detached repository, by eschewing git and west as described in User Workflow 1, Or somebody might just have a really long user name. 
     

    Kishan

Children
No Data
Related