Thingy53 - peripheral_lbs sample fails to build for target thingy53/cpuapp/ns

Hello,

Attempts to build the "peripheral_lbs" sample for target thingy53/cpuapp/ns in the latest nRF Connect SDK v3.2.1 fails.

The build for target thingy53/cpuapp works fine.

The build failed with error  "‘FLASH overflowed when building TFM image".

/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: address 0x241e0 of bin/tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: address 0x27c40 of bin/tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: bin/tfm_s.axf section `.TFM_PSA_ROT_LINKER_DATA' will not fit in region `FLASH'
/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: address 0x241e0 of bin/tfm_s.axf section `.TFM_UNPRIV_CODE' is not within region `FLASH'
/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: address 0x27c40 of bin/tfm_s.axf section `.gnu.sgstubs' is not within region `FLASH'
/opt/nordic/ncs/toolchains/322ac893fe/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: region `FLASH' overflowed by 48668 bytes
Memory region         Used Size  Region Size  %age Used
           FLASH:       97308 B      48640 B    200.06%
             RAM:       48404 B       192 KB     24.62%
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I've used the following temporary workaround:

  • Disabled “CONFIG_BT_LBS_SECURITY_ENABLED=n" in prj.conf
  • Used SB_CONFIG_NETCORE_HCI_IPC=y in sysbuild.conf 
  • Removed Kconfig.sysbuild
  • Built for thingy53/cpuapp/ns
  • Application built and ran fine

However, I'd like to have the BT_LBS_SECURITY_ENABLED set.

What is the fix for thingy53/cpuapp/ns build with the default Kconfig “BT_LBS_SECURITY_ENABLED=y"?


Thank you.

  • Hi Priyanka,

    I've fixed the remaining issue regarding Thingy53 TF-M logging using the following TF-M Kconfig.

    # TF-M profile has to be properly configured to be able to run
    # the Bluetooth stack which uses PSA crypto API.
    # The following configuration is a minimal set of options required.
    CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
    CONFIG_TFM_PARTITION_PLATFORM=y
    CONFIG_TFM_PARTITION_CRYPTO=y
    CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE=y
    CONFIG_TFM_PARTITION_PROTECTED_STORAGE=n
    CONFIG_TFM_PARTITION_INITIAL_ATTESTATION=n
    
    # This Board implies building Non-Secure firmware
    CONFIG_TRUSTED_EXECUTION_NONSECURE=y
    
    # Set TF-M to share the default console
    CONFIG_TFM_SECURE_UART0=y
    CONFIG_TFM_SECURE_UART_SHARE_INSTANCE=y


    We can close this ticket now. Thank you.


    Best Regards,
    Ravi

Related