Thingy:91 (nRF9160) with nRF SDK 2.6.1 region `FLASH' overflowed error building TFM onomondo softsim_static_profile sample

Hi,

When building the Onomondo softsim_static_profile sample using nRF SDK 2.6.1 I get a region `FLASH' overflowed build error for mcuboot_subimage.

c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x1a120 of bin\tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: bin\tfm_s.axf section `.psa_interface_thread_fn_call' will not fit in region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x1fc40 of bin\tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x1a120 of bin\tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: address 0x1fc40 of bin\tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: region `FLASH' overflowed by 32100 bytes
Memory region Used Size Region Size %age Used
FLASH: 80740 B 48640 B 166.00%
RAM: 47636 B 88 KB 52.86%
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
[21/346] Completed 'mcuboot_subimage'

It's a very simple main.c sample - is there a configuration change possible to build this successfully as I assumed this should just work being a sample app?

Thanks,

James

Parents Reply Children
  • Hi,

    Yes, the updated code on GitHub now allows me to build the static profile sample. However, when I run the sample with the iBasic physical SIM inserted I get an "LTE Connected" logged, but when I remove the iBasic physical SIM nothing is logged at all, as if the SoftSIM hasn't been activated. I also tried AT%CSUS=2 but get "ERROR" returned. Does the SoftSIM need to be activated on the device in some way? I've added the static SIM profile to the build config as described using the Onomondo CLI instructions.

    Thanks,

    James

  • Hi James!

    Jamesls said:
    I also tried AT%CSUS=2 but get "ERROR" returned

    Make sure that AT+CFUN=0 when executing this command.

    Try setting CONFIG_SOFTSIM_AUTO_INIT=y in the sample. This should handle the virtual SIM selection. 

    Kind regards,
    Øyvind

  • Hi,

    Thanks - I'm now able to build & flash the Onomondo SoftSIM static profile sample to the Thingy:91 and confirm SoftSIM connectivity via the Onomondo portal.

    However, now that I've validated the SoftSIM provisioning & connectivity I am now integrating SoftSIM into your Asset Tracker v2 sample (with pgps and aws overlays) and am once again getting an issue with the flash size despite using the new partition map provided in the above Onomondo PR (thingy91_pm_static.yml).

    Does SoftSIM integration with Asset Tracker v2 require an alternative partition map, the disabling of certain modules to reduce the firmware size or is SoftSIM not even compatible with Asset Tracker v2?

    I've included the build log below that shows the issue and also opened a new issue on Onomondo's GitHub.

    Thanks again,

    James

    --

    -- Found partition manager static configuration: C:/ncs/v2.6.1/modules/lib/onomondo-softsim/thingy91_pm_static.yml
    Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'nonsecure_storage' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_ctrl' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_rx' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'nrf_modem_lib_tx' is not included in the dynamic resolving since it is statically defined.
    Partition 'nvs_storage' is not included in the dynamic resolving since it is statically defined.
    Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_nonsecure' is not included in the dynamic resolving since it is statically defined.
    Partition 'sram_secure' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_its' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_nonsecure' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_otp_nv_counters' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_secure' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_sram' is not included in the dynamic resolving since it is statically defined.
    Partition 'tfm_storage' is not included in the dynamic resolving since it is statically defined.
    Partition manager failed: End of last partition is after last valid address
    Failed to partition region sram_primary, size of region: 262144
    Partition Configuration:
    mcuboot_sram:
    size: 90112
    nrf_modem_lib_ctrl:
    placement:
    after:
    - tfm_sram
    - start
    size: 1256
    nrf_modem_lib_rx:
    placement:
    after:
    - nrf_modem_lib_tx
    size: 8192
    nrf_modem_lib_sram:
    size: 17768
    nrf_modem_lib_trace:
    placement: {}
    size: 16384
    nrf_modem_lib_tx:
    placement:
    after:
    - nrf_modem_lib_ctrl
    size: 8320
    sram_nonsecure:
    size: 172032
    sram_primary:
    size: 154264
    sram_secure:
    size: 90112
    tfm_sram:
    placement:
    after:
    - start
    size: 90112

    CMake Error at C:/ncs/v2.6.1/nrf/cmake/partition_manager.cmake:331 (message):
    Partition Manager failed, aborting.

  • Having both SoftSIM and the Asset Tracker v2 can be tricky in regards to available flash. 

    You could try to remove the FOTA/DFU support in the Asset Tracker i.e. remove the following/disable:

    # FOTA
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_DOWNLOAD_CLIENT_BUF_SIZE=2300
    CONFIG_DOWNLOAD_CLIENT_MAX_HOSTNAME_SIZE=128

  • Hi,

    I disabled FOTA/DFU (which didn't seem to make a difference to the sram_primary size of 262144 logged above) so I also then disabled CONFIG_AT_HOST_LIBRARY and CONFIG_NRF_MODEM_LIB_TRACE which allowed the build to progress beyond above partitioning stage but it now fails at another flash related issue:

    [24/485] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    ----- Installing platform NS -----

    <SNIP>

    section `text' will not fit in region `FLASH'
    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 66740 bytes

    Thanks,

    James

Related