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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <zephyr/drivers/gpio.h>

static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios);

// Allows easy reference to objects in FPP/autocoder required namespaces
using namespace ReferenceDeployment;
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@ findmnt
```

Now you want to install the firmware to the board.
```shell
make install BOARD_DIR=[path-to-your-board]
```

or
```
cp build-fprime-automatic-zephyr/zephyr/zephyr.uf2 [path-to-your-board]
```
to copy the uf2 if the make install isn't working


Finally, run the fprime-gds.
```shell
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
config SOC_RP2350A_M33
bool "Enable Arm cores"
default y

config USB_SELF_POWERED
default n

config USB_CDC_ACM_LOG_LEVEL
default 0

config USB_DEVICE_LOG_LEVEL
default 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350a-pinctrl.h>

&pinctrl {
spi1_default: spi1_default {
group1 {
pinmux = <SPI1_SCK_P10>, <SPI1_TX_P11>;
};

group2 {
pinmux = <SPI1_RX_P8>;
input-enable;
};
};
i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SCL_P3>, <I2C1_SDA_P2>;
input-enable;
};
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#include <freq.h>

#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/pwm/pwm.h>

#include "proves_flight_control_board_v5-pinctrl.dtsi"

/ {
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
zephyr,code-partition = &code_partition;
};

aliases {
watchdog0 = &wdt0;
};

leds {
compatible = "gpio-leds";
led0: led0 {
gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
label = "User LED GPIO24";
};
};
};

zephyr_udc0: &usbd {
status = "okay";
};

&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

&flash0 {
reg = <0x10000000 DT_SIZE_M(4)>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

/* Reserved memory for an image definition block. The block is much
* smaller than 256 bytes, but in practice the linker places the vector
* table at a much larger alignment offset.
*/
image_def: partition@0 {
label = "image_def";
reg = <0x00000000 0x100>;
read-only;
};

/*
* Usable flash. Starts at 0x100, after the image definition block.
* The partition size is 4MB minus the 0x100 bytes taken by the
* image definition.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(4) - 0x100)>;
read-only;
};
};
};

&timer0 {
status = "okay";
};

&wdt0 {
status = "okay";
};

&gpio0 {
status = "okay";
};

&spi1 {
status = "okay";
cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi1_default>;
pinctrl-names = "default";

lora0: sx1276@0 {
compatible = "semtech,sx1276";
reg = <0>;
spi-max-frequency = <125000>;
dio-gpios = <&gpio0 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>,<&gpio0 12 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
power-amplifier-output = "pa-boost";
label = "HOPE_RF";
};
};

&i2c1 {
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-names = "default";
clock-frequency = <100000>;

lsm6dso0: lsm6dso0@6b {
compatible = "st,lsm6dso";
reg = <0x6b>;
label = "LSM6DSO";
};

lis2mdl: lis2mdl@1e {
compatible = "st,lis2mdl";
reg = <0x1e>;
label = "LIS2MDL";
};
rv3028: rv3028@52 {
compatible = "microcrystal,rv3028";
reg = <0x52>;
int-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
backup-switch-mode = "level";
label = "RV3028";
};
ina219: ina219@40 {
compatible = "ti,ina219";
reg = <0x40>;
shunt-milliohm = <2>;
lsb-microamp = <100>;
label = "INA219";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "../../../boards/bronco_space/proves_flight_control_board_v5/Kconfig.defconfig"
20 changes: 20 additions & 0 deletions boards/bronco_space/proves_flight_control_board_v5c/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: Apache-2.0

if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
endif()

board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")

# The adapter speed is expected to be set by interface configuration.
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")

board_runner_args(jlink "--device=RP2350_M33_0")
board_runner_args(uf2 "--board-id=RP2350")

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
6 changes: 6 additions & 0 deletions boards/bronco_space/proves_flight_control_board_v5c/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: proves_flight_control_board_v5c
full_name: PROVES Flight Control Board v5c
vendor: Bronco Space
socs:
- name: rp2350a
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 Andrew Featherstone
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

/* The build system assumes that there's a cpucluster-specific file.
*
* This file provides composition of the device tree:
* 1. The common features of the SoC
* 2. Core-specific configuration.
* 3. Board-specific configuration.
*/
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
#include <raspberrypi/rpi_pico/m33.dtsi>

#include "../proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
identifier: proves_flight_control_board_v5c/rp2350a/m33
name: PROVES Flight Control Board v5c (RP2350, Cortex-M33)
type: mcu
arch: arm
flash: 4096
ram: 520
toolchain:
- zephyr
- gnuarmemb
supported:
- adc
- clock
- counter
- dma
- gpio
- hwinfo
- i2c
- pwm
- spi
- uart
- usbd
- watchdog
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CONFIG_BUILD_OUTPUT_HEX=y
CONFIG_BUILD_OUTPUT_UF2=y
CONFIG_CLOCK_CONTROL=y
CONFIG_CONSOLE=y
CONFIG_GPIO=y
CONFIG_RESET=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="PROVES Flight Control Board v5c"
CONFIG_USB_DEVICE_VID=0x0028

# Sensors
CONFIG_LSM6DSO=y
CONFIG_LSM6DSO_ENABLE_TEMP=y
CONFIG_LIS2MDL=y
CONFIG_INA219=y

# Radio
CONFIG_LORA=y
CONFIG_LORA_SX127X=y

# RTC
CONFIG_RTC=y
CONFIG_RTC_RV3028=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2024 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

# Checking and set 'adapter speed'.
# Set the adaptor speed, if unset, and given as an argument.
proc set_adapter_speed_if_not_set { speed } {
puts "checking adapter speed..."
if { [catch {adapter speed} ret] } {
adapter speed $speed
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config BOARD_PROVES_FLIGHT_CONTROL_BOARD_V5D
bool "PROVES Flight Control Board v5d"
default y

source "../../../boards/bronco_space/proves_flight_control_board_v5/Kconfig.defconfig"
20 changes: 20 additions & 0 deletions boards/bronco_space/proves_flight_control_board_v5d/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: Apache-2.0

if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
endif()

board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")

# The adapter speed is expected to be set by interface configuration.
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")

board_runner_args(jlink "--device=RP2350_M33_0")
board_runner_args(uf2 "--board-id=RP2350")

include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
6 changes: 6 additions & 0 deletions boards/bronco_space/proves_flight_control_board_v5d/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: proves_flight_control_board_v5d
full_name: PROVES Flight Control Board v5d
vendor: Bronco Space
socs:
- name: rp2350a
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Andrew Featherstone
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;

/* The build system assumes that there's a cpucluster-specific file.
*
* This file provides composition of the device tree:
* 1. The common features of the SoC
* 2. Core-specific configuration.
* 3. Board-specific configuration.
*/
#include <raspberrypi/rpi_pico/rp2350a.dtsi>
#include <raspberrypi/rpi_pico/m33.dtsi>

#include "../proves_flight_control_board_v5/proves_flight_control_board_v5.dtsi"

&led0 {
gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
label = "User LED GPIO23";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
identifier: proves_flight_control_board_v5d/rp2350a/m33
name: PROVES Flight Control Board v5d (RP2350, Cortex-M33)
type: mcu
arch: arm
flash: 4096
ram: 520
toolchain:
- zephyr
- gnuarmemb
supported:
- adc
- clock
- counter
- dma
- gpio
- hwinfo
- i2c
- pwm
- spi
- uart
- usbd
- watchdog
Loading