I am using Keil to flash the software to my stm32f407 discovery. But the software only starts working when i pullout the JLINK cable and plug it again. Why is that? Thanks.
rocko874 said:So every variable has to volotile now?
No - it's just a kludge to get your busy-loop delay working.
rocko874 said:I tried to write a function with a loop and it canceled it in optimisation too
re-read the linked posts - you need to understand that this is expected behaviour when you write useless loops.
In particular: https://www.avrfreaks.net/comment/3078001#comment-3078001 - the bit, "what a 'C' program is actually about"