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

Parents
  • 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

  • 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
    
    

  • Hello, 

    Sorry for not picking up the root cause on this. Yes, you are right this was an issue that has been solved. When did you last update your NCS?

    The fix is found here, and should be implemented:
    https://github.com/nrfconnect/sdk-nrf/pull/4103

    Can you please run Update SDK and update Toolchain from the Toolchain Manager dropdown menu?

  • Hi,

    Wow, I didn't realize that sdk "version 1.5.0" is not a version, but more like a branch.. which has its internal .. tags? That's sort of confusing no? 

    Anyway, quickly did the SDK update as you said, and tried to build again with "west build -b thingy91_nrf9160ns"/using the IDE as you explained. So far no luck (flash keeps overlfowing). Are you sure it should work on v1.5.0 too?

  • Arnout said:
    Wow, I didn't realize that sdk "version 1.5.0" is not a version, but more like a branch.. which has its internal .. tags? That's sort of confusing no? 

    Not sure what you mean with internal. Yes, the versioning of NCS is based on Git tags. Have a look at the NCS documentation on Revisions. The master branch is used for latest and greatest development, while tags are stable "releases". 

    Arnout said:
    Are you sure it should work on v1.5.0 too?

    Yes, it should work. Have you tested on latest tag v1.6.0? This should have the fix. 

Reply
  • Arnout said:
    Wow, I didn't realize that sdk "version 1.5.0" is not a version, but more like a branch.. which has its internal .. tags? That's sort of confusing no? 

    Not sure what you mean with internal. Yes, the versioning of NCS is based on Git tags. Have a look at the NCS documentation on Revisions. The master branch is used for latest and greatest development, while tags are stable "releases". 

    Arnout said:
    Are you sure it should work on v1.5.0 too?

    Yes, it should work. Have you tested on latest tag v1.6.0? This should have the fix. 

Children
  • Hi,

    Ok, I got confused by this

    But, as your link displays, v1.5.0 is a tag in the master (nrf-sdk) repo, which points to fixed tags of the child repos. In other words, v1.5.0 is a fixed version, and is not updated in the background. Or in other words, if I see this problem on v1.5.0, I will always keep seeing it, unless I use a newver vresion of the SDK.

    Hence, I don't fully understand your last comment. I asked whether it should work on v1.5.0, and you reply "yes, it should work on v1.6.0". I'd expect and answer like "no, this is only fixed on v1.6.0". or "yes, it should already work (but that does not explain the issue is seen on that version then), BUT it should also work on v1.6.0, so please try that too"

    Anyway, quickly downloaded v1.6.0 and tested. There it works. 

    Given that 1.5.0 was released on 24/2/21 and the fix was only done in march, it makes sense it would never work on v1.5.0.

    Kind regards,

    Arnout

  • Hi Arnout, 

    Yes, you are right. 

    Kind regards,
    Øyvind 

Related