Skip to content
Closed
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
@@ -0,0 +1,12 @@
config SOC_RP2040
bool "Enable Cortex-M0+ core"
default y

config USB_SELF_POWERED
default n

config USB_CDC_ACM_LOG_LEVEL
default 0

config USB_DEVICE_LOG_LEVEL
default 1
23 changes: 23 additions & 0 deletions boards/bronco_space/proves_flight_control_board_v4b/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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]")



# 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(openocd --cmd-pre-init "source [find target/rp2040.cfg]")
board_runner_args(jlink "--device=RP2040_M0_0")
board_runner_args(uf2 "--board-id=RP2040")

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_v4b/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: proves_flight_control_board_v4b
full_name: PROVES Flight Control Board v4b
vendor: Bronco Space
socs:
- name: rp2040
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2040-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,143 @@
/*
* 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/rp2040.dtsi>


#include <freq.h>

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

#include "proves_flight_control_board_v4b_rp2040-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;
};
};
};

&timer {
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 23 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
reset-gpios = <&gpio0 20 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";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
identifier: proves_flight_control_board_v4b/rp2040
name: PROVES Flight Control Board v4b (RP2040, Cortex-M0+)
type: mcu
arch: arm
flash: 4096
ram: 264
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,26 @@
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 v4b"
CONFIG_USB_DEVICE_VID=0x1209

# Sensors
CONFIG_LSM6DSO=y
CONFIG_LSM6DSO_ENABLE_TEMP=y
CONFIG_LIS2MDL=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
}
}
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ default_toolchain: zephyr
default_cmake_options: FPRIME_ENABLE_FRAMEWORK_UTS=OFF
FPRIME_ENABLE_AUTOCODER_UTS=OFF
BOARD_ROOT=.
BOARD=proves_flight_control_board_v5c/rp2350a/m33
BOARD=proves_flight_control_board_v4b/rp2040
Loading