The Fly
STM32 1ms Timer Interrupt Exercise
Task
Someone uploaded a fly's brain to this board. Every millisecond the brain updates every neuron in one step, then the chip rests until the next one. The beat comes from a timer called SysTick, inside the core. The core is the part of the chip that runs your code. Once a millisecond SysTick interrupts the core, which pauses main, runs a short function called a handler, then picks up where it left off.
Use those interrupts to toggle the LED on PA5 every 50 ms, so anyone watching can see the brain is still ticking: PA5 toggles at 50 ms, 100 ms, 150 ms, and so on, for as long as the board runs Count the interrupts in SysTick_Handler. In main, toggle the LED every 50 of them and sleep between ticks.
Circuit
Pass condition
PA5 toggles every 50 ms, first at 50 ms after reset. The core takes one SysTick interrupt every millisecond and sleeps between them.