Problem with toggle GPIOs in 2 tasks
Optimization of compiler nulls out useless code, even if it's intended as dummy delay. Take this into account. Change SW4STM32 Eclipse compiler optimization and see what happens. You may also choose to declare variables with volatile as prefix. Welcome to the weird world of 21st century coding and compiling where the simpliest proof of concept code will already cause trouble. It used to work in the 1980s/1990s but today everything has changed 😉