cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE build (Make) incredibly slow

guillaume petitjean
Associate II

Hello,

I created a project with many C files (around 50 or 60) and the build is incredibly slow. I'm just doing "build project", and even when nothing changed in the project, it takes several MINUTES just to start compiling the few modified C files.

The build command line is supposed to be "make -j2 all" but it apparently takes forever before it is actually executed.

Any hint ?

EDIT: I tried to execute the make command outside the IDE but I get an error "multiple target patterns". I have to mention that the source file are on a linux server whose disk is mounted on my windows PC. I tried the make directly on the linux server which may explain the issue.

8 REPLIES 8
Goof Ball
Associate III

Any progress here, guillaume ?

Sound suspiciously similar to: https://forum.atollic.com/viewtopic.php?t=197

(although the link is for a slow bug in the CDT internal builder)

VKost.1
Associate II

Found a problem with the external make.exe they are using (inside plugin named com.st.stm32cube.ide.mcu.externaltools.make.win32_1.1.0.201910081157)

Replacing it with GNU Make 4.1 makes the build process more that 2 times faster.

Panometric
Associate III

@VK.17ostadinov​ Can you detail how you setup STM32Cube to use Gnu Make 4.1?

Panometric
Associate III

For ST developers, I have a hint for the packaged make.exe: (STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.make.win32_1.1.0.201910081157\tools\bin\make.exe)

Microsoft Procmon.exe shows that each time make.exe opens a directory that is large, it must do the job twice because : QueryAllInformationFile result BUFFER OVERFLOW

This just indicates that the initially allocated buffer for the return is too small. So then the API call has to be repeated with a bigger buffer. These should all go away if you just use a larger buffer in the first place.

> Microsoft Procmon.exe shows that each time make.exe opens a directory that is large, it must do the job twice because : QueryAllInformationFile result BUFFER OVERFLOW

Large directory (too many files) or long path?

-- pa

Basically you just replace the make.exe with file from other package.

The file is located in STM32CubeIDE install:

STM32CubeIDE_1.0.0-install-dir\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.make.win32_1.1.0.201910081157\tools\bin\make.exe

Have in mind the version of plugin (directory name) will differ with the version of the IDE package.

You can download make.exe from here:

http://www.equation.com/servlet/equation.cmd?fa=make

Undoubtedly it exceeds the buffer, but the path is the default path for the installer and the program is not abnormally large, just a typical, HAL based STM32Cube project.

Panometric
Associate III

My own solution is this:

Using https://chocolatey.org/ I installed Gnumake 4.3 form the approved packages.

Then set the builder in the Project properties:

The j12 is for my CPU, use as many threads as your CPU has.

It trims ~ 20% off a full build which is CPU intensive.

But it trims 60% off the time to make a target that is already built.

That was worth the effort!