Skip to main content
Explorer
July 10, 2024
Question

The startup code paths in the cmake files for the H745 created with CubeMX v6.12 are incorrect.

  • July 10, 2024
  • 4 replies
  • 1701 views

H745 startup files are located in "CM7/Core/startup/startup_stm32h745xx_CM7.s" or "CM4/Core/startup/startup_stm32h745xx_CM4.s".

However, the build source path for the startup files in the mx-generated.cmake in each core's folder is ". /Startup/startup_stm32h745xx_CM7.s" or ". /Startup/startup_stm32h745xx_CM4.s".

Therefore, the cmake file must be changed to build.

4 replies

Semer CHERNI
ST Employee
July 15, 2024

Hello @imagawa122 

First let me thank you for posting.

I tried to reproduce the described behavior but the code is compiled correctly.

And after checking the mx-generated.cmake the startup file path is defined this way:

  • ./Core/Startup/startup_stm32h745xx_CM7.s
  • ./Core/Startup/startup_stm32h745xx_CM4.s

Could you provide a simplistic project showing this behavior?

BR,
Semer.

Associate II
September 9, 2024

Can we please get more feedback from ST to solve this issue with CubeMX? 

I've found this issue also reported in another post:

 
The simplistic project is just trying to blink an LED on a NUCLEO-H755ZI-Q board.
Regards.-
 
Associate II
August 31, 2024

I was about to create a post to report the same bug. the mx-generated.cmake file aims to  ./Startup/startup_stm32h755xx_CM7.s

but the real path is 

./Core/startup/startup_stm32h755xx_CM7.s

I've searched for text on the CubeMX directory trying to identify if there is a template with this path incorrectly configured but to no avail...

Not to mention that I have to change this path for CM4 and CM7 cores every time I auto generate code with CubeMX

Any advice on how to investigate or solve this issue?

Thanks!

Associate II
September 12, 2024

While we wait for a proper answer from ST, this is how I'm handling it in Linux.

I've created a script to be run before Build and Flash to execute the replacements,

 

sed -i 's|./Startup/startup_stm32h755xx_CM4.s|./Core/startup/startup_stm32h755xx_CM4.s|g' CM4/mx-generated.cmake
sed -i 's|./Startup/startup_stm32h755xx_CM7.s|./Core/startup/startup_stm32h755xx_CM7.s|g' CM7/mx-generated.cmake
 

Regards.-

cvanbeek
Associate III
December 4, 2025

This is still (MX 6.16.0) an issue for U5 TrustZone projects.  I have a post-cubemx CMake target I defined to fix the issue, so it's not a big problem.  However, it's frustrating that this simple bug is still not fixed after a year and a half.

@Semer CHERNI, any updates from ST's side?  I saw you couldn't reproduce this issue.  My guess is you were testing on a Windows computer.  Windows is case-insensitive, but Linux is not.  So on your Windows computer, ${CMAKE_CURRENT_SOURCE_DIR}/Core/Startup/startup_stm32u545xx.s will find ${CMAKE_CURRENT_SOURCE_DIR}/Core/startup/startup_stm32u545xx.s (note the capitalization in Startup).  On a Linux machine, it will not find the file, and CMake throws a configuration error for a missing source file.

Please fix this issue.