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

TZ_NONSECURE_FUNC_PTR_CREATE SPM error with v1.0.0 for nRF9160 in linux

I am a novice and using nrf9160 DK now.I has completed the "getting started assistant" also updated the modem.

I've got a problem when building nrf9160_pca10090ns for at_client application or any other sample aplications by the following command: 

west build -b nrf9160_pca10090ns

the error is as following: actually at first I successfully builded, but i don't know why it appears this mistake now, I have also been carried out the two answers in this link https://devzone.nordicsemi.com/f/nordic-q-a/49326/tz_nonsecure_func_ptr_create-spm-error-with-v1-0-0-for-nrf9160, I currently use the version of GCC is gcc7, nrfjprog version is 10.5.0, what can I do to solve this problem? Thanks for your help!

pp@pp-OptiPlex-9020:/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client$ west build -b nrf9160_pca10090ns
source directory: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client
build directory: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build (created)
BOARD: nrf9160_pca10090ns (origin: command line)
-- Using application from '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client'
Zephyr version: 1.14.99
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3.4") 
-- Selected BOARD nrf9160_pca10090ns
-- Found west: /home/pp/.local/bin/west (found suitable version "0.6.3", minimum required is "0.5.6")
-- Cache files will be written to: /home/pp/.cache/zephyr
-- Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.dts as base
-- Overlaying /opt/sourcecode/ncs/zephyr/dts/common/common.dts
Parsing Kconfig tree in /opt/sourcecode/ncs/zephyr/Kconfig
Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns_defconfig as base
Merging /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/prj.conf
Configuration written to '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/zephyr/.config'
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gnuarmemb/bin/arm-none-eabi-gcc
-- Performing Test toolchain_is_ok
-- Performing Test toolchain_is_ok - Success
Including module: nrf in path: /opt/sourcecode/ncs/nrf
-- Using application from '/opt/sourcecode/ncs/nrf/samples/nrf9160/spm'
Zephyr version: 1.14.99
Changed board to secure nrf9160_pca10090 (NOT NS)
-- Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090.dts as base
-- Overlaying /opt/sourcecode/ncs/zephyr/dts/common/common.dts
-- Overlaying /opt/sourcecode/ncs/nrf/samples/nrf9160/spm/nrf9160_pca10090.overlay
Parsing Kconfig tree in /opt/sourcecode/ncs/zephyr/Kconfig
Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090_defconfig as base
Merging /opt/sourcecode/ncs/nrf/samples/nrf9160/spm/prj.conf
Configuration written to '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/.config'
Including module: nrf in path: /opt/sourcecode/ncs/nrf
Including module: nffs in path: /opt/sourcecode/ncs/modules/fs/nffs
Including module: segger in path: /opt/sourcecode/ncs/modules/debug/segger
Including module: mcuboot in path: /opt/sourcecode/ncs/mcuboot/zephyr
Including module: mcumgr in path: /opt/sourcecode/ncs/modules/lib/mcumgr
Including module: tinycbor in path: /opt/sourcecode/ncs/modules/lib/tinycbor
Including module: nrfxlib in path: /opt/sourcecode/ncs/nrfxlib
Including module: nffs in path: /opt/sourcecode/ncs/modules/fs/nffs
Including module: segger in path: /opt/sourcecode/ncs/modules/debug/segger
Including module: mcuboot in path: /opt/sourcecode/ncs/mcuboot/zephyr
Including module: mcumgr in path: /opt/sourcecode/ncs/modules/lib/mcumgr
Including module: tinycbor in path: /opt/sourcecode/ncs/modules/lib/tinycbor
Including module: nrfxlib in path: /opt/sourcecode/ncs/nrfxlib
CMake Warning at /opt/sourcecode/ncs/zephyr/CMakeLists.txt:1345 (message):
  

        ------------------------------------------------------------
        --- WARNING:  __ASSERT() statements are globally ENABLED ---
        --- The kernel will run more slowly and use more memory  ---
        ------------------------------------------------------------


Running Partition Manager...
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build
[8/309] Preparing syscall dependency handling

[9/309] Preparing syscall dependency handling

