https://github.com/beckversync/stm32-timer-driver-test-suite
Welcome to the STM32 Timer Driver Test Suite! π οΈ This project showcases a robust and efficient timer driver for the STM32 microcontroller, featuring multiple concurrent timeouts and accurate callback scheduling. Letβs dive in
https://github.com/beckversync/stm32-timer-driver-test-suite
Last synced: 4 months ago
JSON representation
Welcome to the STM32 Timer Driver Test Suite! π οΈ This project showcases a robust and efficient timer driver for the STM32 microcontroller, featuring multiple concurrent timeouts and accurate callback scheduling. Letβs dive in
- Host: GitHub
- URL: https://github.com/beckversync/stm32-timer-driver-test-suite
- Owner: Beckversync
- Created: 2024-11-20T10:16:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-05T12:11:53.000Z (over 1 year ago)
- Last Synced: 2025-07-23T13:51:17.167Z (11 months ago)
- Language: C
- Homepage:
- Size: 13.3 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# β±οΈ STM32 Timer Driver Test Suite π
Welcome to the **STM32 Timer Driver Test Suite**! π οΈ This project showcases a robust and efficient timer driver for the STM32 microcontroller, featuring multiple concurrent timeouts and accurate callback scheduling. Letβs dive in! π
---
## π― Objectives
- π **10ms Timer Tick:** Ensure a regular 10ms timer tick for accurate scheduling.
- π **Callback Registration:**
- Register a timeout to fire a callback **every 10ms**.
- Print the timestamp from `get_time()` **every time the callback triggers**.
- Ensure timestamps are accurate to at least **10ms precision**.
- π§βπ€βπ§ **Multiple Concurrent Timeouts:** Register another timeout at a **different interval (e.g., 500ms)** and run both timeouts concurrently.
- β³ **Delayed Task Scheduling:**
- Use `SCH_Add_Task()` to schedule several callbacks.
- Ensure delays are long enough so the **main loop enters before wake-ups occur**.
- Print the **current timestamp when each delay expires**.
---
## β Unsatisfactory Designs
Avoid the following issues in your implementation:
- β Supporting **only one registered timeout** at a time.
- β **Out-of-order callback delivery**.
- β Inefficient **O(n) searches** in `SCH_Update()`.
- β **Interrupt frequencies over 10Hz** with a regularly ticking timer.
---
## π Test Plan
1. **Set Up Timer:** Initialize a **10ms periodic timer interrupt**.
2. **Register Callbacks:**
- Callback 1: Fires **every 10ms**, prints timestamp.
- Callback 2: Fires **every 500ms**, prints timestamp.
3. **Add Scheduled Tasks:**
- Use `SCH_Add_Task()` to add several delayed callbacks.
- Ensure tasks wake up in the **correct order**.
4. **Verify Output:** Ensure timestamps are **accurate** and **callbacks fire on time**.
---
## π How to Run
1. **Clone this repository** π₯
2. **Flash the STM32 code** onto your development board β‘
3. **Observe the console output** and validate timestamps π₯οΈ
---
π₯ **Contributors:**
- Your Name Beckversync
π **License:**
HCMUT