Hi Antonio,

 

Thank you, the is the max image size configured by some non-platform-specific global variable? Typically, 118732 B does not exceed STM32U585I limits in any way – it has 2 MB of flash.

 

Note that there is one more error. I have the latest CLang compiler installed, but the script says it outdated. I was hoping to get Debug image size within the limits using Clang.

 

Thank you,

Tomasz

 

 

From: Antonio De Angelis <Antonio.DeAngelis@arm.com>
Sent: Sunday, January 14, 2024 5:27 PM
To: Tomasz Jastrzębski <tdjastrzebski@wp.pl>; tf-m@lists.trustedfirmware.org
Subject: Re: [TF-M] Getting started, ST B-U585I-IOT02A profile - compilation

 

Hi Tomasz, 

 

This warning: 

 

Use legacy driver API for BL2

 

Is harmless and means just that BL2 will not use the PSA Crypto driver API even if the driver underneath might be exposing them.

 

Regarding the specific issue you're seeing I don't think that all platforms support to be built in debug mode due to constrained flash sizes assigned to the Secure world. I'd suggest to get in touch directly with one of ST maintainers. Depending on what you need to debug, you might be able to build in debug mode only some of the components of the secure world by passing debug arguments (-O0 etc) only to some of the static libraries that are used when linking the secure world binary. 

 

Thanks, Antonio 

 

Sent from Outlook for Android


From: Tomasz Jastrzębski via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Saturday, January 13, 2024 1:43:53 PM
To: tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Subject: [TF-M] Getting started, ST B-U585I-IOT02A profile - compilation

 

Hi All,

 

When I compile with GCC and Debug config (only Debug), process stops with these errors:

 

[ 97%] Building C object bl2/CMakeFiles/bl2.dir/__/platform/ext/target/stm/common/hal/accelerator/stm.o

[ 98%] Linking C executable ../bin/bl2.axf

C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0xc030fc4 of ../bin/bl2.axf section `.text' is not within region `FLASH'

C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: ../bin/bl2.axf section `.ARM.exidx' will not fit in region `FLASH'

C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: address 0xc030fc4 of ../bin/bl2.axf section `.text' is not within region `FLASH'

C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: section .BL2_NoHdp_Code LMA [0c02a000,0c02a5a7] overlaps section .text LMA [0c014000,0c030fc3]

C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/13.2 Rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 28620 bytes

Memory region         Used Size  Region Size  %age Used

    FLASH_NVMCNT:          32 B         8 KB      0.39%

           FLASH:      118732 B        88 KB    131.76%

     FLASH_NOHDP:        1448 B         8 KB     17.68%

       FLASH_OTP:         756 B         4 KB     18.46%

       FLASH_NVM:          32 B         8 KB      0.39%

             RAM:       31624 B        63 KB     49.02%

collect2.exe: error: ld returned 1 exit status

make[5]: *** [bl2/CMakeFiles/bl2.dir/build.make:490: bin/bl2.axf] Error 1

make[4]: *** [CMakeFiles/Makefile2:1982: bl2/CMakeFiles/bl2.dir/all] Error 2

make[3]: *** [Makefile:136: all] Error 2

make[2]: *** [CMakeFiles/TF-M.dir/build.make:86: temp/src/TF-M-stamp/TF-M-build] Error 2

make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TF-M.dir/all] Error 2

make: *** [Makefile:124: all] Error 2

 

Changing config to anything than Debug solves the issue, but along the way there are some warnings, of which these three seems to be particularly important:

tests_reg/build_spe/build-spe/lib/ext/mbedcrypto-src/include/mbedtls/ecp.h:365: warning: "MBEDTLS_ECP_MAX_BYTES" redefined

tests_reg/build_spe/build-spe/lib/ext/mbedcrypto-src/include/mbedtls/ecp.h:366: warning: "MBEDTLS_ECP_MAX_PT_LEN" redefined

trusted-firmware-m/bl2/ext/mcuboot/config/mcuboot-mbedtls-cfg.h:132:2: warning: #warning "Use legacy driver API for BL2" [-Wcpp]

  132 | #warning "Use legacy driver API for BL2"

 

When I try to compile with Clang compiler latest version 6.21, I immediately get this error:

 

C:\Temp\tf-m\tf-m-tests\tests_reg>cmake --build build_spe -- install

[ 12%] Creating directories for 'TF-M'

[ 25%] No download step for 'TF-M'

[ 37%] No update step for 'TF-M'

[ 50%] No patch step for 'TF-M'

[ 62%] Performing configure step for 'TF-M'

loading initial cache file C:/Temp/tf-m/tf-m-tests/tests_reg/build_spe/temp/tmp/TF-M-cache-Debug.cmake

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.43.0.windows.1")

-- The C compiler identification is unknown

-- The CXX compiler identification is unknown

-- The ASM compiler identification is ARMClang

-- Found assembler: C:/Program Files/ArmCompilerforEmbedded6.21/bin/armasm.exe

CMake Error at toolchain_ARMCLANG.cmake:190 (message):

  Please select newer Arm compiler version starting from 6.13.

Call Stack (most recent call first):

  CMakeLists.txt:50 (tfm_toolchain_reload_compiler)

 

-- Configuring incomplete, errors occurred!

make[2]: *** [CMakeFiles/TF-M.dir/build.make:92: temp/src/TF-M-stamp/TF-M-configure] Error 1

make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/TF-M.dir/all] Error 2

make: *** [Makefile:124: all] Error 2

 

Please advise,

Tomasz Jastrzębski