Environment Setup¶
This guide will help you set up your development environment for Nexus on Windows, Linux, or macOS.
System Requirements¶
Minimum Requirements¶
Operating System: Windows 10+, Ubuntu 20.04+, macOS 11+
RAM: 4 GB minimum, 8 GB recommended
Disk Space: 5 GB for tools and source code
Internet: Required for downloading tools and dependencies
Supported Platforms¶
Host Development (Native)
Windows 10/11 (x64)
Linux (Ubuntu 20.04+, Debian 11+, Fedora 35+)
macOS 11+ (Intel and Apple Silicon)
Target Platforms
STM32F4 series (Cortex-M4)
STM32H7 series (Cortex-M7)
GD32 series
Native simulation (for testing)
Required Tools¶
Core Tools¶
These tools are required for all platforms:
Tool |
Version |
Purpose |
|---|---|---|
CMake |
3.16+ |
Build system |
Git |
2.20+ |
Version control |
Python |
3.8+ |
Build scripts and Kconfig |
ARM Cross-Compilation Tools¶
Required for building ARM targets (STM32, GD32):
Tool |
Version |
Purpose |
|---|---|---|
ARM GCC Toolchain |
10.3+ |
Cross-compiler for ARM Cortex-M |
OpenOCD |
0.11+ |
Debugging and flashing (optional) |
J-Link |
Latest |
Alternative debugger (optional) |
Native Build Tools¶
For native platform builds:
Windows
Visual Studio 2019+ or MSVC Build Tools
Or MinGW-w64 (GCC 9+)
Linux
GCC 9+ or Clang 10+
Build essentials (make, etc.)
macOS
Xcode Command Line Tools (Clang 12+)
Documentation Tools (Optional)¶
For building documentation:
Tool |
Version |
Purpose |
|---|---|---|
Doxygen |
1.9+ |
API documentation generation |
Sphinx |
4.0+ |
User guide documentation |
Breathe |
4.30+ |
Doxygen-Sphinx bridge |
sphinx_rtd_theme |
Latest |
Read the Docs theme |
Installation Instructions¶
Windows Installation¶
Using Chocolatey (Recommended)¶
Install Chocolatey from https://chocolatey.org/install, then:
# Core tools
choco install cmake git python
# ARM toolchain
choco install gcc-arm-embedded
# Optional: OpenOCD
choco install openocd
# Optional: Documentation tools
choco install doxygen.install
Manual Installation¶
CMake
Download from https://cmake.org/download/
Run installer and add to PATH
Verify:
cmake --version
Git
Download from https://git-scm.com/download/win
Run installer with default options
Verify:
git --version
Python
Download from https://www.python.org/downloads/
Run installer and check "Add Python to PATH"
Verify:
python --version
ARM GCC Toolchain
Download from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm
Extract to
C:\Program Files (x86)\GNU Arm Embedded ToolchainAdd
bindirectory to PATHVerify:
arm-none-eabi-gcc --version
Visual Studio Build Tools
Download from https://visualstudio.microsoft.com/downloads/
Install "Desktop development with C++" workload
Or install full Visual Studio 2019/2022
Linux Installation¶
Ubuntu/Debian¶
# Update package list
sudo apt update
# Core tools
sudo apt install cmake git python3 python3-pip build-essential
# ARM toolchain
sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi \
libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
# Optional: OpenOCD
sudo apt install openocd
# Optional: Documentation tools
sudo apt install doxygen graphviz
pip3 install sphinx breathe sphinx_rtd_theme
Fedora/RHEL¶
# Core tools
sudo dnf install cmake git python3 python3-pip gcc gcc-c++ make
# ARM toolchain
sudo dnf install arm-none-eabi-gcc-cs arm-none-eabi-binutils \
arm-none-eabi-newlib
# Optional: OpenOCD
sudo dnf install openocd
# Optional: Documentation tools
sudo dnf install doxygen graphviz
pip3 install sphinx breathe sphinx_rtd_theme
Arch Linux¶
# Core tools
sudo pacman -S cmake git python python-pip base-devel
# ARM toolchain
sudo pacman -S arm-none-eabi-gcc arm-none-eabi-binutils \
arm-none-eabi-newlib
# Optional: OpenOCD
sudo pacman -S openocd
# Optional: Documentation tools
sudo pacman -S doxygen graphviz
pip install sphinx breathe sphinx_rtd_theme
macOS Installation¶
Using Homebrew (Recommended)¶
Install Homebrew from https://brew.sh/, then:
# Core tools
brew install cmake git python
# ARM toolchain
brew install --cask gcc-arm-embedded
# Or using tap
brew tap osx-cross/arm
brew install arm-gcc-bin
# Optional: OpenOCD
brew install openocd
# Optional: Documentation tools
brew install doxygen graphviz
pip3 install sphinx breathe sphinx_rtd_theme
Xcode Command Line Tools¶
# Install Xcode Command Line Tools
xcode-select --install
# Verify
clang --version
Python Dependencies¶
Install Python packages required for build scripts:
# Navigate to Nexus directory
cd nexus
# Install requirements
pip install -r requirements.txt
# Or install manually
pip install kconfiglib colorama
Verify Installation¶
Check All Tools¶
Run this script to verify all tools are installed:
# Check CMake
cmake --version
# Check Git
git --version
# Check Python
python --version
python -c "import kconfiglib; print('kconfiglib OK')"
# Check ARM toolchain
arm-none-eabi-gcc --version
arm-none-eabi-objcopy --version
arm-none-eabi-size --version
# Check native compiler
# Windows (MSVC)
cl.exe
# Linux/macOS (GCC)
gcc --version
# macOS (Clang)
clang --version
Expected Output¶
You should see version information for each tool:
cmake version 3.22.1
git version 2.34.1
Python 3.10.4
kconfiglib OK
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Clone Nexus Repository¶
Get the Source Code¶
# Clone repository
git clone https://github.com/nexus-platform/nexus.git
cd nexus
# Initialize submodules
git submodule update --init --recursive
Verify Repository¶
# Check directory structure
ls -la
# You should see:
# - hal/
# - osal/
# - framework/
# - platforms/
# - applications/
# - tests/
# - CMakeLists.txt
# - Kconfig
# - README.md
IDE Setup (Optional)¶
Visual Studio Code¶
Recommended extensions:
C/C++ (Microsoft)
CMake Tools (Microsoft)
CMake (twxs)
Cortex-Debug (for ARM debugging)
Python (Microsoft)
Install extensions:
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.cmake-tools
code --install-extension twxs.cmake
code --install-extension marus25.cortex-debug
code --install-extension ms-python.python
See IDE Integration for detailed VS Code setup.
CLion¶
Open Nexus directory as CMake project
Configure CMake profiles for different platforms
Set up toolchains in Settings → Build, Execution, Deployment → Toolchains
Eclipse¶
Install Eclipse IDE for C/C++ Developers
Import as CMake project
Configure ARM toolchain in Project Properties
Hardware Setup¶
STM32F4 Discovery Board¶
What You Need
STM32F4DISCOVERY board (STM32F407VGT6)
Mini-USB cable
Windows: ST-Link driver from https://www.st.com/en/development-tools/stsw-link009.html
Board Features
4 user LEDs (PD12-PD15)
1 user button (PA0)
ST-LINK/V2 debugger (built-in)
Arduino-compatible headers
Driver Installation
Windows:
Download ST-Link driver
Install driver
Connect board via USB
Verify in Device Manager
Linux:
# Install udev rules
sudo cp 49-stlinkv2.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
macOS:
No driver needed, works out of the box.
Test Connection
# Using OpenOCD
openocd -f interface/stlink.cfg -f target/stm32f4x.cfg
# Using ST-Link utilities
st-info --probe
Other Boards¶
See platform-specific guides:
STM32F4 平台 Guide - STM32F4 boards
STM32H7 平台 Guide - STM32H7 boards
GD32 平台 Guide - GD32 boards
Troubleshooting¶
Common Issues¶
CMake not found
'cmake' is not recognized as an internal or external command
Solution: Add CMake to PATH or reinstall with "Add to PATH" option.
ARM toolchain not found
Could not find arm-none-eabi-gcc
Solution: Install ARM toolchain and add to PATH.
Python module not found
ModuleNotFoundError: No module named 'kconfiglib'
Solution: Install Python dependencies:
pip install -r requirements.txt
ST-Link not detected (Windows)
Solution: Install ST-Link driver from ST website.
Permission denied (Linux)
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Solution: Add udev rules and add user to dialout group:
sudo usermod -a -G dialout $USER
# Log out and log back in
Getting Help¶
If you encounter issues:
Check Frequently Asked Questions for common problems
Search GitHub Issues
Ask in GitHub Discussions
Review 贡献指南 for contribution guidelines
Next Steps¶
Now that your environment is set up:
Quick Start - Build your first example
Project Structure - Understand the codebase
Build and Flash - Learn build and deployment workflows
See Also¶
IDE Integration - Detailed IDE setup
构建系统 - Build system documentation
平台 Guides - Platform-specific guides