Unable to build for custom board, c compiler not found

Hello everyone,

So I'm trying to build for a custom nRF9160 board. I've copied the Thingy:91 board and renamed all files and edited the cmake , as per the guide and video.

I am working in ncs 2.0.0, using vscode, in win11.

When trying to build for this new board, I get the following error:

CMake Error at C:/ncs/v2.0.0/zephyr/cmake/compiler/gcc/target.cmake:10 (message):
  C compiler C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk//bin/-gcc not found -
  Please check your toolchain installation
Call Stack (most recent call first):
  C:/ncs/v2.0.0/zephyr/cmake/modules/target_toolchain.cmake:63 (include)
  C:/ncs/v2.0.0/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
  C:/ncs/v2.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:51 (include)
  C:/ncs/v2.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:76 (include_boilerplate)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.0.0\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\toolchains\v2.0.0\opt\bin\python.exe'

Building for other targets, like thingy and dk, works just fine. The error code comes from the following lines in target.cmake:

find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
if(${CMAKE_C_COMPILER} STREQUAL CMAKE_C_COMPILER-NOTFOUND)
  message(FATAL_ERROR "C compiler ${CROSS_COMPILE}${CC} not found - Please check your toolchain installation")
endif()

Does anyone have suggestions as how to fix this? Is there something I've missed?

Thank you all for all and any suggestions!

Parents
  • A bit more info: I've tried making new workspaces(still 2.0.0); I've tried copying both thingy and DK board files; I've tried the new board wizard; Ive tried putting the board files both within the app folder and in the ncs folder. Everything stills leads to the same error as described above. But when building to any existing boards, like DK or Thingy, there's no problem. I can't see what the issue is.

    I managed to override this error by replacing "find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)" with "set(CMAKE_C_COMPILER  "actual path to the compiler")". It went further in the building process, but gave a couple of new errors instead. Editing this file doesn't feel like the right approach

    It also happens when using toolchain 2.2.0

    Testing with "Hello world" sample

Reply
  • A bit more info: I've tried making new workspaces(still 2.0.0); I've tried copying both thingy and DK board files; I've tried the new board wizard; Ive tried putting the board files both within the app folder and in the ncs folder. Everything stills leads to the same error as described above. But when building to any existing boards, like DK or Thingy, there's no problem. I can't see what the issue is.

    I managed to override this error by replacing "find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)" with "set(CMAKE_C_COMPILER  "actual path to the compiler")". It went further in the building process, but gave a couple of new errors instead. Editing this file doesn't feel like the right approach

    It also happens when using toolchain 2.2.0

    Testing with "Hello world" sample

