Nexus is a world-class embedded software development platform designed for building reliable, secure, and portable embedded applications.
- Hardware Abstraction Layer (HAL) - Unified hardware interface across multiple MCU platforms
- OS Abstraction Layer (OSAL) - Support for FreeRTOS, RT-Thread, Zephyr, and bare-metal
- Security - Secure boot, TLS 1.3, hardware crypto acceleration
- Cloud Integration - AWS IoT, Azure IoT, Alibaba Cloud
- TinyML - TensorFlow Lite Micro support for edge AI
- Cross-platform - Develop on Windows, Linux, or macOS
| Platform | Status | Features |
|---|---|---|
| STM32F4 | ✅ Supported | GPIO, UART, SPI, I2C, ADC, Timer |
| STM32H7 | 🚧 Planned | + TrustZone, Crypto |
| ESP32 | 🚧 Planned | + WiFi, BLE |
| nRF52 | 🚧 Planned | + BLE, Crypto |
| Native | ✅ Supported | Host simulation for testing |
All Platforms:
- CMake 3.16+
- Git
For Native Build (Testing):
- Windows: Visual Studio 2019+ or MSVC Build Tools
- Linux: GCC 9+
- macOS: Clang 12+
For ARM Cross-Compilation:
- ARM GCC Toolchain 10.3+ (
arm-none-eabi-gcc)
For Documentation:
- Doxygen 1.9+
- Python 3.8+ with Sphinx (
pip install sphinx breathe)
# Clone repository
git clone https://github.com/nexus-platform/nexus.git
cd nexus
# Configure for native platform
cmake -B build -DCMAKE_BUILD_TYPE=Release -DNEXUS_PLATFORM=native
# Build
cmake --build build --config Release
# Run tests
ctest --test-dir build -C Release --output-on-failure# Configure for STM32F4
cmake -B build-stm32f4 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/arm-none-eabi.cmake \
-DNEXUS_PLATFORM=stm32f4
# Build
cmake --build build-stm32f4 --config Release
# Output: build-stm32f4/applications/blinky/blinky.elf| Option | Default | Description |
|---|---|---|
NEXUS_PLATFORM |
native |
Target platform: native, stm32f4 |
NEXUS_BUILD_TESTS |
ON |
Build unit tests |
NEXUS_BUILD_EXAMPLES |
ON |
Build example applications |
NEXUS_ENABLE_COVERAGE |
OFF |
Enable code coverage |
# Generate API documentation (Doxygen)
doxygen Doxyfile
# Build Sphinx documentation (English)
cd docs/sphinx
python -m sphinx -b html . _build/html/en
# Build Sphinx documentation (Chinese)
python -m sphinx -b html . _build/html/cn -D master_doc=index_cn -D language=zh_CN
# Or use the build script (Windows)
build_docs.bat#include "hal/nx_hal.h"
int main(void)
{
/* Initialize HAL */
nx_hal_init();
/* Get GPIO device (Port A, Pin 5) */
nx_gpio_config_t cfg = {
.mode = NX_GPIO_MODE_OUTPUT_PP,
.pull = NX_GPIO_PULL_NONE,
.speed = NX_GPIO_SPEED_LOW,
};
nx_gpio_t* led = nx_factory_gpio_with_config(0, 5, &cfg);
if (!led) {
return -1;
}
while (1) {
led->toggle(led);
/* delay 500ms - platform specific */
}
nx_factory_gpio_release(led);
nx_hal_deinit();
return 0;
}nexus/
├── hal/ # Hardware Abstraction Layer
│ ├── include/hal/ # Public headers
│ └── src/ # Common implementations
├── osal/ # OS Abstraction Layer
│ ├── include/osal/ # Public headers
│ └── adapters/ # RTOS adapters (baremetal, freertos)
├── platforms/ # Platform-specific implementations
│ ├── native/ # Host simulation (Windows/Linux/macOS)
│ └── stm32f4/ # STM32F4 HAL implementations
├── applications/ # Example applications
│ └── blinky/ # LED blink example
├── tests/ # Unit tests (Google Test)
│ └── hal/ # HAL unit tests
├── docs/ # Documentation
│ ├── api/ # Doxygen output
│ ├── sphinx/ # Sphinx documentation (EN/CN)
│ └── requirements/ # PRD and roadmap
├── cmake/ # CMake modules
│ ├── modules/ # Helper functions
│ └── toolchains/ # Cross-compilation toolchains
└── .github/workflows/ # CI/CD pipelines
- API Reference: Run
doxygen Doxyfilethen opendocs/api/html/index.html - User Guide: Run Sphinx build then open
docs/sphinx/_build/html/index.html - Contributing Guide: How to contribute
- Changelog: Version history
This project uses:
.clang-format- Code formatting (80 char limit, 4 space indent).clang-tidy- Static analysis.editorconfig- Editor settings
Format code before committing:
clang-format -i hal/**/*.c hal/**/*.h# Build with tests enabled
cmake -B build -DNEXUS_PLATFORM=native -DNEXUS_BUILD_TESTS=ON
cmake --build build --config Release
# Run all tests
ctest --test-dir build -C Release --output-on-failure
# Run specific test
./build/tests/Release/nexus_tests --gtest_filter="HalGpioTest.*"Use backslash style for Doxygen comments:
/**
* \file nx_gpio.h
* \brief GPIO device interface definition
* \author Nexus Team
*/
/**
* \brief Get GPIO device with configuration
* \param[in] port: GPIO port number
* \param[in] pin: GPIO pin number
* \param[in] cfg: GPIO configuration
* \return GPIO interface pointer, NULL on failure
*/
nx_gpio_t* nx_factory_gpio_with_config(uint8_t port, uint8_t pin,
const nx_gpio_config_t* cfg);GitHub Actions workflows:
- build.yml: Multi-platform build (Windows, Linux, macOS) + ARM cross-compilation
- test.yml: Unit tests with coverage + sanitizers + MISRA checks
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Nexus 是一个世界级的嵌入式软件开发平台,专为构建可靠、安全、可移植的嵌入式应用而设计。
- 硬件抽象层 (HAL) - 跨多种 MCU 平台的统一硬件接口
- 操作系统抽象层 (OSAL) - 支持 FreeRTOS、RT-Thread、Zephyr 和裸机
- 安全特性 - 安全启动、TLS 1.3、硬件加密加速
- 云端集成 - AWS IoT、Azure IoT、阿里云
- TinyML - 支持 TensorFlow Lite Micro 边缘 AI
- 跨平台开发 - 支持 Windows、Linux、macOS 开发环境
- CMake 3.16+
- Git
- Windows: Visual Studio 2019+ 或 MSVC Build Tools
- ARM 交叉编译: arm-none-eabi-gcc 10.3+
git clone https://github.com/nexus-platform/nexus.git
cd nexus
# 配置
cmake -B build -DCMAKE_BUILD_TYPE=Release -DNEXUS_PLATFORM=native
# 构建
cmake --build build --config Release
# 运行测试
ctest --test-dir build -C Release --output-on-failurecmake -B build-stm32f4 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/arm-none-eabi.cmake \
-DNEXUS_PLATFORM=stm32f4
cmake --build build-stm32f4 --config Release# API 文档
doxygen Doxyfile
# 用户文档 (中文)
cd docs/sphinx
python -m sphinx -b html . _build/html/cn -D master_doc=index_cn -D language=zh_CN- API 参考: 运行
doxygen Doxyfile后打开docs/api/html/index.html - 用户指南: 运行 Sphinx 构建后打开
docs/sphinx/_build/html/cn/index_cn.html - 贡献指南: 如何参与贡献
- 更新日志: 版本历史
本项目采用 MIT 许可证 - 详见 LICENSE 文件。