flip buffer in stm32 cubeFW