Skip to content

Commit 9b36eab

Browse files
committed
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves-core-reference into burnwire
2 parents 094792b + 50d297e commit 9b36eab

File tree

5 files changed

+208
-22
lines changed

5 files changed

+208
-22
lines changed

.github/workflows/ci.yaml

Lines changed: 90 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,96 @@ jobs:
1414
- name: Lint
1515
run: |
1616
make fmt
17+
1718
build:
1819
runs-on: ubuntu-latest
20+
1921
steps:
20-
- uses: actions/checkout@v4
21-
- name: Build
22-
run: |
23-
make build
24-
- name: Archive
25-
uses: actions/upload-artifact@v4
26-
with:
27-
name: artifacts
28-
path: |
29-
build-artifacts/zephyr.uf2
30-
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: false # We'll handle submodules with smart caching
26+
fetch-depth: 0
27+
28+
# - name: Cache bin
29+
# id: cache-bin
30+
# uses: actions/cache@v4
31+
# with:
32+
# path: |
33+
# bin
34+
# key: bin-${{ hashFiles('Makefile') }}-v3
35+
# restore-keys: |
36+
# bin-${{ hashFiles('Makefile') }}-
37+
# bin-
38+
39+
- name: Download bin tools
40+
if: steps.cache-bin.outputs.cache-hit != 'true'
41+
run: |
42+
make download-bin
43+
44+
# - name: Cache submodules
45+
# id: cache-submodules
46+
# uses: actions/cache@v4
47+
# with:
48+
# path: |
49+
# lib/fprime
50+
# lib/fprime-zephyr
51+
# lib/zephyr-workspace/zephyr
52+
# key: submodules-${{ hashFiles('.gitmodules') }}-v3
53+
# restore-keys: |
54+
# submodules-${{ hashFiles('.gitmodules') }}-
55+
# submodules-
56+
57+
- name: Setup submodules
58+
if: steps.cache-submodules.outputs.cache-hit != 'true'
59+
run: |
60+
make submodules
61+
62+
# - name: Cache python venv
63+
# id: cache-python
64+
# uses: actions/cache@v4
65+
# with:
66+
# path: fprime-venv
67+
# key: python-venv-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-v3
68+
# restore-keys: |
69+
# python-venv-${{ runner.os }}-
70+
# python-venv-
71+
72+
- name: Setup python venv
73+
if: steps.cache-python.outputs.cache-hit != 'true'
74+
run: |
75+
make fprime-venv
76+
77+
# - name: Cache Zephyr workspace and SDK
78+
# id: cache-zephyr
79+
# uses: actions/cache@v4
80+
# with:
81+
# path: |
82+
# lib/zephyr-workspace/modules
83+
# lib/zephyr-workspace/bootloader
84+
# ~/zephyr-sdk-0.17.2
85+
# key: zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-v3
86+
# restore-keys: |
87+
# zephyr-${{ hashFiles('west.yml') }}-${{ runner.os }}-
88+
# zephyr-
89+
90+
- name: Setup Zephyr
91+
if: steps.cache-zephyr.outputs.cache-hit != 'true'
92+
run: |
93+
make zephyr-setup
94+
env:
95+
PIP_DISABLE_PIP_VERSION_CHECK: 1
96+
PIP_NO_COMPILE: 1
97+
98+
- name: Build
99+
run: |
100+
make generate-ci build-ci
101+
102+
- name: Upload build artifacts
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: artifacts
106+
path: |
107+
build-artifacts/zephyr.uf2
108+
build-artifacts/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json
109+
retention-days: 30

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
####
55

66
cmake_minimum_required(VERSION 3.24.2)
7+
8+
# Set BOARD_ROOT to find custom boards
9+
# The structure is BOARD_ROOT/boards/vendor/board
10+
list(APPEND BOARD_ROOT "${CMAKE_CURRENT_LIST_DIR}")
11+
712
# Patch in std-atomic implementations
813
if (BOARD STREQUAL "rpi_pico" OR FPRIME_ZEPHYR_USE_STD_ATOMIC_FIX)
914
include_directories(BEFORE "${CMAKE_CURRENT_LIST_DIR}/lib/fprime-zephyr/fprime-zephyr/Os/StdAtomic")

Makefile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ fprime-venv: ## Create a virtual environment
2323

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

3536
##@ Development
@@ -47,6 +48,10 @@ generate: submodules fprime-venv zephyr-setup ## Generate FPrime-Zephyr Proves C
4748
@echo "Generating FPrime-Zephyr Proves Core Reference..."
4849
@$(UV) run fprime-util generate --force
4950

51+
.PHONY: generate-ci
52+
generate-ci:
53+
@$(UV) run fprime-util generate --force
54+
5055
.PHONY: generate-if-needed
5156
BUILD_DIR ?= $(shell pwd)/build-fprime-automatic-zephyr
5257
generate-if-needed:
@@ -57,6 +62,10 @@ build: submodules zephyr-setup fprime-venv generate-if-needed ## Build FPrime-Ze
5762
@echo "Building..."
5863
@$(UV) run fprime-util build
5964

