Skip to content

Commit f030b24

Browse files
Use custom board definition (#10)
* Use custom board definition * Remove commented config * Moving prj.conf sensors to board definition * Add d board * Try referencing c definitions in d board * Making a common v5 board definition * Fix readme --------- Co-authored-by: Michael Pham <[email protected]>
1 parent f7f09fb commit f030b24

25 files changed

+404
-70
lines changed

FprimeZephyrReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <zephyr/drivers/gpio.h>
1515

16-
static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
16+
static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios);
1717

1818
// Allows easy reference to objects in FPP/autocoder required namespaces
1919
using namespace ReferenceDeployment;

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,16 @@ findmnt
5252
```
5353

5454
Now you want to install the firmware to the board.
55+
```shell
56+
make install BOARD_DIR=[path-to-your-board]
57+
```
58+
59+
or
5560
```
5661
cp build-fprime-automatic-zephyr/zephyr/zephyr.uf2 [path-to-your-board]
5762
```
63+
to copy the uf2 if the make install isn't working
64+
5865

5966
Finally, run the fprime-gds.
6067
```shell
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "../../../boards/bronco_space/proves_flight_control_board_v5/Kconfig.defconfig"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
4+
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
5+
endif()
6+
7+
board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
8+
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")
9+
10+
# The adapter speed is expected to be set by interface configuration.
11+
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
12+
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
13+
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")
14+
15+
board_runner_args(jlink "--device=RP2350_M33_0")
16+
board_runner_args(uf2 "--board-id=RP2350")
17+
18+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
19+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
20+
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: proves_flight_control_board_v5c
3+
full_name: PROVES Flight Control Board v5c
4+
vendor: Bronco Space
5+
socs:
6+
- name: rp2350a
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2024 Andrew Featherstone
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
/* The build system assumes that there's a cpucluster-specific file.
10+
*
11+
* This file provides composition of the device tree:
12+
* 1. The common features of the SoC
13+
* 2. Core-specific configuration.
14+
* 3. Board-specific configuration.
15+
*/
16+
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
17+
#include <raspberrypi/rpi_pico/m33.dtsi>
18+
19+
#include "../proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
identifier: proves_flight_control_board_v5c/rp2350a/m33
2+
name: PROVES Flight Control Board v5c (RP2350, Cortex-M33)
3+
type: mcu
4+
arch: arm
5+
flash: 4096
6+
ram: 520
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
supported:
11+
- adc
12+
- clock
13+
- counter
14+
- dma
15+
- gpio
16+
- hwinfo
17+
- i2c
18+
- pwm
19+
- spi
20+
- uart
21+
- usbd
22+
- watchdog

0 commit comments

Comments
 (0)