Skip to content

Commit 05fbdda

Browse files
committed
Merge branch 'board-definition' of github.com:Open-Source-Space-Foundation/proves-core-reference into lsm6dso-driver-component
2 parents ee86a88 + 1fcd2ce commit 05fbdda

17 files changed

+321
-80
lines changed

CMakePresets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
{
44
"binaryDir": "${sourceDir}/build-fprime-automatic-zephyr",
55
"cacheVariables": {
6-
"BOARD": "teensy41",
6+
"BOARD": "proves_flight_control_board_v5c/rp2350a/m33",
77
"CMAKE_BUILD_TYPE": "Release",
88
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
99
},
1010
"description": "F\u00b4 release build using local fprime-venv",
11-
"displayName": "F\u00b4 Zephyr (teensy41)",
11+
"displayName": "F\u00b4 FPrime Zephyr PROVES",
1212
"environment": {
1313
"PATH": "$env{VIRTUAL_ENV}/bin:$penv{PATH}",
1414
"VIRTUAL_ENV": "${fileDir}/fprime-venv"
1515
},
1616
"generator": "Ninja",
17-
"name": "fprime-zephyr-teensy41",
17+
"name": "fprime-zephyr-proves",
1818
"toolchainFile": "${fileDir}/lib/fprime-zephyr/cmake/toolchain/zephyr.cmake"
1919
}
2020
],

Makefile

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ submodules: ## Initialize and update git submodules
1313
git submodule update --init --recursive
1414

1515
export VIRTUAL_ENV ?= $(shell pwd)/fprime-venv
16-
fprime-venv: uv ## Create a virtual environment
17-
@test -s $(VIRTUAL_ENV) || { \
18-
echo "Creating virtual environment..."; \
19-
$(UV) venv fprime-venv; \
20-
$(UV) pip install --requirement requirements.txt; \
21-
}
16+
fprime-venv: ## Create a virtual environment
17+
@$(MAKE) uv
18+
@echo "Creating virtual environment..."
19+
@$(UV) venv fprime-venv
20+
@$(UV) pip install --requirement requirements.txt
2221