65+
.PHONY: build-ci
66+
build-ci:
67+
@$(UV) run fprime-util build
68+
6069
.PHONY: test-integration
6170
test-integration:
6271
@$(UV) run pytest FprimeZephyrReference/test/int --deployment build-artifacts/zephyr/fprime-zephyr-deployment
@@ -69,6 +78,12 @@ clean: ## Remove all gitignored files
6978
clean-zephyr: ## Remove all Zephyr build files
7079
rm -rf lib/zephyr-workspace/bootloader lib/zephyr-workspace/modules lib/zephyr-workspace/tools
7180

81+
.PHONY: clean-zephyr-sdk
82+
clean-zephyr-sdk: ## Remove Zephyr SDK (reinstall with 'make zephyr-setup')
83+
@echo "Removing Zephyr SDK..."
84+
rm -rf ~/zephyr-sdk-*
85+
@echo "Run 'make zephyr-setup' to reinstall with minimal ARM-only toolchain"
86+
7287
##@ Operations
7388

7489
.PHONY: gds
@@ -78,6 +93,10 @@ gds: ## Run FPrime GDS
7893
@$(UV) run fprime-gds -n --dictionary $(ARTIFACT_DIR)/zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json --communication-selection uart --uart-baud 115200 --output-unframed-data
7994

8095
##@ Build Tools
96+
97+
.PHONY: download-bin
98+
download-bin: uv
99+
81100
BIN_DIR ?= $(shell pwd)/bin
82101
$(BIN_DIR):
83102
mkdir -p $(BIN_DIR)

lib/zephyr-workspace/.west/config

Lines changed: 0 additions & 5 deletions
This file was deleted.

west.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# West manifest for PROVES Core - Optimized for RP2040/RP2350 only
2+
# This minimal manifest significantly reduces the download and setup time
3+
# by only including modules required for Raspberry Pi RP2040/RP2350 builds
4+
5+
manifest:
6+
defaults:
7+
remote: upstream
8+
9+
remotes:
10+
- name: upstream
11+
url-base: https://github.com/zephyrproject-rtos
12+
13+
# Import filter to exclude optional groups
14+
group-filter: [-babblesim, -optional]
15+
16+
projects:
17+
# Zephyr RTOS core
18+
- name: zephyr
19+
repo-path: zephyr
20+
revision: v4.2.0
21+
path: lib/zephyr-workspace/zephyr
22+
west-commands: scripts/west-commands.yml
23+
import:
24+
# Import specific submanifests only (instead of all submanifests)
25+
name-allowlist:
26+
- cmsis # ARM CMSIS support (required for Cortex-M)
27+
- hal_rpi_pico # Raspberry Pi Pico HAL (REQUIRED for RP2040/RP2350)
28+
- picolibc # C library
29+
- mbedtls # Crypto library
30+
- tinycrypt # Lightweight crypto library
31+
- mcuboot # Bootloader support
32+
33+
# Core modules required for RP2040/RP2350
34+
- name: cmsis
35+
revision: 512cc7e895e8491696b61f7ba8066b4a182569b8
36+
path: lib/zephyr-workspace/modules/hal/cmsis
37+
groups:
38+
- hal
39+
40+
- name: cmsis_6
41+
repo-path: CMSIS_6
42+
revision: 06d952b6713a2ca41c9224a62075e4059402a151
43+
path: lib/zephyr-workspace/modules/hal/cmsis_6
44+
groups:
45+
- hal
46+
47+
- name: hal_rpi_pico
48+
path: lib/zephyr-workspace/modules/hal/rpi_pico
49+
revision: 7b57b24588797e6e7bf18b6bda168e6b96374264
50+
groups:
51+
- hal
52+
53+
- name: hal_st
54+
revision: 9f81b4427e955885398805b7bca0da3a8cd9109c
55+
path: lib/zephyr-workspace/modules/hal/st
56+
groups:
57+
- hal
58+
59+
- name: picolibc
60+
path: lib/zephyr-workspace/modules/lib/picolibc
61+
revision: 560946f26db075c296beea5b39d99e6de43c9010
62+
63+
- name: loramac-node
64+
revision: fb00b383072518c918e2258b0916c996f2d4eebe
65+
path: lib/zephyr-workspace/modules/lib/loramac-node
66+
67+
# Crypto libraries (commonly used)
68+
- name: mbedtls
69+
revision: 85440ef5fffa95d0e9971e9163719189cf34d979
70+
path: lib/zephyr-workspace/modules/crypto/mbedtls
71+
groups:
72+
- crypto
73+
74+
- name: tinycrypt
75+
revision: 1012a3ebee18c15ede5efc8332ee2fc37817670f
76+
path: lib/zephyr-workspace/modules/crypto/tinycrypt
77+
groups:
78+
- crypto
79+
80+
# Bootloader support (optional - remove if not needed)
81+
- name: mcuboot
82+
revision: 4eba8087fa606db801455f14d185255bc8c49467
83+
path: lib/zephyr-workspace/bootloader/mcuboot
84+
groups:
85+
- bootloader
86+
87+
self:
88+
path: .

0 commit comments

Comments
 (0)