Flash overflow?

Hello,

I'm trying to merge together a couple of sample projects to make a prototype (in particular, the LTE-BLE gateway, and AWS-IoT samples) - to run on the nRF 9160DK

When I try and compile, I get the following errors:

/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `text' will not fit in region `FLASH'

/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 119504 bytes

How can I resolve this please? Or is it just too big to try and fit onto the Dev Kit?

Regards,

Ben

Parents
  • Hi Ben,

    The error does mean that your compiled application is too big to fit on the memory. May I ask how you arrive at this application?

    It might be helpful if you can share your compiled Devicetree and Kconfig. They are in the files named zephyr.dts and .config, under <build directory>/zephyr.

    Regards,

    Hieu

  • Hi - I'm trying to add BLE scanning into the AWS_IoT sample (the BLE was copied from the BLE_LTE sample)

    0207.zephyr.dts5078.config.txt

  • Hi Ben,

    I just tried to merge the configuration of the LTE BLE Gateway sample into the AWS IoT sample, and did not run into your issue. There is plenty of space left in the application and MCUboot. Only TF-M is close to limit, but I believe that is intentional.

    # MCUboot
    
    [171/171] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       29398 B        48 KB     59.81%
                 RAM:       16304 B        32 KB     49.76%
            IDT_LIST:          0 GB        32 KB      0.00%
    
    
    
    # TFM and application
    [165/169] Linking C executable bin\tfm_s.axf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       31584 B      32256 B     97.92%
                 RAM:       10416 B        32 KB     31.79%
    [23/428] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    ----- Installing platform NS -----
    [419/428] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      274564 B       448 KB     59.85%
                 RAM:       93560 B     195224 B     47.92%
            IDT_LIST:          0 GB        32 KB      0.00%
    [423/428] Generating ../../zephyr/app_update.bin
    image.py: sign the payload
    [425/428] Generating ../../zephyr/app_signed.hex
    image.py: sign the payload
    [426/428] Generating ../../zephyr/app_test_update.hex
    image.py: sign the payload
    [428/428] Generating zephyr/merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 
    

    I am a little curious why there are a number of LVGL configurations set in your compiled Kconfig. CONFIG_LVGL itself is not set though, so I think it shouldn't impact the size, but I cannot be sure.

    Could you please elaborate your steps in more details? Are you certain that you haven't added anything besides what is already in the two samples?

    Could you please also check your build log to see at which image you encounter the problem? If you are not sure, please give me the full build log.

    Also, what version of NCS are you using?


    Please be informed that our team is currently having reduced availability due to the Easter holiday. There will be some delays in our response during this time, but we will respond to you at the earliest opportunity. Our apologies for the inconvenience.

  • That's odd! Would it be possible for you to share your project so I can check that I can build it successfully?

    I'm using nRF Connect SDK v2.5.2