Children
  • More additional info:

    After C:\ncs\v2.2.0\zephyr\cmake\compiler\gcc\target.cmake is edited by adding 

    39: set(CROSS_COMPILE "C:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-")

    the build process is later stopped by C:\ncs\v2.2.0\nrfxlib\common.cmake, because GCC_M_CPU is null. Editing this file by adding

    41: set(GCC_M_CPU "cortex-m33")

    bypasses this, effectively hard-coding the cpu.

    This all brings new error further down in the building process for all custom builds:

    [64/228] Generating zephyr/tfm_secure.hex
    [65/228] Completed 'tfm'
    [66/228] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    In file included from C:\ncs\v2.2.0\zephyr\arch\Arm\include\kernel_arch_data.h:28,
                     from C:\ncs\v2.2.0\zephyr\arch\arm\core\offsets\offsets_aarch32.c:29,
                     from C:\ncs\v2.2.0\zephyr\arch\arm\core\offsets\offsets.c:9:
    C:/ncs/v2.2.0/zephyr/arch/Arm/include/aarch32/cortex_m/stack.h: In function 'z_arm_interrupt_stack_setup':
    C:\ncs\v2.2.0\zephyr\arch\Arm\include\aarch32\cortex_m\stack.h:49:9: warning: implicit declaration of function '__set_MSPLIM'; did you mean '__set_MSP'? [-Wimplicit-function-declaration]
       49 |         __set_MSPLIM((uint32_t)z_interrupt_stacks[0]);
          |         ^~~~~~~~~~~~
          |         __set_MSP
    [67/228] Generating include/generated/offsets.h
    [68/228] Building ASM object zephyr/arch/arch/Arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [69/228] Building ASM object zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    FAILED: zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj 
    C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.2.0/zephyr/kernel/include -IC:/ncs/v2.2.0/zephyr/arch/Arm/include -IC:/ncs/v2.2.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.2.0/zephyr/soc/Arm/nordic_nrf/nrf91 -IC:/ncs/v2.2.0/zephyr/lib/libc/newlib/include -IC:/ncs/v2.2.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.2.0/nrf/include -IC:/ncs/v2.2.0/nrf/include/tfm -IC:/ncs/v2.2.0/nrf/tests/include -Itfm/generated/interface/include -IC:/ncs/v2.2.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.2.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.2.0/nrfxlib/nrf_modem/include -Itfm/install/interface/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include -IC:/ncs/v2.2.0/mbedtls/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include/psa -IC:/ncs/v2.2.0/mbedtls/library -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include -Os -imacros C:/ZephyrWorkspace2.2.0/hello_world/build_voqdr_nrf9160_ns/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always --sysroot=C:/ncs/toolchains/v2.2.0/opt/zephyr-sdk// -xassembler-with-cpp -imacros C:/ncs/v2.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -D_ASMLANGUAGE -Wno-unused-but-set-variable -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/ZephyrWorkspace2.2.0/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.2.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.2.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -MD -MT zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj -MF zephyr\arch\arch\Arm\core\aarch32\CMakeFiles\arch__arm__core__aarch32.dir\cpu_idle.S.obj.d -o zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj -c C:/ncs/v2.2.0/zephyr/arch/arm/core/aarch32/cpu_idle.S
    C:/ncs/v2.2.0/zephyr/arch/arm/core/aarch32/cpu_idle.S: Assembler messages:
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:73: Error: selected processor does not support `cpsid i' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:80: Error: selected processor does not support `msr BASEPRI,r0' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:81: Error: selected processor does not support `isb' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:96: Error: selected processor does not support `dsb' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:99: Error: selected processor does not support `wfi' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:105: Error: selected processor does not support `cpsie i' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:106: Error: selected processor does not support `isb' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:126: Error: selected processor does not support `cpsid i' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:154: Error: selected processor does not support `msr BASEPRI,r1' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:156: Error: selected processor does not support `wfe' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:158: Error: selected processor does not support `msr BASEPRI,r0' in Thumb mode
    C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cpu_idle.S:159: Error: selected processor does not support `cpsie i' in Thumb mode
    [70/228] Building C object zephyr/CMakeFiles/zephyr.dir/C_/ncs/v2.2.0/nrf/subsys/partition_manager/flash_map_partition_manager.c.obj
    [71/228] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [72/228] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [73/228] Building C object zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [74/228] Generating linker_zephyr_pre1.cmd
    [75/228] Generating linker_zephyr_pre0.cmd
    [76/228] Building C object zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    In file included from C:\ncs\v2.2.0\zephyr\arch\Arm\include\kernel_arch_data.h:28,
                     from C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\fatal.c:16:
    C:/ncs/v2.2.0/zephyr/arch/Arm/include/aarch32/cortex_m/stack.h: In function 'z_arm_interrupt_stack_setup':
    C:\ncs\v2.2.0\zephyr\arch\Arm\include\aarch32\cortex_m\stack.h:49:9: warning: implicit declaration of function '__set_MSPLIM'; did you mean '__set_MSP'? [-Wimplicit-function-declaration]
       49 |         __set_MSPLIM((uint32_t)z_interrupt_stacks[0]);
          |         ^~~~~~~~~~~~
          |         __set_MSP
    [77/228] Building C object zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    FAILED: zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj 
    C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.2.0/zephyr/kernel/include -IC:/ncs/v2.2.0/zephyr/arch/Arm/include -IC:/ncs/v2.2.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.2.0/zephyr/soc/Arm/nordic_nrf/nrf91 -IC:/ncs/v2.2.0/zephyr/lib/libc/newlib/include -IC:/ncs/v2.2.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.2.0/nrf/include -IC:/ncs/v2.2.0/nrf/include/tfm -IC:/ncs/v2.2.0/nrf/tests/include -Itfm/generated/interface/include -IC:/ncs/v2.2.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.2.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.2.0/nrfxlib/nrf_modem/include -Itfm/install/interface/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include -IC:/ncs/v2.2.0/mbedtls/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include/psa -IC:/ncs/v2.2.0/mbedtls/library -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include -fno-strict-aliasing -Os -imacros C:/ZephyrWorkspace2.2.0/hello_world/build_voqdr_nrf9160_ns/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always --sysroot=C:/ncs/toolchains/v2.2.0/opt/zephyr-sdk// -imacros C:/ncs/v2.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/ZephyrWorkspace2.2.0/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.2.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.2.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj -MF zephyr\arch\arch\Arm\core\aarch32\CMakeFiles\arch__arm__core__aarch32.dir\irq_manage.c.obj.d -o zephyr/arch/arch/Arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj -c C:/ncs/v2.2.0/zephyr/arch/arm/core/aarch32/irq_manage.c
    C:\Users\TORJEJ~1\AppData\Local\Temp\ccLLSfGe.s: Assembler messages:
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\ccLLSfGe.s:130: Error: selected processor does not support `dsb 0xF' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\ccLLSfGe.s:144: Error: selected processor does not support `isb 0xF' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\ccLLSfGe.s:327: Error: selected processor does not support `cpsid i' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\ccLLSfGe.s:354: Error: selected processor does not support `cpsie i' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\ccLLSfGe.s:368: Error: selected processor does not support `cpsie i' in ARM mode
    [78/228] Building C object zephyr/arch/arch/Arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    FAILED: zephyr/arch/arch/Arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj 
    C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.2.0/zephyr/kernel/include -IC:/ncs/v2.2.0/zephyr/arch/Arm/include -IC:/ncs/v2.2.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.2.0/zephyr/soc/Arm/nordic_nrf/nrf91 -IC:/ncs/v2.2.0/zephyr/lib/libc/newlib/include -IC:/ncs/v2.2.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.2.0/nrf/include -IC:/ncs/v2.2.0/nrf/include/tfm -IC:/ncs/v2.2.0/nrf/tests/include -Itfm/generated/interface/include -IC:/ncs/v2.2.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.2.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.2.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.2.0/nrfxlib/nrf_modem/include -Itfm/install/interface/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include -IC:/ncs/v2.2.0/nrfxlib/nrf_security/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include -IC:/ncs/v2.2.0/mbedtls/include/mbedtls -IC:/ncs/v2.2.0/mbedtls/include/psa -IC:/ncs/v2.2.0/mbedtls/library -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.2.0/nrfxlib/crypto/nrf_oberon/include -fno-strict-aliasing -Os -imacros C:/ZephyrWorkspace2.2.0/hello_world/build_voqdr_nrf9160_ns/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always --sysroot=C:/ncs/toolchains/v2.2.0/opt/zephyr-sdk// -imacros C:/ncs/v2.2.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=C:/ZephyrWorkspace2.2.0/hello_world=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.2.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.2.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/arch/arch/Arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj -MF zephyr\arch\arch\Arm\core\aarch32\cortex_m\CMakeFiles\arch__arm__core__aarch32__cortex_m.dir\fault.c.obj.d -o zephyr/arch/arch/Arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj -c C:/ncs/v2.2.0/zephyr/arch/arm/core/aarch32/cortex_m/fault.c
    In file included from C:\ncs\v2.2.0\zephyr\arch\Arm\include\kernel_arch_data.h:28,
                     from C:\ncs\v2.2.0\zephyr\arch\Arm\include\aarch32\kernel_arch_func.h:24,
                     from C:\ncs\v2.2.0\zephyr\arch\Arm\include\kernel_arch_func.h:10,
                     from C:\ncs\v2.2.0\zephyr\kernel\include\kernel_arch_interface.h:611,
                     from C:\ncs\v2.2.0\zephyr\kernel\include\kernel_internal.h:18,
                     from C:\ncs\v2.2.0\zephyr\arch\arm\core\aarch32\cortex_m\fault.c:16:
    C:/ncs/v2.2.0/zephyr/arch/Arm/include/aarch32/cortex_m/stack.h: In function 'z_arm_interrupt_stack_setup':
    C:\ncs\v2.2.0\zephyr\arch\Arm\include\aarch32\cortex_m\stack.h:49:9: warning: implicit declaration of function '__set_MSPLIM'; did you mean '__set_MSP'? [-Wimplicit-function-declaration]
       49 |         __set_MSPLIM((uint32_t)z_interrupt_stacks[0]);
          |         ^~~~~~~~~~~~
          |         __set_MSP
    C:\Users\TORJEJ~1\AppData\Local\Temp\cckCxis8.s: Assembler messages:
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:358: Error: selected processor does not support requested special purpose register -- `msr BASEPRI,r6'
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:358: Error: selected processor does not support `isb' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:591: Error: selected processor does not support `dsb 0xF' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:605: Error: selected processor does not support `isb 0xF' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:630: Error: selected processor does not support `dsb 0xF' in ARM mode
    C:\Users\TORJEJ~c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns\1\AppData\Local\Temp\cckCxis8.s:644: Error: selected processor does not support `isb 0xF' in ARM mode
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.2.0\opt\bin\cmake.EXE' --build 'c:\ZephyrWorkspace2.2.0\hello_world\build_voqdr_nrf9160_ns'

    I realize editing these .cmake-files is probably not the right way to address these issues, but perhaps it can give some hints as to what I've done wrong. Note: This is done in a ncs 2.2.0 env.

    Thank you all again for all and any help. There's probably something simple I've missed early on.

  • Hi Torje,

    Sorry for our delayed response - we are not fully staffed around the Christmas holidays. Either me or my colleague will try to get back to you next week if that's okay.

    Best regards and have a nice end of 2022.

    -Raoul

  • Hello Raoul,

    And thank you for replying. I will be awaiting your feedback while doing some further testing on my end. I will update the ticket if I gather any new info.

    Thanks again, looking forward to hearing from you!

  • Hi Torje, happy new year.

    Using NCS 2.0.0, VS Code, and Windows 11, I just tried building "hello world" for a custom nRF9160-based board. The board was generated using the VS Code custom board wizard.

    You mention you copied the Thingy91 board files to start your custom board. If you haven't done so already, could you try creating your board through the custom board wizard in the VS Code NCS extension and see if your issue persists? So far, I haven't been able to reproduce it.

    However, I did meet another (known) build issue when creating a "non-secure" custom board, which you might meet as well. To fix it, add the following two lines to your newly generated defconfig:

    CONFIG_BUILD_WITH_TFM=y
    CONFIG_TRUSTED_EXECUTION_NONSECURE=y

    See  Create a custom board with the build-in Create a new board wizard. for details on this.

    When building a "secure" custom board where TFM is disabled, everything should compile just fine even without the fix.

    Could you try doing this? At least it will confirm that your toolchain is somewhat in order.

    Best regards,

    Raoul

  • Hello Raoul,

    And thank you for looking into this issue.

    After returning to office after the holidays, it has somehow resolved it self. I am now able to build for custom boards made with both the wizard and "manually", in both SDK2.0.0 and 2.2.0, and with both "Hello world" and our custom application.

    I have not made any changes to the toolchain or other installations. I don't know what caused the issue or how it got fixed. I will make sure to post again if I get a similar problem in the future. 

    I will close this case. Thanks again.

    Kind regards,

    Torje

Related