2023-03-30 05:11 AM
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?
Solved! Go to Solution.
2023-04-05 09:04 AM
Yeah - posting your findings will help others in the same situation.
2023-04-13 08:04 AM
@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.