cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent Binary Output When Building STM32CubeIDE Project on Linux and Windows

NZaugg
Associate II

I am facing an issue where the binary output of my STM32CubeIDE project built on Linux and Windows is inconsistent. I have installed STM32CubeIDE Version 1.6.1 and the fixed Toolchain: GNU Tools for STM32 (7-2018-q2-update) on both platforms. Upon comparing the makefiles, I found that they match, but the resulting binaries do not.

Can you suggest steps that I can take to ensure consistent binary output on both platforms? Additionally, which files should I compare to troubleshoot the issue?

11 REPLIES 11

Yeah - posting your findings will help others in the same situation.

NZaugg
Associate II

@Pavel A.​ and @Bob S​, thank you for your patience.

Unfortunately, I have not yet been able to solve the problem completely.

But I have found out when the problem occurs. It only occurs when the G++ compiler optimization is set to -O2. If I set it to -O0 for a part of the project, namely a folder with several modules, the build from Windows is the same as the build from Linux. However, I could not figure out in the code what exactly is optimized differently from G++ on Linux than from G++ on Windows.