https://github.com/xvi-xv-xii-ix-xxii-ix-xiv/stm32f469_base_rtic
A modular and reusable base project for STM32F469 microcontrollers using Rust and RTIC
https://github.com/xvi-xv-xii-ix-xxii-ix-xiv/stm32f469_base_rtic
arm-cortex bridge cdc-acm cortex-m4 dma embedded microcontroller morse no-std otg rtic rust starter-template stm stm32 stm32f469 template usart usb virtual-com-port
Last synced: about 2 months ago
JSON representation
A modular and reusable base project for STM32F469 microcontrollers using Rust and RTIC
- Host: GitHub
- URL: https://github.com/xvi-xv-xii-ix-xxii-ix-xiv/stm32f469_base_rtic
- Owner: xvi-xv-xii-ix-xxii-ix-xiv
- License: mit
- Created: 2025-01-24T21:23:09.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-25T04:59:15.000Z (4 months ago)
- Last Synced: 2025-02-04T19:20:46.990Z (4 months ago)
- Topics: arm-cortex, bridge, cdc-acm, cortex-m4, dma, embedded, microcontroller, morse, no-std, otg, rtic, rust, starter-template, stm, stm32, stm32f469, template, usart, usb, virtual-com-port
- Language: Rust
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Universal Embedded Development Template for RTIC-Based Projects (Rust)
[](https://opensource.org/licenses/MIT)
**A Modular Foundation for STM32 and Compatible Microcontrollers**
This repository serves as a **starting point** for embedded projects - not a final product, but a *curated collection of reusable patterns* that can be:
- ๐งฉ **Used selectively** - integrate only required components into your project
- ๐ **Adapted across MCUs** - supports STM32F4/F7/H7, GD32, Nordic, and other Cortex-M chips
- ๐ **Extended like LEGO** - combine modules to accelerate development## Why Choose This Template?
### For STM32F469 Discovery (Default Configuration)
Provides ready-to-run foundations for STM32F469NI-Discovery with:
- Pre-optimized clock tree configuration (180 MHz PLL)
- Pre-wired peripherals (USB OTG FS, USART6 with DMA, GPIO mappings)
- Reference implementations for board-specific features (LCD, touch sensors)### For Other Microcontrollers
1. **Easy Adaptation** via:
- Dependency swaps in `Cargo.toml`## Key Features
### Core Capabilities
- ๐ **RTIC Framework**: Preconfigured real-time task scheduling with:
- Priority-based execution (1-5 levels)
- Safe resource sharing via mutexes
- Async/await support for non-blocking operations- ๐ก **Communication Protocols**:
- **DMA-Driven USART6**:
- 115200 baud rate (configurable)
- Hardware flow control (RTS/CTS)
- Circular buffer management (256-byte capacity)
- **USB 2.0 OTG FS**:
- CDC-ACM virtual COM port
- Bulk data transfer support
- Plug-and-play enumeration- ๐ฆ **Visual Status System**:
- Blue LED (PK3): Operational status patterns
- Steady blink: Normal operation
- Rapid blink: Data transmission
- Off: Error state
- Red LED (PD5): Error code visualization
- Morse-like coding for error identification
- Persistent error logging### Advanced Functionality
- ๐ **Power Management**:
- Automatic entry into STOP mode during idle
- < 1ยตA sleep current (peripheral-dependent)
- Interrupt-driven wakeup system- ๐ก๏ธ **Error Handling**:
- Hierarchical error domains (USB, DMA, USART)
- Persistent error queue (8-entry FIFO)
- Error code-to-description mapping
- Cross-domain error conversion- ๐ **Debug Infrastructure**:
- Conditional debug output via RTT
- Panic handler with stack trace
- Performance metrics:
- ISR latency measurements
- CPU load monitoring
- Buffer utilization stats## Hardware Integration
### Supported Peripherals
| Peripheral | Features | GPIO Mapping |
|-------------|-----------------------------------|-----------------------|
| USART6 | DMA TX/RX, Hardware Flow Control | TX: PG14, RX: PG9 |
| USB OTG FS | Device Mode, VBUS Sensing | DP: PA11, DN: PA12 |
| GPIO | LED Control, User Input | PK3 (Blue), PD5 (Red) |
| SYSTICK | System Timer | Core-integrated |
| DMA2 | Stream Management | Channel 4/5 |## Development Workflow
### Getting Started
1. Clone template repository:
```bash
git clone https://github.com/xvi-xv-xii-ix-xxii-ix-xiv/stm32f469_base_rtic.git## Safety-Critical Design
### Protection Mechanisms
- **Memory Safety**:
- Guaranteed buffer boundaries for DMA
- Stack canary protection
- Watchdog timer integration
- **Fault Recovery**:
- Automatic retry for failed transfers (3 attempts)
- Graceful degradation on critical errors
- Hardware watchdog kick systemLicense
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Developed by XVI.XV.XII.IX.XXII.IX.XIV