[43/309] Building C object spm/zephyr/...ourcecode/ncs/nrf/subsys/spm/spm.c.obj
FAILED: ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DBUILD_VERSION=v1.14.99-ncs2 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DNRF9160_XXAA -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I/opt/sourcecode/ncs/zephyr/kernel/include -I/opt/sourcecode/ncs/zephyr/arch/arm/include -I/opt/sourcecode/ncs/zephyr/include -I/opt/sourcecode/ncs/zephyr/include/drivers -Ispm/zephyr/include/generated -I/opt/sourcecode/ncs/zephyr/soc/arm/nordic_nrf/nrf91 -I/opt/sourcecode/ncs/zephyr/soc/arm/nordic_nrf/include -I/opt/sourcecode/ncs/zephyr/lib/libc/minimal/include -I/opt/sourcecode/ncs/zephyr/ext/hal/cmsis/Include -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/drivers/include -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/hal -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/mdk -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/. -I/opt/sourcecode/ncs/nrf/include -I/opt/sourcecode/ncs/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/mbedtls -Ispm/zephyr/modules/nrfxlib/nrf_security/include -I/opt/sourcecode/ncs/mbedtls/include -I/opt/sourcecode/ncs/mbedtls/include/mbedtls -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include-fixed -Os -nostdinc -g -imacros /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -mthumb -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -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=/opt/sourcecode/ncs/zephyr=. -ffunction-sections -fdata-sections -mabi=aapcs -march=armv8-m.main+dsp -mcmse -std=c99 -MD -MT spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj -MF spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj.d -o spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj   -c /opt/sourcecode/ncs/nrf/subsys/spm/spm.c
/opt/sourcecode/ncs/nrf/subsys/spm/spm.c: In function 'spm_jump':
/opt/sourcecode/ncs/nrf/subsys/spm/spm.c:392:14: error: called object is not a function or function pointer
  reset_ns = TZ_NONSECURE_FUNC_PTR_CREATE(vtor_ns[1]);
[43/309] Building C object spm/zephyr/...les/spm_zephyr.dir/lib/os/printk.c.obj
ninja: build stopped: subcommand failed.
ERROR: command exited with status 1: /usr/local/bin/cmake --build /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build

