The STM32F103 and STM32F407 are two of the most popular microcontrollers in the embedded world. While both are part of ST's STM32 family, they target different performance tiers. This guide breaks down every key difference to help you make the right choice.
Quick Comparison Table
| Feature | STM32F103 | STM32F407 |
|---|---|---|
| Core | ARM Cortex-M3 | ARM Cortex-M4F |
| Max Clock | 72 MHz | 168 MHz |
| Flash | 64KB โ 512KB | 512KB โ 1MB |
| SRAM | 20KB โ 64KB | 128KB โ 192KB |
| FPU | No | Yes (single precision) |
| DSP | No | Yes |
| USB | Full-Speed (12 Mbps) | High-Speed OTG (480 Mbps) |
| Ethernet | No | Yes (MAC) |
| Camera | No | DCMI interface |
| Price Range | $1.50 โ $4.00 | $6.00 โ $12.00 |
Architecture Deep Dive
Cortex-M3 vs Cortex-M4F
The fundamental difference is the processor core:
Cortex-M3 (STM32F103):
- 3-stage pipeline, Thumb-2 instruction set
- Hardware multiply (single cycle 32ร32)
- No floating-point unit โ all FP operations in software
- Excellent for control-oriented tasks
- 3-stage pipeline with branch speculation
- DSP instructions (SIMD, saturating arithmetic)
- Single-precision FPU (IEEE 754 compliant)
- 2.5ร faster for DSP/math-heavy workloads
Performance Benchmarks
Real-world benchmark comparison:
| Benchmark | F103 (72 MHz) | F407 (168 MHz) | Speedup |
|---|---|---|---|
| CoreMark | 91 | 565 | 6.2ร |
| Dhrystone (DMIPS) | 89 | 210 | 2.4ร |
| FFT 1024-pt (float) | ~45 ms | ~2.1 ms | 21ร |
| GPIO toggle rate | 18 MHz | 84 MHz | 4.7ร |
Peripheral Comparison
Communication Interfaces
STM32F103:
- 3ร USART
- 2ร SPI
- 2ร I2C
- 1ร USB Full-Speed
- 1ร CAN
- 6ร USART (4ร UART)
- 3ร SPI (+ I2S)
- 3ร I2C
- 1ร USB OTG HS + 1ร USB OTG FS
- 2ร CAN
- Ethernet MAC
- DCMI (camera interface)
- SDIO
ADC Performance
Both have 12-bit ADCs, but with different capabilities:
- F103: 2ร ADC, 1 MSPS, 16 channels
- F407: 3ร ADC, 2.4 MSPS, 24 channels, triple interleaved mode (7.2 MSPS effective)
Timer Resources
Both are well-equipped for motor control and PWM, but the F407 has more timers with more advanced features including synchronized multi-axis motor control.
When to Choose STM32F103
The F103 remains an excellent choice for:
- Simple control applications โ sensor reading, relay control, LED driving
- Cost-sensitive products โ $1.50 unit cost at volume
- Low-power designs โ lower active current at lower clock speeds
- Legacy compatibility โ vast ecosystem of existing libraries and designs
- Beginner learning โ extensive community tutorials available
When to Choose STM32F407
Choose the F407 when you need:
- Floating-point math โ PID controllers, sensor fusion, DSP
- Audio processing โ I2S interface + DMA + FPU
- USB High-Speed โ mass storage, high-bandwidth devices
- Ethernet connectivity โ IoT gateways, industrial networking
- Camera/imaging โ DCMI interface for OV7670 or similar
- Complex applications โ RTOS with many tasks, large codebases
Cost Analysis
At FPGACenter, current pricing:
- STM32F103C8T6 (64KB Flash, LQFP-48): ~$2.85
- STM32F407VGT6 (1MB Flash, LQFP-100): ~$8.50
- F103: $1.20 โ $1.80
- F407: $5.50 โ $7.50
Conclusion
Choose STM32F103 if your application is simple, cost-sensitive, and doesn't need floating-point math or high-speed connectivity.
Choose STM32F407 if you need DSP capabilities, FPU, Ethernet, USB High-Speed, or more resources for complex applications.
Both are excellent microcontrollers backed by ST's comprehensive HAL library and STM32CubeIDE toolchain. The right choice depends entirely on your specific requirements.