Forgot to add board files to git

This commit is contained in:
Your Name
2026-10-08 13:30:02 +03:00
parent 35ebba09e0
commit 368c329da0
15 changed files with 587 additions and 1 deletions
-1
View File
@@ -1,4 +1,3 @@
build
tmp
boards
.vscode
@@ -0,0 +1,51 @@
if BOARD_SERVO2350
menu "USB sample options"
depends on USB_DEVICE_STACK_NEXT
config USBD_MANUFACTURER
string "USB device sample manufacturer string"
default "Zephyr Project"
help
USB device sample manufacturer string.
config USBD_PRODUCT
string "USB device sample product string"
default "USBD sample"
help
USB device sample product stringa.
config USBD_PID
hex "USB device sample Product ID"
default 0x0001
help
USB device sample Product ID.
config USBD_SELF_POWERED
bool "USB device sample Self-powered attribute"
default y
help
Set the Self-powered attribute in the sample configuration.
config USBD_REMOTE_WAKEUP
bool "USB device sample Remote Wakeup attribute"
help
Set the Remote Wakeup attribute in the sample configuration.
config USBD_MAX_POWER
int "USB device sample bMaxPower value"
default 125
range 0 250
help
bMaxPower value in the sample configuration in 2 mA units.
config USBD_20_EXTENSION_DESC
bool "Use default USB 2.0 Extension Descriptor"
depends on USBD_BOS_SUPPORT
help
Set bcdUSB value to 0201 and use default USB 2.0 Extension Descriptor.
endmenu
endif # BOARD_SERVO2350
@@ -0,0 +1,4 @@
config BOARD_SERVO2350
select SOC_RP2350B_HAZARD3 if BOARD_SERVO2350_RP2350B_HAZARD3
select SOC_RP2350B_M33 if BOARD_SERVO2350_RP2350B_M33
@@ -0,0 +1,20 @@
board_runner_args(openocd --cmd-pre-init "source [find interface/cmsis-dap.cfg]")
if(CONFIG_ARM)
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")
else()
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350-riscv.cfg]")
endif()
board_runner_args(probe-rs "--chip=RP235x")
# 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(uf2 "--board-id=RP2350")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/probe-rs.board.cmake)
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
@@ -0,0 +1,6 @@
board:
name: servo2350
full_name: Servo2350
vendor: arm
socs:
- name: rp2350b
@@ -0,0 +1,57 @@
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350b-pinctrl.h>
&pinctrl {
i2c0_default: i2c0_default {
group1 {
pinmux = <I2C0_SDA_P36>, // SDA
<I2C0_SCL_P37>; // SCL
input-enable;
input-schmitt-enable;
};
};
spi1_default: spi1_default {
group1 {
pinmux = <SPI1_CSN_P29>, // D29
<SPI1_SCK_P26>, // SPI_CLK
<SPI1_TX_P27>; // SPI_MOSI
};
group2 {
pinmux = <SPI1_RX_P28>; // SPI_MISO
input-enable;
};
};
pwm_default: pwm_default {
group1 {
pinmux = <PWM_0A_P0>, // SERVO 1
<PWM_0B_P1>, // SERVO 2
<PWM_1A_P2>, // SERVO 3
<PWM_1B_P3>, // SERVO 4
<PWM_2A_P4>, // SERVO 5
<PWM_2B_P5>, // SERVO 6
<PWM_3A_P6>, // SERVO 7
<PWM_3B_P7>, // SERVO 8
<PWM_4A_P8>, // SERVO 9
<PWM_4B_P9>, // SERVO 10
<PWM_5A_P10>, // SERVO 11
<PWM_5B_P11>, // SERVO 12
<PWM_6A_P12>, // SERVO 13
<PWM_6B_P13>, // SERVO 14
<PWM_7A_P14>, // SERVO 15
<PWM_7B_P15>, // SERVO 16
<PWM_8A_P32>, // SERVO 17
<PWM_8B_P33>; // SERVO 18
};
};
adc_default: adc_default {
group1 {
pinmux = <ADC_CH0_P40>, // MUX_COMMON
<ADC_CH1_P41>, // SERVO 17
<ADC_CH2_P42>; // SERVO 18
input-enable;
};
};
};
@@ -0,0 +1,356 @@
#include <freq.h>
#include <zephyr/dt-bindings/i2c/i2c.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "servo2350-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;
};
zephyr,user {
io-channels = <&adc 0>,
<&adc 1>,
<&adc 2>;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
label = "LED0";
};
led1: led_1 {
gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
label = "LED1";
};
};
imu_int1_pin {
compatible = "gpio-keys";
imu_int1: imu_int1 {
gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
label = "IMU_INT1";
};
imu_int2: imu_int2 {
gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
label = "IMU_INT2";
};
};
digital_inputs: digital_inputs {
compatible = "gpio-keys";
digital1: digital_1 {
gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_1";
};
digital2: digital_2 {
gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_2";
};
digital3: digital_3 {
gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_3";
};
digital4: digital_4 {
gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_4";
};
digital5: digital_5 {
gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_5";
};
digital6: digital_6 {
gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
label = "DIGITAL_6";
};
};
digital_outputs: digital_outputs {
compatible = "gpio-leds";
leg0_enable: leg0_enable {
gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
label = "LEG0_ENABLE";
};
leg1_enable: leg1_enable {
gpios = <&gpio0_hi 11 GPIO_ACTIVE_HIGH>;
label = "LEG1_ENABLE";
};
leg2_enable: leg2_enable {
gpios = <&gpio0_hi 12 GPIO_ACTIVE_HIGH>;
label = "LEG2_ENABLE";
};
leg3_enable: leg3_enable {
gpios = <&gpio0_hi 13 GPIO_ACTIVE_HIGH>;
label = "LEG3_ENABLE";
};
leg4_enable: leg4_enable {
gpios = <&gpio0_hi 14 GPIO_ACTIVE_HIGH>;
label = "LEG4_ENABLE";
};
leg5_enable: leg5_enable {
gpios = <&gpio0_hi 15 GPIO_ACTIVE_HIGH>;
label = "LEG5_ENABLE";
};
};
pwm_servos {
compatible = "pwm-leds";
servo1: servo_1 {
pwms = <&pwm 0 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_1";
};
servo2: servo_2 {
pwms = <&pwm 1 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_2";
};
servo3: servo_3 {
pwms = <&pwm 2 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_3";
};
servo4: servo_4 {
pwms = <&pwm 3 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_4";
};
servo5: servo_5 {
pwms = <&pwm 4 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_5";
};
servo6: servo_6 {
pwms = <&pwm 5 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_6";
};
servo7: servo_7 {
pwms = <&pwm 6 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_7";
};
servo8: servo_8 {
pwms = <&pwm 7 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_8";
};
servo9: servo_9 {
pwms = <&pwm 8 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_9";
};
servo10: servo_10 {
pwms = <&pwm 9 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_10";
};
servo11: servo_11 {
pwms = <&pwm 10 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_11";
};
servo12: servo_12 {
pwms = <&pwm 11 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_12";
};
servo13: servo_13 {
pwms = <&pwm 12 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_13";
};
servo14: servo_14 {
pwms = <&pwm 13 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_14";
};
servo15: servo_15 {
pwms = <&pwm 14 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_15";
};
servo16: servo_16 {
pwms = <&pwm 15 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_16";
};
servo17: servo_17 {
pwms = <&pwm 16 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_17";
};
servo18: servo_18 {
pwms = <&pwm 17 PWM_USEC(20000) PWM_POLARITY_NORMAL>;
label = "SERVO_18";
};
};
mux: mux {
compatible = "cd74hc4067";
status = "okay";
select-gpios = <&gpio0_hi 2 GPIO_ACTIVE_HIGH>,
<&gpio0_hi 3 GPIO_ACTIVE_HIGH>,
<&gpio0_hi 6 GPIO_ACTIVE_HIGH>,
<&gpio0_hi 7 GPIO_ACTIVE_HIGH>;
};
aliases {
watchdog0 = &wdt0;
led0 = &led0;
led1 = &led1;
imu = &imu;
imu-int1 = &imu_int1;
imu-int2 = &imu_int2;
digital1 = &digital1;
digital2 = &digital2;
digital3 = &digital3;
digital4 = &digital4;
digital5 = &digital5;
digital6 = &digital6;
leg0-enable = &leg0_enable;
leg1-enable = &leg1_enable;
leg2-enable = &leg2_enable;
leg3-enable = &leg3_enable;
leg4-enable = &leg4_enable;
leg5-enable = &leg5_enable;
servo1 = &servo1;
servo2 = &servo2;
servo3 = &servo3;
servo4 = &servo4;
servo5 = &servo5;
servo6 = &servo6;
servo7 = &servo7;
servo8 = &servo8;
servo9 = &servo9;
servo10 = &servo10;
servo11 = &servo11;
servo12 = &servo12;
servo13 = &servo13;
servo14 = &servo14;
servo15 = &servo15;
servo16 = &servo16;
servo17 = &servo17;
servo18 = &servo18;
mux = &mux;
};
};
&flash0 {
/* W25Q16JVUXIQ_TR: 16M-bit (2MB) NOR Flash */
reg = <0x10000000 DT_SIZE_M(2)>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Code partition: 256KB for application code (starts at beginning of flash) */
code_partition: partition@0 {
label = "code";
reg = <0x00000000 DT_SIZE_K(256)>;
read-only;
};
/* Settings partition: 64KB for settings data */
settings_partition: partition@40000 {
label = "settings";
reg = <0x00040000 DT_SIZE_K(64)>;
};
/* Data partition: 1728KB for data storage (largest partition) */
data_partition: partition@50000 {
label = "data";
reg = <0x00050000 DT_SIZE_K(1728)>;
};
};
};
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "USB_CDC";
};
};
gpio0_lo: &gpio0 {
status = "okay";
};
&gpio0_hi {
status = "okay";
};
&i2c0 {
pinctrl-0 = <&i2c0_default>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
imu: icm45686@68 {
compatible = "invensense,icm42688";
reg = <0x68>;
status = "disabled";
int1-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
int2-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
accel-pwr-mode = <3>;
accel-ord = <9>;
accel-fs = <16>;
accel-lpf = <0>;
gyro-pwr-mode = <0>; /* turn off */
gyro-ord = <9>;
gyro-fs = <2000>;
};
};
&spi1 {
clock-frequency = <DT_FREQ_M(8)>;
pinctrl-0 = <&spi1_default>;
pinctrl-names = "default";
status = "disabled";
};
&adc {
pinctrl-0 = <&adc_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
adc0: channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
adc1: channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
adc2: channel@2 {
reg = <2>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};
&pwm {
status = "okay";
pinctrl-0 = <&pwm_default>;
pinctrl-names = "default";
divider-int-0 = <64>;
};
&timer0 {
status = "okay";
};
@@ -0,0 +1,12 @@
/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/rp2350b.dtsi>
#include <riscv/raspberrypi/hazard3.dtsi>
#include "servo2350.dtsi"
@@ -0,0 +1,20 @@
identifier: servo2350/rp2350b/hazard3
name: Servo2350 (Hazard3)
type: mcu
arch: riscv
flash: 16384
ram: 8192
toolchain:
- zephyr
supported:
- adc
- clock
- counter
- dma
- gpio
- hwinfo
- i2c
- pwm
- spi
- usbd
- uart
@@ -0,0 +1,10 @@
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
@@ -0,0 +1,12 @@
/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/rp2350b.dtsi>
#include <raspberrypi/rpi_pico/m33.dtsi>
#include "servo2350.dtsi"
@@ -0,0 +1,21 @@
identifier: servo2350/rp2350b/m33
name: Servo2350 (Cortex-M33)
type: mcu
arch: arm
flash: 16384
ram: 8192
toolchain:
- zephyr
- gnuarmemb
supported:
- adc
- clock
- counter
- dma
- gpio
- hwinfo
- i2c
- pwm
- spi
- usbd
- uart
@@ -0,0 +1,10 @@
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
@@ -0,0 +1,8 @@
# 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
}
}