Parents Reply Children
  • I am working on NCS v1.0.0. And I run the build command as you said, the error still exists.

    pp@pp-OptiPlex-9020:/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client$ west build -b nrf9160_pca10090ns -p
    Making build dir /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build pristine
    source directory: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client
    build directory: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build
    BOARD: nrf9160_pca10090ns (origin: command line)
    -- Using application from '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client'
    Zephyr version: 1.14.99
    -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.5.2", minimum required is "3.4") 
    -- Selected BOARD nrf9160_pca10090ns
    -- Found west: /home/pp/.local/bin/west (found suitable version "0.6.3", minimum required is "0.5.6")
    -- Cache files will be written to: /home/pp/.cache/zephyr
    -- Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns.dts as base
    -- Overlaying /opt/sourcecode/ncs/zephyr/dts/common/common.dts
    Parsing Kconfig tree in /opt/sourcecode/ncs/zephyr/Kconfig
    Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090ns_defconfig as base
    Merging /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/prj.conf
    Configuration written to '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/zephyr/.config'
    -- The C compiler identification is GNU 8.3.1
    -- The CXX compiler identification is GNU 8.3.1
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/gnuarmemb/bin/arm-none-eabi-gcc
    -- Performing Test toolchain_is_ok
    -- Performing Test toolchain_is_ok - Success
    Including module: nrf in path: /opt/sourcecode/ncs/nrf
    -- Using application from '/opt/sourcecode/ncs/nrf/samples/nrf9160/spm'
    Zephyr version: 1.14.99
    Changed board to secure nrf9160_pca10090 (NOT NS)
    -- Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090.dts as base
    -- Overlaying /opt/sourcecode/ncs/zephyr/dts/common/common.dts
    -- Overlaying /opt/sourcecode/ncs/nrf/samples/nrf9160/spm/nrf9160_pca10090.overlay
    Parsing Kconfig tree in /opt/sourcecode/ncs/zephyr/Kconfig
    Loading /opt/sourcecode/ncs/zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090_defconfig as base
    Merging /opt/sourcecode/ncs/nrf/samples/nrf9160/spm/prj.conf
    Configuration written to '/opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/.config'
    Including module: nrf in path: /opt/sourcecode/ncs/nrf
    Including module: nffs in path: /opt/sourcecode/ncs/modules/fs/nffs
    Including module: segger in path: /opt/sourcecode/ncs/modules/debug/segger
    Including module: mcuboot in path: /opt/sourcecode/ncs/mcuboot/zephyr
    Including module: mcumgr in path: /opt/sourcecode/ncs/modules/lib/mcumgr
    Including module: tinycbor in path: /opt/sourcecode/ncs/modules/lib/tinycbor
    Including module: nrfxlib in path: /opt/sourcecode/ncs/nrfxlib
    Including module: nffs in path: /opt/sourcecode/ncs/modules/fs/nffs
    Including module: segger in path: /opt/sourcecode/ncs/modules/debug/segger
    Including module: mcuboot in path: /opt/sourcecode/ncs/mcuboot/zephyr
    Including module: mcumgr in path: /opt/sourcecode/ncs/modules/lib/mcumgr
    Including module: tinycbor in path: /opt/sourcecode/ncs/modules/lib/tinycbor
    Including module: nrfxlib in path: /opt/sourcecode/ncs/nrfxlib
    CMake Warning at /opt/sourcecode/ncs/zephyr/CMakeLists.txt:1345 (message):
      
    
            ------------------------------------------------------------
            --- WARNING:  __ASSERT() statements are globally ENABLED ---
            --- The kernel will run more slowly and use more memory  ---
            ------------------------------------------------------------
    
    
    Running Partition Manager...
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build
    [8/309] Preparing syscall dependency handling
    
    [9/309] Preparing syscall dependency handling
    
    [26/309] Building C object spm/zephyr/...ourcecode/ncs/nrf/subsys/spm/spm.c.obj
    FAILED: ccache /opt/gnuarmemb/bin/arm-none-eabi-gcc -DBUILD_VERSION=v1.14.99-ncs2 -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DNRF9160_XXAA -DUSE_PARTITION_MANAGER=1 -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I/opt/sourcecode/ncs/zephyr/kernel/include -I/opt/sourcecode/ncs/zephyr/arch/arm/include -I/opt/sourcecode/ncs/zephyr/include -I/opt/sourcecode/ncs/zephyr/include/drivers -Ispm/zephyr/include/generated -I/opt/sourcecode/ncs/zephyr/soc/arm/nordic_nrf/nrf91 -I/opt/sourcecode/ncs/zephyr/soc/arm/nordic_nrf/include -I/opt/sourcecode/ncs/zephyr/lib/libc/minimal/include -I/opt/sourcecode/ncs/zephyr/ext/hal/cmsis/Include -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/drivers/include -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/hal -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/nrfx/mdk -I/opt/sourcecode/ncs/zephyr/ext/hal/nordic/. -I/opt/sourcecode/ncs/nrf/include -I/opt/sourcecode/ncs/nrfxlib/crypto/nrf_cc310_mbedcrypto/include/mbedtls -Ispm/zephyr/modules/nrfxlib/nrf_security/include -I/opt/sourcecode/ncs/mbedtls/include -I/opt/sourcecode/ncs/mbedtls/include/mbedtls -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include -isystem /opt/gnuarmemb/bin/../lib/gcc/arm-none-eabi/8.3.1/include-fixed -Os -nostdinc -g -imacros /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build/spm/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -mthumb -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -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=/opt/sourcecode/ncs/zephyr=. -ffunction-sections -fdata-sections -mabi=aapcs -march=armv8-m.main+dsp -mcmse -std=c99 -MD -MT spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj -MF spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj.d -o spm/zephyr/CMakeFiles/spm_zephyr.dir/opt/sourcecode/ncs/nrf/subsys/spm/spm.c.obj   -c /opt/sourcecode/ncs/nrf/subsys/spm/spm.c
    /opt/sourcecode/ncs/nrf/subsys/spm/spm.c: In function 'spm_jump':
    /opt/sourcecode/ncs/nrf/subsys/spm/spm.c:392:14: error: called object is not a function or function pointer
      reset_ns = TZ_NONSECURE_FUNC_PTR_CREATE(vtor_ns[1]);
    [26/309] Building C object spm/zephyr/...core/cortex_m/cmse/arm_core_cmse.c.obj
    ninja: build stopped: subcommand failed.
    ERROR: command exited with status 1: /usr/local/bin/cmake --build /opt/sourcecode/ncs/nrf/samples/nrf9160/at_client/build
    

    Best wishes!

  • Hi!

    Looks like you're still using GCC 8.

    -- The C compiler identification is GNU 8.3.1

    I got the same error as you while using GCC 8 but when I switched to GCC 7 (2018-Q2) it worked. 

    Best regards,

    Heidi

  • Dear Heidi,

    Thank you so much. I just switched gcc 8 to gcc 7 and the build command was successful.

    Best wishes!

Related