Different binary data when running directly
Hello,
I have a strange problem that I already lost a lot of hair over.
I am using cubeIDE with an stlink v2 (STM32G441 with a blank C/C++ project and CMSIS).
All run very well until today. So I am sure the code itself is ok.
If I compile the project bin and elf files are generated. If I flash the generated files from the release folder with cubeProgrammer the program does not run.
If I choose the run setting directly in cubeIDE the program runs fine. If I then read out the flash with cubeProgrammer the bin file is different from the one that was compiled in the release folder.
So cubeIDE is running a different bin file than the one it generates in the release folder. How can that be? What am I missing here? This started out of nowhere. I can not recall changing anything other than the code itself. But of course I must have botched something up. I just don't know what could cause this.
Edit: the generated bin file in the release folder is much shorter than the one I read out of the flash. So it seems that the problem is that the debug file works while the release file does not.
Edit: ok the program runns if I choose optimization for speed and not size. So I guess the optimizer generated something that did not work.