Reply Children
  • Here is the full build output:

     *  Executing task: nRF Connect: Generate config nrf9160dk_nrf9160_ns for /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo 
    
    Building edge-plus-iot-demo
    west build --build-dir /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo --pristine --board nrf9160dk_nrf9160_ns --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo
    -- CMake version: 3.20.5
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/benaskem/Library/Caches/zephyr
    -- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.2/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf9160_ns, Revision: 0.14.0
    -- Found host-tools: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found Dtc: /opt/nordic/ncs/toolchains/20d68df7e5/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
    -- Found BOARD.dts: /opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns.dts
    -- Found devicetree overlay: /opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_0_14_0.overlay
    -- Found devicetree overlay: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/boards/nrf9160dk_nrf9160_ns.overlay
    -- Found devicetree overlay: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/boards/nrf9160dk_nrf9160_ns_0_14_0.overlay
    -- Generated zephyr.dts: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/dts.cmake
    
    warning: Experimental symbol TFM_EXPERIMENTAL is enabled.
    
    
    warning: Experimental symbol NET_CONNECTION_MANAGER is enabled.
    
    Parsing /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/Kconfig
    Loaded configuration '/opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_ns_defconfig'
    Merged configuration '/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/prj.conf'
    Merged configuration '/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/boards/nrf9160dk_nrf9160_ns.conf'
    Configuration saved to '/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/.config'
    Kconfig header saved to '/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found version "3.9.6") found components: Interpreter 
    Changed board to secure nrf9160dk_nrf9160 (NOT NS)
    
    === child image mcuboot -  begin ===
    loading initial cache file /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: /opt/nordic/ncs/v2.5.2/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.20.5
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/benaskem/Library/Caches/zephyr
    -- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.2/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf9160dk_nrf9160, Revision: 0.14.0
    -- Found host-tools: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk)
    -- Found Dtc: /opt/nordic/ncs/toolchains/20d68df7e5/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
    -- Found BOARD.dts: /opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160.dts
    -- Found devicetree overlay: /opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_0_14_0.overlay
    -- Found devicetree overlay: /opt/nordic/ncs/v2.5.2/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: /Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/dts.cmake
    Parsing /opt/nordic/ncs/v2.5.2/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/opt/nordic/ncs/v2.5.2/zephyr/boards/arm/nrf9160dk_nrf9160/nrf9160dk_nrf9160_defconfig'
    Merged configuration '/opt/nordic/ncs/v2.5.2/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/opt/nordic/ncs/v2.5.2/nrf/modules/mcuboot/tfm.conf'
    Merged configuration '/opt/nordic/ncs/v2.5.2/nrf/modules/mcuboot/fih_low_enable.conf'
    Merged configuration '/opt/nordic/ncs/v2.5.2/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration '/Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/.config'
    Kconfig header saved to '/Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    MCUBoot bootloader key file: /opt/nordic/ncs/v2.5.2/bootloader/mcuboot/root-ec-p256.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/benaskem/Documents/nrF_Connect_SDK/git/edge-plus-iot-demo/build/mcuboot
    === child image mcuboot -  end ===
    
    CMake Warning at /opt/nordic/ncs/v2.5.2/nrf/modules/mcuboot/CMakeLists.txt:320 (message):
      
    
              ---------------------------------------------------------
              --- WARNING: Using default MCUBoot key, it should not ---
              --- be used for production.                           ---
              ---------------------------------------------------------
              
    
    
    
    CMake Warning at /opt/nordic/ncs/v2.5.2/zephyr/CMakeLists.txt:1958 (message):
      __ASSERT() statements are globally ENABLED
    
    
    CMake Warning at /opt/nordic/ncs/v2.5.2/nrf/cmake/partition_manager.cmake:79 (message):
      
    
              ---------------------------------------------------------------------
              --- WARNING: Using a bootloader without pm_static.yml.            ---
              --- There are cases where a deployed product can consist of       ---
              --- multiple images, and only a subset of these images can be     ---
              --- upgraded through a firmware update mechanism. In such cases,  ---
              --- the upgradable images must have partitions that are static    ---
              --- and are matching the partition map used by the bootloader     ---
              --- programmed onto the device.                                   ---
              ---------------------------------------------------------------------
              
    
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/kernel.cmake:247 (include)
      /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/zephyr_default.cmake:138 (include)
      /opt/nordic/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /opt/nordic/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:9 (find_package)
    
    
    Dropping partition 'nonsecure_storage' since it is empty.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build
    -- west build: building application
    [1/449] Preparing syscall dependency handling
    
    [1/182] Preparing syscall dependency handling
    
    [11/182] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.2/zephyr), build: 4b5ef270413a
    [182/182] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       31254 B        48 KB     63.59%
                 RAM:       16368 B        88 KB     18.16%
            IDT_LIST:          0 GB         2 KB      0.00%
    [13/449] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (/opt/nordic/ncs/v2.5.2/zephyr), build: 4b5ef270413a
    [14/449] Generating ../../tfm/CMakeCache.txt
    CMake Warning at cmake/version.cmake:22 (message):
      Actual TF-M version is not available from Git repository.  Settled to
      v1.8.0
    Call Stack (most recent call first):
      CMakeLists.txt:22 (include)
    
    
    -- Found Git: /opt/nordic/ncs/toolchains/20d68df7e5/bin/git (found version "2.37.3") 
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found version "3.9.6") found components: Interpreter 
    CMake Deprecation Warning at /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
      'PYTHON_PREFER' variable is deprecated.  Please use Python3_EXECUTABLE
      instead.
    Call Stack (most recent call first):
      /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/python.cmake:16 (find_package)
      /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/user_cache.cmake:30 (include)
      /opt/nordic/ncs/v2.5.2/zephyr/cmake/modules/extensions.cmake:5 (include)
      /opt/nordic/ncs/v2.5.2/nrf/subsys/nrf_security/tfm/CMakeLists.txt:36 (include)
    
    
    -- Found Python3: /opt/nordic/ncs/toolchains/20d68df7e5/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/benaskem/Library/Caches/zephyr
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/tfm
    [205/209] Linking C executable bin/tfm_s.axf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      129932 B     261632 B     49.66%
                 RAM:       52788 B        88 KB     58.58%
    [24/449] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    [109/449] Building C object CMakeFiles/app.dir/src/ble.c.obj
    In file included from ../src/ble.c:2:
    ../src/edge.h:52:25: warning: 'key_handle' defined but not used [-Wunused-variable]
       52 | static psa_key_handle_t key_handle;
          |                         ^~~~~~~~~~
    ../src/edge.h:50:16: warning: 'm_decrypted_text' defined but not used [-Wunused-variable]
       50 | static uint8_t m_decrypted_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE];
          |                ^~~~~~~~~~~~~~~~
    ../src/edge.h:49:16: warning: 'm_encrypted_text' defined but not used [-Wunused-variable]
       49 | static uint8_t m_encrypted_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE];
          |                ^~~~~~~~~~~~~~~~
    ../src/edge.h:45:16: warning: 'm_plain_text' defined but not used [-Wunused-variable]
       45 | static uint8_t m_plain_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE] = {
          |                ^~~~~~~~~~~~
    [116/449] Building C object CMakeFiles/app.dir/src/main.c.obj
    In file included from ../src/main.c:13:
    ../src/edge.h:52:25: warning: 'key_handle' defined but not used [-Wunused-variable]
       52 | static psa_key_handle_t key_handle;
          |                         ^~~~~~~~~~
    ../src/edge.h:50:16: warning: 'm_decrypted_text' defined but not used [-Wunused-variable]
       50 | static uint8_t m_decrypted_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE];
          |                ^~~~~~~~~~~~~~~~
    ../src/edge.h:49:16: warning: 'm_encrypted_text' defined but not used [-Wunused-variable]
       49 | static uint8_t m_encrypted_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE];
          |                ^~~~~~~~~~~~~~~~
    ../src/edge.h:45:16: warning: 'm_plain_text' defined but not used [-Wunused-variable]
       45 | static uint8_t m_plain_text[NRF_CRYPTO_EXAMPLE_AES_MAX_TEXT_SIZE] = {
          |                ^~~~~~~~~~~~
    [435/449] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
    : && ccache /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr/zephyr_pre0.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/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/boards/arm/nrf9160dk_nrf9160/libboards__arm__nrf9160dk_nrf9160.a  zephyr/subsys/random/libsubsys__random.a  zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a  zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a  zephyr/subsys/dfu/boot/libsubsys__dfu__boot.a  zephyr/subsys/net/libsubsys__net.a  zephyr/subsys/net/l2/offloaded_netdev/libsubsys__net__l2__offloaded_netdev.a  zephyr/subsys/net/ip/libsubsys__net__ip.a  zephyr/subsys/net/lib/mqtt/libsubsys__net__lib__mqtt.a  zephyr/subsys/net/lib/http/libsubsys__net__lib__http.a  zephyr/subsys/net/conn_mgr/libsubsys__net__conn_mgr.a  zephyr/drivers/bluetooth/libdrivers__bluetooth.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/entropy/libdrivers__entropy.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/lib/nrf_modem_lib/lib..__nrf__lib__nrf_modem_lib.a  modules/nrf/lib/dk_buttons_and_leds/lib..__nrf__lib__dk_buttons_and_leds.a  modules/nrf/lib/at_monitor/lib..__nrf__lib__at_monitor.a  modules/nrf/lib/at_host/lib..__nrf__lib__at_host.a  modules/nrf/lib/at_cmd_parser/lib..__nrf__lib__at_cmd_parser.a  modules/nrf/lib/lte_link_control/lib..__nrf__lib__lte_link_control.a  modules/nrf/lib/modem_info/lib..__nrf__lib__modem_info.a  modules/nrf/lib/pdn/lib..__nrf__lib__pdn.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/lib/hw_id/lib..__nrf__lib__hw_id.a  modules/nrf/lib/modem_antenna/lib..__nrf__lib__modem_antenna.a  modules/nrf/subsys/nrf_security/src/zephyr/libmbedtls_zephyr.a  modules/nrf/subsys/net/lib/nrf_cloud/lib..__nrf__subsys__net__lib__nrf_cloud.a  modules/nrf/subsys/net/lib/download_client/lib..__nrf__subsys__net__lib__download_client.a  modules/nrf/subsys/net/lib/fota_download/lib..__nrf__subsys__net__lib__fota_download.a  modules/nrf/subsys/net/lib/aws_jobs/lib..__nrf__subsys__net__lib__aws_jobs.a  modules/nrf/subsys/net/lib/aws_fota/lib..__nrf__subsys__net__lib__aws_fota.a  modules/nrf/subsys/net/lib/aws_iot/lib..__nrf__subsys__net__lib__aws_iot.a  modules/nrf/subsys/dfu/dfu_target/lib..__nrf__subsys__dfu__dfu_target.a  modules/nrf/subsys/fw_info/lib..__nrf__subsys__fw_info.a  modules/nrf/modules/tfm/zephyr/libtfm_api_nrf.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/trusted-firmware-m/libtfm_api.a  modules/cjson/libcjson.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  /opt/nordic/ncs/v2.5.2/nrfxlib/nrf_modem/lib/nRF9160/soft-float/libmodem.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp"  -L/Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  tfm/secure_fw/s_veneers.o  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -DPICOLIBC_INTEGER_PRINTF_SCANF  modules/nrf/subsys/nrf_security/src/libmbedtls.a  modules/nrf/subsys/nrf_security/src/libmbedx509.a  modules/nrf/subsys/nrf_security/src/libmbedcrypto.a  /opt/nordic/ncs/v2.5.2/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_mbedtls_3.0.13.a  modules/nrf/subsys/nrf_security/src/libmbedcrypto_base.a  -mcpu=cortex-m33  -mthumb  -mabi=aapcs  -mfp16-format=ieee  /opt/nordic/ncs/v2.5.2/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_3.0.13.a  --specs=picolibc.specs  -lc  -lgcc && cd /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build/zephyr && /opt/nordic/ncs/toolchains/20d68df7e5/Cellar/cmake/3.20.5/bin/cmake -E true
    /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/zephyr_pre0.elf section `text' will not fit in region `FLASH'
    /opt/nordic/ncs/toolchains/20d68df7e5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: region `FLASH' overflowed by 119504 bytes
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/20d68df7e5/bin/cmake --build /Users/benaskem/Documents/nRF_Connect_SDK/git/edge-plus-iot-demo/build
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

  • Hi Ben,

    Sorry for the long wait. We have had the Easter holiday.

    From your build log, the failure happened during the application compilation, but I can't see any further what the problem could be.

    Here is my project. I used nRF Connect SDK v2.6.0, but there shouldn't be much difference. Please let me know if you need v2.5.2 specifically.

    aws_iot_add_lte_ble_gateway_260.zip

  • Thanks Hieu,

    I can successfully build the project you shared. I tried adding simple BLE scanning, but I'm getting the following error:

    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331

     I guess this is another configuration I need to set somewhere?

    On another note - I don't quite understand how you've added the BLE to the config - as kconfig parameters such as CONFIG_BT=y are in a separate .conf file.

    I added them to the main prj.conf for the purposes of this build - but am I missing something? How to I tell it to also read lte_ble_gateway.conf?

    aws_iot_add_lte_ble_gateway_260_with_ble_scan.zip

  • Hi Ben,

    BenA said:

    I can successfully build the project you shared. I tried adding simple BLE scanning, but I'm getting the following error:

    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331

     I guess this is another configuration I need to set somewhere?

    Have you flashed the HCI application onto the nRF52840 device on the DK? If not, that would be the problem. The design is that the nRF9160 will run only the BLE Host application, and the nRF52840 will run the BLE Controller application.

    Please refer to the documentation of the LTE BLE Gateway sample for more information.

    BenA said:

    On another note - I don't quite understand how you've added the BLE to the config - as kconfig parameters such as CONFIG_BT=y are in a separate .conf file.

    I added them to the main prj.conf for the purposes of this build - but am I missing something? How to I tell it to also read lte_ble_gateway.conf?

    You guessed right. The other .conf file can be included in the build.

    If you are building from the command line with west, refer to this guide: Application Development — Zephyr Project documentation (nRF Connect SDK) (nordicsemi.com).

    If you are building with the nRF Connect for VS Code Extension, you can specify additional .conf file to be included in a build configuration:

    You might also want to know that the nRF Connect SDK also include a solution for different "build types" that makes use of different .conf files. However, that's not what I am using here.

  • Hi - yes, I've built and flashed the hci_lpuart sample to the nRF52 - but I'm still getting the same issue:

    *** Booting nRF Connect SDK d96769faceca ***
    [00:00:00.253,631] <inf> aws_iot_sample: The AWS IoT sample started, version: v1.0.0
    Initialising BLE
    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331
            command opcode 0x0c03 timeout with err -11
    [00:00:10.264,129] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
    [00:00:10.264,160] <err> os: r3/a4:  0x2000d4a0 r12/ip:  0x00000010 r14/lr:  0x0001f625
    [00:00:10.264,160] <err> os:  xpsr:  0x41000000
    [00:00:10.264,160] <err> os: Faulting instruction address (r15/pc): 0x0001f630
    [00:00:10.264,221] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:10.264,251] <err> os: Current thread: 0x20010b90 (unknown)
    [00:00:10.320,587] <err> fatal_error: Resetting system

Related