What's a good way to waste a clock cycle in STM32F4?
In the thread https://community.st.com/t5/stm32-mcus-embedded-software/why-does-my-tx-only-software-3-mbaud-uart-sometimes-send-strange/td-p/218077/page/2 I learned that "DSB" is a good way to waste a clock cycle in STM32F769. Now, what's a good way to waste a clock cycle in STM32F4? I don't want the instruction to cause traffic on the bus matrix and in my experience "NOP" gets optimized away by the GCC compiler. If I enforce no optimization, then the "NOP" appears to take 3 instructions instead of 1:
inline static void __attribute__((optimize("O0"))) nopNeverOptimizedAwayByCompiler() {
8027af4: b480 push {r7}
8027af6: af00 add r7, sp, #0
asm("NOP");
8027af8: bf00 nop
}