2322
.PHONY: zephyr-setup
24-
zephyr-setup: uv ## Set up Zephyr environment
23+
zephyr-setup: fprime-venv ## Set up Zephyr environment
2524
@test -s lib/zephyr-workspace/tools/edtt/.gitignore || { \
2625
echo "Setting up Zephyr environment..."; \
2726
cd lib/zephyr-workspace && \
@@ -34,45 +33,34 @@ zephyr-setup: uv ## Set up Zephyr environment
3433
##@ Development
3534

3635
.PHONY: pre-commit-install
37-
pre-commit-install: uv
38-
@echo "Installing pre-commit hooks..."
36+
pre-commit-install: uv ## Install pre-commit hooks
3937
@$(UVX) pre-commit install > /dev/null
4038

4139
.PHONY: fmt
4240
fmt: pre-commit-install ## Lint and format files
43-
$(UVX) pre-commit run --all-files
41+
@$(UVX) pre-commit run --all-files
4442

4543
.PHONY: generate
4644
generate: submodules fprime-venv zephyr-setup ## Generate FPrime-Zephyr Proves Core Reference
4745
@echo "Generating FPrime-Zephyr Proves Core Reference..."
48-
$(UV) run fprime-util generate --force
46+
@$(UV) run fprime-util generate --force
4947

5048
.PHONY: generate-if-needed
5149
BUILD_DIR ?= $(shell pwd)/build-fprime-automatic-zephyr
5250
generate-if-needed:
5351
@test -s $(BUILD_DIR) || $(MAKE) generate
5452

5553
.PHONY: build
56-
build: generate-if-needed ## Build FPrime-Zephyr Proves Core Reference
57-
@echo "Building FPrime code..."
54+
build: submodules zephyr-setup fprime-venv generate-if-needed ## Build FPrime-Zephyr Proves Core Reference
55+
@echo "Building..."
5856
@$(UV) run fprime-util build
5957

60-
.PHONY: list-tty
61-
list-tty: arduino-cli ## List available TTY ports
62-
@echo "TTY ports:"
63-
@$(ARDUINO_CLI) board list | grep "USB" | awk '{print $$1}'
64-
65-
.PHONY: install
66-
UF2 ?= $(BUILD_DIR)/zephyr/zephyr.uf2
67-
install: arduino-cli build ## Install the zephyr firmware onto a connected PROVES Kit, requires BOARD_DIR=[path-to-your-board]
68-
@$(ARDUINO_CLI) config init || true
69-
@$(ARDUINO_CLI) config add board_manager.additional_urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
70-
@$(ARDUINO_CLI) core install rp2040:[email protected]
71-
@$(ARDUINO_CLI) upload -v -b 115200 --fqbn rp2040:rp2040:rpipico -p $(BOARD_DIR) -i $(UF2)
72-
7358
.PHONY: clean
7459
clean: ## Remove all gitignored files
7560
git clean -dfX
61+
62+
.PHONY: clean-zephyr
63+
clean-zephyr: ## Remove all Zephyr build files
7664
rm -rf lib/zephyr-workspace/bootloader lib/zephyr-workspace/modules lib/zephyr-workspace/tools
7765

7866
##@ Operations
@@ -98,9 +86,3 @@ UVX ?= $(UV_DIR)/uvx
9886
uv: $(UV) ## Download uv
9987
$(UV): $(BIN_DIR)
10088
@test -s $(UV) || { mkdir -p $(UV_DIR); curl -LsSf https://astral.sh/uv/$(UV_VERSION)/install.sh | UV_INSTALL_DIR=$(UV_DIR) sh > /dev/null; }
101-
102-
ARDUINO_CLI ?= $(BIN_DIR)/arduino-cli
103-
.PHONY: arduino-cli
104-
arduino-cli: $(ARDUINO_CLI) ## Download arduino-cli
105-
$(ARDUINO_CLI): $(BIN_DIR)
106-
@test -s $(ARDUINO_CLI) || curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=$(BIN_DIR) sh > /dev/null

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,7 @@ make build
3636

3737
### Find the path to your board
3838

39-
Next, plug in your board! If you have previously installed a firmware on your board you may not see it show up as a drive. In that case you'll want to find it's `tty` port.
40-
41-
To do this, run the following command
42-
```shell
43-
make list-tty
44-
```
45-
46-
Otherwise, you want to find the location of the board on your computer. It should be called something like RP2350 but you want to find the path to it
39+
Next, plug in your board! If you have previously installed a firmware on your board you may not see it show up as a drive. In that case you'll want to put the board into boot loader mode. Then you'll be able to find the location of the board on your computer. It should be called something like RP2350 but you want to find the path to it
4740

4841
For Mac:
4942
```shell
@@ -63,6 +56,13 @@ Now you want to install the firmware to the board.
6356
make install BOARD_DIR=[path-to-your-board]
6457
```
6558

59+
or
60+
```
61+
cp build-fprime-automatic-zephyr/zephyr/zephyr.uf2 [path-to-your-board]
62+
```
63+
to copy the uf2 if the make install isn't working
64+
65+
6666
Finally, run the fprime-gds.
6767
```shell
6868
make gds
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
config SOC_RP2350A_M33
2+
bool "Enable Arm cores"
3+
default y
4+
5+
config USB_SELF_POWERED
6+
default n
7+
8+
config USB_CDC_ACM_LOG_LEVEL
9+
default 0
10+
11+
config USB_DEVICE_LOG_LEVEL
12+
default 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350a-pinctrl.h>
2+
3+
&pinctrl {
4+
spi1_default: spi1_default {
5+
group1 {
6+
pinmux = <SPI1_SCK_P10>, <SPI1_TX_P11>;
7+
};
8+
9+
group2 {
10+
pinmux = <SPI1_RX_P8>;
11+
input-enable;
12+
};
13+
};
14+
i2c1_default: i2c1_default {
15+
group1 {
16+
pinmux = <I2C1_SCL_P3>, <I2C1_SDA_P2>;
17+
input-enable;
18+
};
19+
};
20+
};
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#include <freq.h>
2+
3+
#include <zephyr/dt-bindings/i2c/i2c.h>
4+
#include <zephyr/dt-bindings/pwm/pwm.h>
5+
6+
#include "proves_flight_control_board_v5-pinctrl.dtsi"
7+
8+
/ {
9+
chosen {
10+
zephyr,sram = &sram0;
11+
zephyr,flash = &flash0;
12+
zephyr,console = &cdc_acm_uart0;
13+
zephyr,shell-uart = &cdc_acm_uart0;
14+
zephyr,code-partition = &code_partition;
15+
};
16+
17+
aliases {
18+
watchdog0 = &wdt0;
19+
};
20+
21+
leds {
22+
compatible = "gpio-leds";
23+
led0: led0 {
24+
gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
25+
label = "User LED GPIO24";
26+
};
27+
};
28+
};
29+
30+
zephyr_udc0: &usbd {
31+
status = "okay";
32+
};
33+
34+
&zephyr_udc0 {
35+
cdc_acm_uart0: cdc_acm_uart0 {
36+
compatible = "zephyr,cdc-acm-uart";
37+
label = "CDC_ACM_0";
38+
};
39+
};
40+
41+
&flash0 {
42+
reg = <0x10000000 DT_SIZE_M(4)>;
43+
44+
partitions {
45+
compatible = "fixed-partitions";
46+
#address-cells = <1>;
47+
#size-cells = <1>;
48+
49+
/* Reserved memory for an image definition block. The block is much
50+
* smaller than 256 bytes, but in practice the linker places the vector
51+
* table at a much larger alignment offset.
52+
*/
53+
image_def: partition@0 {
54+
label = "image_def";
55+
reg = <0x00000000 0x100>;
56+
read-only;
57+
};
58+
59+
/*
60+
* Usable flash. Starts at 0x100, after the image definition block.
61+
* The partition size is 4MB minus the 0x100 bytes taken by the
62+
* image definition.
63+
*/
64+
code_partition: partition@100 {
65+
label = "code-partition";
66+
reg = <0x100 (DT_SIZE_M(4) - 0x100)>;
67+
read-only;
68+
};
69+
};
70+
};
71+
72+
&timer0 {
73+
status = "okay";
74+
};
75+
76+
&wdt0 {
77+
status = "okay";
78+
};
79+
80+
&gpio0 {
81+
status = "okay";
82+
};
83+
84+
&spi1 {
85+
status = "okay";
86+
cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
87+
pinctrl-0 = <&spi1_default>;
88+
pinctrl-names = "default";
89+
90+
lora0: sx1276@0 {
91+
compatible = "semtech,sx1276";
92+
reg = <0>;
93+
spi-max-frequency = <125000>;
94+
dio-gpios = <&gpio0 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,<&gpio0 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
95+
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
96+
power-amplifier-output = "pa-boost";
97+
label = "HOPE_RF";
98+
};
99+
};
100+
101+
&i2c1 {
102+
status = "okay";
103+
pinctrl-0 = <&i2c1_default>;
104+
pinctrl-names = "default";
105+
clock-frequency = <100000>;
106+
107+
lsm6dso0: lsm6dso0@6b {
108+
compatible = "st,lsm6dso";
109+
reg = <0x6b>;
110+
label = "LSM6DSO";
111+
};
112+
113+
lis2mdl: lis2mdl@1e {
114+
compatible = "st,lis2mdl";
115+
reg = <0x1e>;
116+
label = "LIS2MDL";
117+
};
118+
rv3028: rv3028@52 {
119+
compatible = "microcrystal,rv3028";
120+
reg = <0x52>;
121+
int-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
122+
backup-switch-mode = "level";
123+
label = "RV3028";
124+
};
125+
ina219: ina219@40 {
126+
compatible = "ti,ina219";
127+
reg = <0x40>;
128+
shunt-milliohm = <2>;
129+
lsb-microamp = <100>;
130+
label = "INA219";
131+
};
132+
};
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
# Copyright (c) 2024 Andrew Featherstone
2-
# SPDX-License-Identifier: Apache-2.0
3-
4-
config BOARD_PROVES_FLIGHT_CONTROL_BOARD_V5C
5-
select SOC_RP2350A_M33 if BOARD_PROVES_FLIGHT_CONTROL_BOARD_V5C_RP2350A_M33
1+
source "../../../boards/bronco_space/proves_flight_control_board_v5/Kconfig.defconfig"

boards/bronco_space/proves_flight_control_board_v5c/proves_flight_control_board_v5c_rp2350a_m33.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
1717
#include <raspberrypi/rpi_pico/m33.dtsi>
1818

19-
#include "proves_flight_control_board_v5c.dtsi"
19+
#include "../proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi"

boards/bronco_space/proves_flight_control_board_v5c/proves_flight_control_board_v5c_rp2350a_m33_defconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,17 @@ CONFIG_USE_DT_CODE_PARTITION=y
1111
CONFIG_USB_DEVICE_STACK=y
1212
CONFIG_USB_DEVICE_PRODUCT="PROVES Flight Control Board v5c"
1313
CONFIG_USB_DEVICE_VID=0x0028
14+
15+
# Sensors
16+
CONFIG_LSM6DSO=y
17+
CONFIG_LSM6DSO_ENABLE_TEMP=y
18+
CONFIG_LIS2MDL=y
19+
CONFIG_INA219=y
20+
21+
# Radio
22+
CONFIG_LORA=y
23+
CONFIG_LORA_SX127X=y
24+
25+
# RTC
26+
CONFIG_RTC=y
27+
CONFIG_RTC_RV3028=y
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config BOARD_PROVES_FLIGHT_CONTROL_BOARD_V5D
2+
bool "PROVES Flight Control Board v5d"
3+
default y
4+
5+
source "../../../boards/bronco_space/proves_flight_control_board_v5/Kconfig.defconfig"

0 commit comments

Comments
 (0)