平台 Guides¶
This section provides comprehensive platform-specific documentation for all supported platforms in the Nexus Embedded Platform. Each guide covers platform capabilities, build instructions, configuration options, hardware setup, example projects, and debugging procedures.
支持 Platforms¶
The Nexus platform supports the following hardware platforms:
平台 Comparison¶
Feature |
Native |
STM32F4 |
STM32H7 |
GD32 |
|---|---|---|---|---|
Core |
Simulated |
Cortex-M4 |
Cortex-M7 |
Cortex-M3/M4 |
Max Frequency |
N/A |
180 MHz |
480 MHz |
120 MHz |
Flash |
N/A |
Up to 2 MB |
Up to 2 MB |
Up to 3 MB |
SRAM |
N/A |
Up to 256 KB |
Up to 1 MB |
Up to 256 KB |
FPU |
N/A |
Single |
Double |
Single |
UART |
4 |
6 |
8 |
5 |
SPI |
2 |
6 |
6 |
3 |
I2C |
2 |
3 |
4 |
2 |
Timer |
4 |
14 |
22 |
14 |
ADC |
可选 |
3 (12-bit) |
3 (16-bit) |
3 (12-bit) |
Ethernet |
否 |
否 |
是 |
否 |
USB |
否 |
2 |
2 |
2 |
Use Case |
Testing/CI |
General |
High-perf |
Cost-effective |
Choosing a 平台¶
Native 平台¶
Best for:
开发 without hardware
Automated testing in CI/CD
Rapid prototyping
Learning the Nexus platform
Not suitable for:
Production deployment
Performance benchmarking
Real-time requirements
Hardware-specific features
STM32F4 平台¶
Best for:
General-purpose embedded applications
成本敏感型项目
Moderate performance requirements
Wide peripheral support
Considerations:
Lower performance than STM32H7
No Ethernet support
仅单精度 FPU
STM32H7 平台¶
Best for:
高性能应用
Ethernet connectivity
Advanced peripherals
DSP and signal processing
Considerations:
Higher cost than STM32F4
More complex clock configuration
Cache management required for DMA
GD32 平台¶
Best for:
成本敏感型项目
STM32 alternative
General-purpose applications
Considerations:
Less documentation than STM32
Some compatibility differences
Fewer third-party tools
平台 Selection Guide¶
Use this decision tree to select the appropriate platform:
graph TD
A[Start] --> B{Need Real Hardware?}
B -->|No| C[Native Platform]
B -->|Yes| D{Need Ethernet?}
D -->|Yes| E[STM32H7]
D -->|No| F{Performance Requirements?}
F -->|High| E
F -->|Moderate| G{Budget Constraint?}
G -->|Yes| H[GD32]
G-->|No| I[STM32F4]
快速入门¶
To get started with a specific platform:
Read the platform guide - Understand capabilities and limitations
Install toolchain - Set up the development environment
Configure platform - Use Kconfig to configure peripherals
Build example - Build and run an example project
Debug and test - Use debugging tools to verify functionality
Common Tasks¶
Building for a Platform¶
# Native
CMake -B build -DPLATFORM=native
CMake --build build
# STM32F4
CMake -B build -DPLATFORM=STM32 -DSTM32_CHIP=STM32F407 \
-DCMAKE_TOOLCHAIN_FILE=CMake/toolchains/arm-none-eabi.CMake
CMake --build build
# STM32H7
CMake -B build -DPLATFORM=STM32 -DSTM32_CHIP=STM32H743 \
-DCMAKE_TOOLCHAIN_FILE=CMake/toolchains/arm-none-eabi.CMake
CMake --build build
# GD32
CMake -B build -DPLATFORM=GD32 -DGD32_CHIP=GD32F407 \
-DCMAKE_TOOLCHAIN_FILE=CMake/toolchains/arm-none-eabi.CMake
CMake --build build
Configuring Peripherals¶
All platforms use Kconfig for configuration. See the platform-specific guides for detailed configuration options.
# Copy platform defconfig
cp platforms/native/defconfig .config
# Or for STM32F4
cp platforms/STM32/defconfig_stm32f4 .config
# Customize configuration
# Edit .config or use menuconfig
# Build with configuration
CMake -B build
CMake --build build
Porting Between Platforms¶
The Nexus platform provides a unified HAL API, making it easy to port applications between platforms:
Change platform in CMake - Update
-DPLATFORM=flagUpdate Kconfig - Copy appropriate defconfig
Adjust pin mappings - Update GPIO/peripheral pin assignments
Rebuild - Recompile for new platform
Test - Verify functionality on new platform
另请参阅¶
构建系统 - Build system documentation
Platform-Specific 配置 Guide - Platform configuration guide
硬件抽象层 (HAL) - HAL API documentation
操作系统抽象层 (OSAL) - OSAL API documentation
移植指南 - Porting guide