Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 75 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,81 @@ jobs:
- name: Lint
run: |
make fmt

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: |
make build
- name: Archive
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
build-artifacts/zephyr.uf2
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false # We'll handle submodules with smart caching
fetch-depth: 0

- name: Cache submodules
id: cache-submodules
uses: actions/cache@v4
with:
path: |
lib/fprime
lib/fprime-zephyr
lib/zephyr-workspace/zephyr
key: project-deps-${{ hashFiles('.gitmodules') }}-v3
restore-keys: |
project-deps-${{ hashFiles('.gitmodules') }}-
project-deps-

- name: Setup submodules
if: steps.cache-submodules.outputs.cache-hit != 'true'
run: |
make submodules

- name: Cache python environment
id: cache-python
uses: actions/cache@v4
with:
path: fprime-venv
key: python-packages-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
restore-keys: |
python-packages-${{ runner.os }}-
python-packages-

- name: Setup python environment
if: steps.cache-python.outputs.cache-hit != 'true'
run: |
make fprime-venv

- name: Cache Zephyr workspace and SDK
id: cache-zephyr
uses: actions/cache@v4
with:
path: |
lib/zephyr-workspace/modules
lib/zephyr-workspace/bootloader
~/zephyr-sdk-0.17.2
key: zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
restore-keys: |
zephyr-minimal-${{ hashFiles('west.yml') }}-${{ runner.os }}-
zephyr-minimal-

- name: Setup Zephyr
if: steps.cache-zephyr.outputs.cache-hit != 'true'
run: |
make zephyr-setup
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
PIP_NO_COMPILE: 1

- name: Build
run: |
# Skip both zephyr-setup and submodules since we cached them separately
make build -o zephyr-setup -o submodules
Comment on lines +84 to +85
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -o flags attempt to skip make targets, but this syntax is for skipping files, not targets. Consider using a different approach like conditional logic in the Makefile or separate build commands that don't depend on these targets.

Suggested change
# Skip both zephyr-setup and submodules since we cached them separately
make build -o zephyr-setup -o submodules
# Build, setup and submodules have already been handled (cached or run above)
make build

Copilot uses AI. Check for mistakes.

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
build-artifacts/zephyr.uf2
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
retention-days: 30
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
####

cmake_minimum_required(VERSION 3.24.2)

# Set BOARD_ROOT to find custom boards
# The structure is BOARD_ROOT/boards/vendor/board
list(APPEND BOARD_ROOT "${CMAKE_CURRENT_LIST_DIR}")

# Patch in std-atomic implementations
if (BOARD STREQUAL "rpi_pico" OR FPRIME_ZEPHYR_USE_STD_ATOMIC_FIX)
include_directories(BEFORE "${CMAKE_CURRENT_LIST_DIR}/lib/fprime-zephyr/fprime-zephyr/Os/StdAtomic")
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ fprime-venv: ## Create a virtual environment

