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

at_client build failed

I am trying to build the nRF Connect SDK project  "at_client" that is provided with the IDE. I also tried the asset_tracker project with a similiar result.

This is my first time using this environment. I want to evaluate the nRF9160 for a new product development.

I am using nRf Connect v1.51

Rebuilding ‘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’
Rebuilding ‘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’
Rebuilding ‘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’
Rebuilding ‘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’
Rebuilding ‘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’
Rebuilding ‘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/zephyr_prebuilt.elf
\Nordic\v1.5.1\toolchain\opt\bin\arm-none-eabi-gcc.exe zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr\zephyr_prebuilt.elf -Wl,-T zephyr/linker.cmd -Wl,-Map=C:/Nordic/v1.5.1/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/zephyr/zephyr_prebuilt.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/libarch__arm__core__aarch32__cortex_m__mpu.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/cortex_m/tz/libarch__arm__core__aarch32__cortex_m__tz.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/boards/boards/arm/thingy91_nrf9160/lib..__nrf__boards__arm__thingy91_nrf9160.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/serial/libdrivers__serial.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/nrfxlib/nrf_security/src/mbedtls/libmbedtls_base_vanilla.a modules/hal_nordic/libmodules__hal_nordic.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -L"c:/nordic/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/thumb/v8-m.main+fp/hard" -LC:/Nordic/v1.5.1/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/zephyr -lgcc -Wl,--print-memory-usage zephyr/arch/common/libisr_tables.a modules/nrfxlib/nrf_security/src/mbedtls/shared/libmbedcrypto_shared.a modules/nrfxlib/nrf_security/src/mbedtls/cc310/libmbedcrypto_cc3xx.a C:/Nordic/v1.5.1/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_platform_0.9.7.a -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfpu=fpv5-sp-d16 -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -Wl,--out-implib=C:/Nordic/v1.5.1/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/libspmsecureentries.a -Wl,--cmse-implib && cd ."
KB 48 KB 133.33%
B 64 KB 13.38%
B 2 KB 4.30c:/nordic/v1.5.1/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr\zephyr_prebuilt.elf section `.gnu.sgstubs' will not fit in region `FLASH'
SPM and app are sharing an SPU region. Cannot partition flash correctly into secure and non-secure. Adjust partitions sizes so they are placed in separate regions.
region `FLASH' overflowed by 16384 bytes
ld returned 1 exit status
build stopped: subcommand failed.
Build failed

  • Hello, 

    Can you provide some more details on how you are building the project? Please provide screenshots of your build process.

    Thanks

    Kind regards,
    Øyvind

  • Not sure what screenshots you are looking for but I am just trying to build the at_client project. It seems like there is some issue with memory configuration. I did not change any defaults. Just did a rebuild all.

  • Same issue here. Tested with "west build -b thingy91_nrf9160ns" on both sdk 1.5.0 and sdk 1.5.1. 

    All of them fail to fit it into flash

  • Hello, 

    I'm not able to reproduce the issue you mention above. I opened the at_client sample as below through Open nRF Connect SDK project, using SES in Toolchain Manager NCS 1.5.1:

    I tried building with setting "project all" under Solution 'build' as the active project, without any issues. 

    I also built using the default setting "Project 'zephyr/merged.hex' as active project.

    Please reinstall the your NCS install, and please make sure that no virus SW or firewall is causing any issues. We have seen corporate computers where misc security settings block the install of NCS.

    Kind regards,
    Øyvind

  • Note: The issue I had, could be worked around with by enabling CONFIG_BOOTLOADER_MCUBOOT in prj.conf..  Then it would fit into flash

    Before:

    FAILED: zephyr/zephyr_prebuilt.elf
    cmd.exe /C "cd . && C:\Nordic\nordicsdk\v1.5.0\toolchain\opt\bin\arm-none-eabi-gcc.exe    zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj  -o zephyr\zephyr_prebuilt.elf  -Wl,-T  zephyr/linker.cmd  -Wl,-Map=C:/Nordic/nordicsdk/v1.5.0/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/zephyr/zephyr_prebuilt.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/mpu/libarch__arm__core__aarch32__cortex_m__mpu.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/tz/libarch__arm__core__aarch32__cortex_m__tz.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/boards/boards/arm/thingy91_nrf9160/lib..__nrf__boards__arm__thingy91_nrf9160.a  zephyr/drivers/i2c/libdrivers__i2c.a  zephyr/drivers/serial/libdrivers__serial.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/nrfxlib/nrf_security/src/mbedtls/libmbedtls_base_vanilla.a  modules/hal_nordic/libmodules__hal_nordic.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"c:/nordic/nordicsdk/v1.5.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/thumb/v8-m.main+fp/hard"  -LC:/Nordic/nordicsdk/v1.5.0/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/zephyr  -lgcc  -Wl,--print-memory-usage  zephyr/arch/common/libisr_tables.a  modules/nrfxlib/nrf_security/src/mbedtls/shared/libmbedcrypto_shared.a  modules/nrfxlib/nrf_security/src/mbedtls/cc310/libmbedcrypto_cc3xx.a  C:/Nordic/nordicsdk/v1.5.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m33/hard-float/no-interrupts/libnrf_cc310_platform_0.9.7.a  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfpu=fpv5-sp-d16  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -no-pie  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,--out-implib=C:/Nordic/nordicsdk/v1.5.0/nrf/samples/nrf9160/at_client/build_thingy91_nrf9160ns/spm/libspmsecureentries.a  -Wl,--cmse-implib && cd ."
    Memory region         Used Size  Region Size  %age Used
               FLASH:         64 KB        48 KB    133.33%
                SRAM:        8768 B        64 KB     13.38%
            IDT_LIST:          88 B         2 KB      4.30c:/nordic/nordicsdk/v1.5.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr\zephyr_prebuilt.elf section `.gnu.sgstubs' will not fit in region `FLASH'
    

    After:

    [178/185] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    [179/185] Linking C static library zephyr\kernel\libkernel.a
    [180/185] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       39180 B        48 KB     79.71%
                SRAM:       22360 B     178968 B     12.49%
            IDT_LIST:          88 B         2 KB      4.30%
    [181/185] Generating linker_pass_final.cmd
    [182/185] Generating isr_tables.c
    [183/185] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
    [184/185] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
    [185/185] Linking C executable zephyr\zephyr.elf
    [186/199] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       77688 B     425472 B     18.26%
                SRAM:       35352 B     178968 B     19.75%
            IDT_LIST:         168 B         2 KB      8.20%
    [190/199] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
    [192/199] No install step for 'mcuboot_subimage'
    [193/199] Linking C executable zephyr\zephyr.elf
    [194/199] Completed 'mcuboot_subimage'
    [195/199] Generating zephyr/mcuboot_primary.hex
    [196/199] Generating zephyr/mcuboot_primary_app.hex
    [197/199] Generating ../../zephyr/app_update.bin, ../../zephyr/app_signed.hex, ../../zephyr/app_test_update.hex, ../../zephyr/app_moved_test_update.hex
    [198/199] Generating ../../zephyr/dfu_application.zip
    [199/199] Generating zephyr/merged.hex
    
    

Related