安装

前置条件

Before installing Nexus, ensure you have the following tools:

Required:

  • CMake 3.16 or later

  • C compiler (GCC, Clang, or MSVC)

  • Git

For ARM targets:

  • ARM GCC toolchain (arm-none-eabi-gcc)

  • OpenOCD or J-Link for debugging

For documentation:

  • Doxygen 1.9+

  • Python 3.8+

  • Sphinx and Breathe

安装前置条件

Windows:

# Install with Chocolatey
choco install cmake git
choco install gcc-arm-embedded

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install cmake git build-essential
sudo apt install gcc-arm-none-eabi

macOS:

brew install cmake git
brew install --cask gcc-arm-embedded

获取 Nexus

克隆仓库:

git clone https://github.com/nexus-team/nexus.git
cd nexus

构建

Native build (for testing):

cmake -B build -DNEXUS_PLATFORM=native
cmake --build build

STM32F4 cross-compile:

cmake -B build-stm32f4 \
    -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/arm-none-eabi.cmake \
    -DNEXUS_PLATFORM=stm32f4
cmake --build build-stm32f4

运行测试

cd build
ctest --output-on-failure

构建文档

# Generate API docs
doxygen Doxyfile

# Build Sphinx docs
cd docs/sphinx
sphinx-build -b html . _build/html

下一步

  • 快速开始 - Build your first Nexus application

  • 架构 - Understand the platform architecture