cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX Makefile/CMake generation failure STM32U5*

audiofish
Associate

Hi,

I am trying to generate a project using STM32CubeMX v6.11.1 Linux using the NUCLEO-U5A5ZJ-Q project template.

I am happy to use either a Makefile or a CMake based build, but unfortunately both have issues.

 

If I select a Makefile build, and click Generate, the project is created, but the stdout log of STM32CubeMX provides this warning:

 

No such linker file: /home/user/STM32Cube/Repository//STM32Cube_FW_U5_V1.5.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_FLASH.ld
No such linker file: /home/user/STM32Cube/Repository//STM32Cube_FW_U5_V1.5.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_RAM.ld

 

 If I try to build with make, I see this issue reflected in the build:

 

arm-none-eabi-gcc build/main.o build/stm32u5xx_it.o build/stm32u5xx_hal_msp.o build/stm32u5xx_nucleo.o build/stm32u5xx_hal_adc.o build/stm32u5xx_hal_adc_ex.o build/stm32u5xx_hal_dma.o build/stm32u5xx_hal_dma_ex.o build/stm32u5xx_hal.o build/stm32u5xx_hal_i2c.o build/stm32u5xx_hal_i2c_ex.o build/stm32u5xx_hal_rcc.o build/stm32u5xx_hal_rcc_ex.o build/stm32u5xx_hal_cortex.o build/stm32u5xx_hal_flash.o build/stm32u5xx_hal_flash_ex.o build/stm32u5xx_hal_gpio.o build/stm32u5xx_hal_exti.o build/stm32u5xx_hal_pwr.o build/stm32u5xx_hal_pwr_ex.o build/stm32u5xx_hal_gtzc.o build/stm32u5xx_hal_icache.o build/stm32u5xx_hal_tim.o build/stm32u5xx_hal_tim_ex.o build/stm32u5xx_hal_pcd.o build/stm32u5xx_hal_pcd_ex.o build/stm32u5xx_ll_usb.o build/stm32u5xx_hal_usart.o build/stm32u5xx_hal_usart_ex.o build/stm32u5xx_hal_uart_ex.o build/stm32u5xx_hal_uart.o build/system_stm32u5xx.o build/sysmem.o build/syscalls.o build/startup_stm32u5a5xx.o  -mcpu=cortex-m33 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -T  -lc -lm -lnosys  -Wl,-Map=build/adc_capture_prototype.map,--cref -Wl,--gc-sections -o build/adc_capture_prototype.elf
/home/user/bin/gcc-arm-none-eabi-10.3-2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: cannot open linker script file --library=c: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:191: build/adc_capture_prototype.elf] Error 1

 

If I instead select a CMake build, the following warning is shown when I hit Generate:

audiofish_0-1719138148210.png

The log from STM32CubeMX shows a similar fault:

 

2024-06-23 11:21:01,952 [INFO] ConfigFileManager:1503 - The Die is : DIE481
pathGccArm/home/user/src/efieldprobe/sw/adc_capture_prototype/cmake/gcc-arm-none-eabi.cmake
No such linker file: /home/user/STM32Cube/Repository//STM32Cube_FW_U5_V1.5.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_FLASH.ld
No such linker file: /home/user/STM32Cube/Repository//STM32Cube_FW_U5_V1.5.0//Drivers/CMSIS/Device/ST/STM32U5xx/Source/Templates/gcc/linker/STM32U5a5xx_RAM.ld
2024-06-23 11:21:02,389 [INFO] ToolchainGenerator:486 - [Project Generator] Problem in the project generation
2024-06-23 11:21:02,389 [ERROR] ToolchainGenerator:487 - 
java.lang.StringIndexOutOfBoundsException: begin -1, end 0, length 0
        at java.lang.String.checkBoundsBeginEnd(String.java:4606) ~[?:?]
        at java.lang.String.substring(String.java:2709) ~[?:?]
        at java.lang.String.substring(String.java:2682) ~[?:?]
        at generators.CMakeGenerator.generateCMake(CMakeGenerator.java:249) ~[STM32CubeMX:?]
        at convertor.Convertor.generateMakefileProject(Convertor.java:2932) ~[STM32CubeMX:?]
        at convertor.Convertor.generateCMake(Convertor.java:2809) ~[STM32CubeMX:?]
        at convertor.Convertor.generate(Convertor.java:724) ~[STM32CubeMX:?]
        at convertor.Convertor.convert(Convertor.java:545) ~[STM32CubeMX:?]
        at convertor.Convertor.generate(Convertor.java:381) ~[STM32CubeMX:?]
        at com.st.microxplorer.plugins.projectmanager.model.ToolchainGenerator.generate(ToolchainGenerator.java:482) ~[?:?]
        at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createToolChainFolders(ProjectBuilder.java:4957) ~[?:?]
        at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:960) ~[?:?]
        at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61) ~[?:?]
2024-06-23 11:21:03,747 [INFO] ConfigFileManager:2923 - mx.scratch is deleted!
2024-06-23 11:21:03,747 [INFO] ProjectBuilder:5002 - Time for Generating toolchain IDE Files: 1852mS.
2024-06-23 11:21:03,747 [ERROR] ProjectBuilder:5008 - Error in Project Generation
2024-06-23 11:21:03,748 [ERROR] ProjectBuilder:985 - Error in Project Generation

 

It appears that the upstream STM32Cube repository that should contain these files (https://github.com/STMicroelectronics/cmsis_device_u5/tree/3abe881508869a9eb9dff7efab3638528a9332e3/Source/Templates/gcc/linker) does not contain the corresponding linker scripts for this platform. Do you have an estimate when these support will be complete? I have a development board arriving shortly and it would be a shame to not be able to start development because linker scripts are not available.

Thank you for your help.

1 REPLY 1
Souhaib MAZHOUD
ST Employee

Hello @audiofish 

Thank you for posting!

Actually, the support for the CMake toolchain in STM32CubeMX V6.11.1 is only for single-context series (mono-core, without Arm® TrustZone®(a)). However, since NUCLEO-U5A5ZJ-Q is based on Arm Cortex-M33 MCU with TrustZone, CMake is not supported in this case.
The support for this feature will be included in the upcoming release that will be published as soon as possible.

KR,

Souhaib