Skip to content

Commit a259a57

Browse files
committed
Vibe Coded West Manifest
1 parent 0209bc1 commit a259a57

File tree

2 files changed

+300
-0
lines changed

2 files changed

+300
-0
lines changed
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# West Manifest Setup for RP2040/RP2350
2+
3+
This project uses a minimal West manifest (`west.yml`) optimized specifically for Raspberry Pi RP2040 and RP2350 builds. This significantly reduces setup time and disk space compared to the full Zephyr workspace.
4+
5+
## What's Included
6+
7+
The minimal manifest includes only the essential modules for RP2040/RP2350:
8+
9+
- **Zephyr RTOS core** (v4.2.0)
10+
- **hal_rpi_pico** - Raspberry Pi Pico Hardware Abstraction Layer (REQUIRED)
11+
- **hal_st** - STMicroelectronics HAL (for LIS2MDL, LSM6DSO sensors)
12+
- **cmsis** - ARM CMSIS support for Cortex-M processors
13+
- **cmsis_6** - ARM CMSIS v6 (required for Cortex-M33 in RP2350)
14+
- **picolibc** - Lightweight C library
15+
- **loramac-node** - LoRa/LoRaWAN support (for SX127x radios)
16+
- **mbedtls** - Cryptographic library
17+
- **tinycrypt** - Lightweight cryptographic library
18+
- **mcuboot** - Bootloader support
19+
20+
## Fresh Installation
21+
22+
### Option A: Automated Setup (Recommended)
23+
24+
Use the convenience script that handles everything:
25+
26+
```bash
27+
./scripts/setup-minimal-zephyr.sh
28+
```
29+
30+
This script will:
31+
1. Initialize the West workspace
32+
2. Download only the minimal modules
33+
3. Export the Zephyr CMake package
34+
4. Install only the ARM toolchain (~95 MB instead of ~1.2 GB)
35+
36+
### Option B: Manual Setup
37+
38+
If you prefer to run the commands manually:
39+
40+
```bash
41+
# Initialize west workspace with this manifest
42+
west init -l .
43+
44+
# Update all projects (downloads only the minimal set of modules)
45+
west update
46+
47+
# Export Zephyr CMake package
48+
west zephyr-export
49+
50+
# Install Zephyr SDK with ONLY the ARM toolchain (for RP2040/RP2350)
51+
# This avoids downloading 500+ MB of unnecessary toolchains
52+
cd lib/zephyr-workspace/zephyr
53+
python3 scripts/sdk-install/sdk_install.py --toolchains arm-zephyr-eabi
54+
cd ../../..
55+
```
56+
57+
## Migrating from Full Zephyr Workspace
58+
59+
If you already have a full Zephyr workspace installed:
60+
61+
### Option 1: Clean Start (Recommended)
62+
63+
```bash
64+
# Backup any local changes first!
65+
66+
# Remove the old workspace
67+
rm -rf lib/zephyr-workspace
68+
69+
# Initialize with the new minimal manifest
70+
west init -l .
71+
72+
# Update with minimal modules
73+
west update
74+
75+
# Export Zephyr CMake package
76+
west zephyr-export
77+
78+
# Install only the ARM toolchain
79+
cd lib/zephyr-workspace/zephyr
80+
python3 scripts/sdk-install/sdk_install.py --toolchains arm-zephyr-eabi
81+
cd ../../..
82+
```
83+
84+
### Option 2: Update Existing Workspace
85+
86+
```bash
87+
# Update west configuration to use the new manifest
88+
west config manifest.path .
89+
90+
# Update all projects
91+
west update
92+
```
93+
94+
## Disk Space Savings
95+
96+
- **Full Zephyr workspace**: ~3-5 GB
97+
- **Minimal RP2040/RP2350 workspace**: ~500-800 MB
98+
99+
This represents approximately **80-85% reduction** in disk space and download time.
100+
101+
## Zephyr SDK Optimization
102+
103+
The default Zephyr SDK installation downloads toolchains for all supported architectures (~1+ GB). Since this project only targets RP2040/RP2350 (ARM Cortex-M), you only need the `arm-zephyr-eabi` toolchain (~95 MB).
104+
105+
### Installing Only the ARM Toolchain
106+
107+
Instead of running the default SDK setup, use the selective installation:
108+
109+
```bash
110+
cd lib/zephyr-workspace/zephyr
111+
python3 scripts/sdk-install/sdk_install.py --toolchains arm-zephyr-eabi
112+
```
113+
114+
This installs **only**:
115+
- `arm-zephyr-eabi` - ARM Cortex-M toolchain (required for RP2040/RP2350)
116+
117+
This avoids downloading unnecessary toolchains for:
118+
- aarch64, arc64, arc, microblazeel, mips, nios2, riscv64, rx, sparc, x86_64, xtensa
119+
120+
### SDK Space Savings
121+
122+
- **Full SDK (all toolchains)**: ~1.2 GB
123+
- **ARM-only SDK**: ~95 MB
124+
125+
This represents a **~92% reduction** in SDK size.
126+
127+
### Reinstalling SDK with Minimal Toolchains
128+
129+
If you've already installed the full SDK and want to reclaim disk space:
130+
131+
```bash
132+
# Remove existing SDK (backs up ~1+ GB of space)
133+
rm -rf ~/zephyr-sdk-*
134+
135+
# Install minimal SDK with only ARM toolchain
136+
cd lib/zephyr-workspace/zephyr
137+
python3 scripts/sdk-install/sdk_install.py --toolchains arm-zephyr-eabi
138+
cd -
139+
```
140+
141+
**Note**: Your existing builds will continue to work after reinstalling with the ARM-only toolchain since this project only uses RP2040/RP2350 boards.
142+
143+
## Adding Additional Modules
144+
145+
If your project requires additional Zephyr modules, you can add them to the `west.yml` file. For example:
146+
147+
### Adding Filesystem Support
148+
149+
```yaml
150+
- name: littlefs
151+
path: lib/zephyr-workspace/modules/fs/littlefs
152+
groups:
153+
- fs
154+
revision: 8f5ca347843363882619d8f96c00d8dbd88a8e79
155+
```
156+
157+
### Adding Display/GUI Support
158+
159+
```yaml
160+
- name: lvgl
161+
revision: b03edc8e6282a963cd312cd0b409eb5ce263ea75
162+
path: lib/zephyr-workspace/modules/lib/gui/lvgl
163+
```
164+
165+
After modifying `west.yml`, run:
166+
167+
```bash
168+
west update
169+
```
170+
171+
## Verifying Your Setup
172+
173+
To verify that your workspace is properly configured:
174+
175+
```bash
176+
# Check west status
177+
west list
178+
179+
# Try building for one of your boards
180+
west build -b proves_flight_control_board_v5c FprimeZephyrReference/ReferenceDeployment
181+
```
182+
183+
## Troubleshooting
184+
185+
### "Module not found" errors during build
186+
187+
If you encounter errors about missing modules during build, you may need to add that specific module to `west.yml`. Check the error message for the module name and add it following the pattern in the manifest.
188+
189+
### Reverting to Full Manifest
190+
191+
If you need the full Zephyr workspace:
192+
193+
```bash
194+
# Update west configuration to use Zephyr's manifest
195+
west config manifest.path lib/zephyr-workspace/zephyr
196+
197+
# Update to get all modules
198+
west update
199+
```
200+
201+
## Module Version Updates
202+
203+
To update module versions:
204+
205+
1. Check the latest revisions in [Zephyr's west.yml](https://github.com/zephyrproject-rtos/zephyr/blob/main/west.yml)
206+
2. Update the `revision` field for each module in your `west.yml`
207+
3. Run `west update`
208+
209+
## References
210+
211+
- [West Manifest Documentation](https://docs.zephyrproject.org/latest/develop/west/manifest.html)
212+
- [Zephyr Getting Started](https://docs.zephyrproject.org/latest/develop/getting_started/index.html)

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)