.PHONY: zephyr-setup
zephyr-setup: fprime-venv ## Set up Zephyr environment
@test -s lib/zephyr-workspace/tools/edtt/.gitignore || { \
@test -d lib/zephyr-workspace/modules/hal/rpi_pico || test -d ../lib/zephyr-workspace/modules/hal/rpi_pico || { \
echo "Setting up Zephyr environment..."; \
cd lib/zephyr-workspace && \
$(UVX) west update && \
$(UVX) west zephyr-export && \
$(UV) run west packages pip --install && \
$(UV) run west sdk install; \
rm -rf ../.west/ && \
$(UVX) west init --local . && \
$(UVX) west update && \
$(UVX) west zephyr-export && \
$(UV) run west packages pip --install && \
$(UV) run west sdk install --toolchains arm-zephyr-eabi; \
}

##@ Development
Expand Down Expand Up @@ -67,6 +68,12 @@ clean: ## Remove all gitignored files
clean-zephyr: ## Remove all Zephyr build files
rm -rf lib/zephyr-workspace/bootloader lib/zephyr-workspace/modules lib/zephyr-workspace/tools

.PHONY: clean-zephyr-sdk
clean-zephyr-sdk: ## Remove Zephyr SDK (reinstall with 'make zephyr-setup')
@echo "Removing Zephyr SDK..."
rm -rf ~/zephyr-sdk-*
@echo "Run 'make zephyr-setup' to reinstall with minimal ARM-only toolchain"

##@ Operations

.PHONY: gds
Expand Down
5 changes: 0 additions & 5 deletions lib/zephyr-workspace/.west/config

This file was deleted.

88 changes: 88 additions & 0 deletions west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# West manifest for PROVES Core - Optimized for RP2040/RP2350 only
# This minimal manifest significantly reduces the download and setup time
# by only including modules required for Raspberry Pi RP2040/RP2350 builds

manifest:
defaults:
remote: upstream

remotes:
- name: upstream
url-base: https://github.com/zephyrproject-rtos

# Import filter to exclude optional groups
group-filter: [-babblesim, -optional]

projects:
# Zephyr RTOS core
- name: zephyr
repo-path: zephyr
revision: v4.2.0
path: lib/zephyr-workspace/zephyr
west-commands: scripts/west-commands.yml
import:
# Import specific submanifests only (instead of all submanifests)
name-allowlist:
- cmsis # ARM CMSIS support (required for Cortex-M)
- hal_rpi_pico # Raspberry Pi Pico HAL (REQUIRED for RP2040/RP2350)
- picolibc # C library
- mbedtls # Crypto library
- tinycrypt # Lightweight crypto library
- mcuboot # Bootloader support

# Core modules required for RP2040/RP2350
- name: cmsis
revision: 512cc7e895e8491696b61f7ba8066b4a182569b8
path: lib/zephyr-workspace/modules/hal/cmsis
groups:
- hal

- name: cmsis_6
repo-path: CMSIS_6
revision: 06d952b6713a2ca41c9224a62075e4059402a151
path: lib/zephyr-workspace/modules/hal/cmsis_6
groups:
- hal

- name: hal_rpi_pico
path: lib/zephyr-workspace/modules/hal/rpi_pico
revision: 7b57b24588797e6e7bf18b6bda168e6b96374264
groups:
- hal

- name: hal_st
revision: 9f81b4427e955885398805b7bca0da3a8cd9109c
path: lib/zephyr-workspace/modules/hal/st
groups:
- hal

Comment on lines +53 to +58
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hal_st module is included but the comment in the documentation indicates it's for LIS2MDL and LSM6DSO sensors. Consider adding a comment explaining why this STM HAL is needed for RP2040/RP2350 builds or remove it if it's not actually required for the minimal setup.

Suggested change
- name: hal_st
revision: 9f81b4427e955885398805b7bca0da3a8cd9109c
path: lib/zephyr-workspace/modules/hal/st
groups:
- hal

Copilot uses AI. Check for mistakes.
- name: picolibc
path: lib/zephyr-workspace/modules/lib/picolibc
revision: 560946f26db075c296beea5b39d99e6de43c9010

- name: loramac-node
revision: fb00b383072518c918e2258b0916c996f2d4eebe
path: lib/zephyr-workspace/modules/lib/loramac-node

# Crypto libraries (commonly used)
- name: mbedtls
revision: 85440ef5fffa95d0e9971e9163719189cf34d979
path: lib/zephyr-workspace/modules/crypto/mbedtls
groups:
- crypto

- name: tinycrypt
revision: 1012a3ebee18c15ede5efc8332ee2fc37817670f
path: lib/zephyr-workspace/modules/crypto/tinycrypt
groups:
- crypto

# Bootloader support (optional - remove if not needed)
- name: mcuboot
revision: 4eba8087fa606db801455f14d185255bc8c49467
path: lib/zephyr-workspace/bootloader/mcuboot
groups:
- bootloader

self:
path: .