Turnstile

FreeRTOS ISR to Task Handoff Exercise

Task

Have EXTI0_IRQHandler hand each rising edge on PA0 to a FreeRTOS task, which logs it with log_event(n), counting n from 1. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U2, a sensor, drives PA0 of U1 STM32F4; inside U1 an edge on EXTI0 raises IRQ 6, EXTI0_IRQHandler hands it to a task, the task calls log_event, which takes 2.5 ms and prints on USART1 TX, PA9, to a terminal

Pass condition

log_event prints one EVENT:<n> line per edge, in order, and IRQ 6 is taken once per edge.

Expected output for the burst case: five rising edges on PA0 one millisecond apart from 20 ms, IRQ 6 taken once for each, and five lines on the terminal, EVENT:1 to EVENT:5, in order

Notes

The sensor on PA0 sends bursts of up to 10 edges, as close as 1 ms apart, all through the run. Leave the given code as is. Console: 9600 baud, BRR = 0x683

Related challenges

Loading the interactive arena.