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

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

Children
  • 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.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # 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%
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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

  • Here is the full build output:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    * 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/python@3.9/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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 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