ExampleEXTI is the minimal external interrupt test.
It validates:
- EXTI configuration on
PC13 - callback dispatch on both edges
- interaction between EXTI and a GPIO output (
PB0)
./tools/build-example.sh --example exti --preset nucleo-debug --test 0Equivalent macro selection:
EXAMPLE_EXTITEST_0
- Use the Nucleo user button on
PC13. - Observe the LED connected to
PB0.
- The firmware registers an EXTI callback on
PC13. - The trigger mode is
BOTH_EDGES. - Every edge calls
toggle_led().
That means:
- button press toggles the LED
- button release toggles the LED again
- The LED changes state on every transition of the button signal.
- The main loop stays idle; the observable behavior comes entirely from the interrupt.
- Nothing happens: EXTI line not configured, wrong pin mapping, or callback not firing.
- Only one transition toggles: edge trigger configuration is wrong.
- Repeated chatter: mechanical bounce or noisy input.
This example is intentionally simple. It is useful to verify interrupt routing before adding more complex interrupt-driven logic.