Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
STM32F411VE Discovery Board Support Package
Board support package (BSP) for the STM32F411E-DISCO (32F411EDISCOVERY) development board, built on the Embassy async framework.
Hardware
- MCU: STM32F411VE (512KB Flash, 128KB RAM, 100MHz)
- Architecture: ARMv7E-M with FPU
- Target:
thumbv7em-none-eabihf - Debugger: ST-Link/V2 (onboard)
Onboard Features:
- 4 user LEDs: LD3 (orange/PD13), LD4 (green/PD12), LD5 (red/PD14), LD6 (blue/PD15)
- User button on PA0
- L3GD20 3-axis gyroscope (SPI)
- LSM303DLHC e-compass: 3-axis accelerometer + 3-axis magnetometer (I2C)
- MP45DT02 digital MEMS microphone
- CS43L22 audio DAC with class-D speaker driver
- USB OTG Full-Speed with micro-AB connector
Documentation:
- MCU Datasheet
- Discovery Kit User Manual
- L3GD20 Gyroscope Datasheet
- LSM303DLHC E-Compass Datasheet
- MP45DT02 Microphone Datasheet
Setup
# Add Rust target
# Install probe-rs (if not already installed)
Quick Start
With your STM32F411E Discovery board connected via USB:
# Test the board connection
# Run the blinky example to verify everything works
Building & Flashing
# Basic Hardware Examples
# Sensor Examples
# Audio Examples
# Build without flashing
# Flash with additional output
BSP Modules
Hardware Control
leds- 4 user LEDs (LD3-LD6) with individual and group controlbutton- User button (PA0) with polling supportmicrophone- MP45DT02 MEMS microphone with PDM interfaceaudio- CS43L22 audio DAC with speaker/headphone output and beep generation
Sensors
gyro- L3GD20 3-axis gyroscope with SPI interface- ±250/±500/±2000 dps full scale
- Temperature sensor
- Configurable data rates
compass- LSM303DLHC e-compass with I2C interface- 3-axis accelerometer (±2g/±4g/±8g/±16g)
- 3-axis magnetometer (±1.3 to ±8.1 gauss)
- Heading calculation
- Temperature sensor
Examples
Basic Hardware
blinky- Simple LED blink to verify board setupleds- Demonstrate all LED patterns and animationsbutton- Button-controlled LED cycling
Sensors
gyro- Read and display 3-axis angular rate datacompass- Read accelerometer, magnetometer, and calculate heading
Audio
microphone- Capture audio from MEMS microphone (simplified demo)audio_dac- CS43L22 I2C control interface demo (⚠️ no audio output - see limitations below)
Known Limitations
Audio DAC (CS43L22)
The audio_dac example demonstrates I2C communication with the CS43L22 audio DAC chip but does not produce actual sound. The chip requires:
- I2S peripheral setup - Audio data streaming interface (MCLK, SCK, SD, WS pins)
- Audio PLL configuration - STM32 clock setup for precise audio timing
- Sample streaming - Continuous DMA transfers of audio data
- Advanced beep generator setup - Additional register configuration for tone generation
Current Status:
- ✅ I2C communication works correctly
- ✅ Chip initialization and power control functional
- ✅ Volume and output device configuration works
- ❌ No I2S implementation (requires significant additional code)
- ❌ No audio output (beep tone generator not fully configured)
The audio module serves as a control interface reference for projects that need I2C access to the CS43L22.
Microphone (MP45DT02)
The microphone module is a simplified GPIO demonstration. Full PDM audio capture would require:
- I2S peripheral in PDM mode
- CIC decimation filter implementation
- DMA for continuous sampling
Project Structure
src/- BSP library modulesexamples/- Example applications demonstrating BSP featuresdocs/- Datasheets and reference manualsEmbed.toml- Probe-rs configuration (chip, protocol, etc.).cargo/config.toml- Build defaults
Configuration Files
.cargo/config.toml
Sets default build target and runner command:
- Target:
thumbv7em-none-eabihf - Runner:
probe-rs run --chip stm32f411ve --protocol swd --connect-under-reset
Embed.toml
Additional probe-rs configuration for RTT logging and advanced flashing options.
memory.x
Linker script defining Flash (512KB) and RAM (128KB) layout for STM32F411VE.