Heartbeat

STM32 Bare Metal LED Blink Exercise

Task

Blink the LED on PA5 five times, then leave it off. PA5 is low at reset. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U1 STM32F4 pin PA5 drives R1 330R into D1 LED to ground, with a TP1 logic analyzer probe on the PA5 net

Pass condition

PA5 must make exactly ten edges. PA5 rises first and falls last. Timing is not graded.

Expected output: five pulses on PA5, ten edges, first edge rising

Notes

This question needs no clock enable. Your program is built and run at -O0, then again at -O2, and must pass both.

Related challenges

Loading the interactive arena.