-
Notifications
You must be signed in to change notification settings - Fork 4
add v4 board def #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add v4 board def #22
Changes from 6 commits
f9529ae
84cf283
da9524d
184ccce
65fcc8f
a290b04
e27336f
ab06b59
bf9ce19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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,132 @@ | ||||||||||||||||
| #include <freq.h> | ||||||||||||||||
|
|
||||||||||||||||
| #include <zephyr/dt-bindings/i2c/i2c.h> | ||||||||||||||||
| #include <zephyr/dt-bindings/pwm/pwm.h> | ||||||||||||||||
|
|
||||||||||||||||
| #include "proves_flight_control_board_v4-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>; | ||||||||||||||||
|
||||||||||||||||
| reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; | |
| reset-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no onboard INA219 on the V4 Flight Controller Board.
| 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_v4/Kconfig.defconfig" |
| 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) |
| 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,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/rp2040.dtsi> | ||
|
|
||
|
|
||
| #include "../proves_flight_control_board_v4/proves_flight_control_board_v4.dtsi" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| identifier: proves_flight_control_board_v4b/rp2040/m0p | ||
|
||
| 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,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 v4b" | ||
| 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 |
|---|---|---|
| @@ -1 +0,0 @@ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/m0p | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we reached the conclusion last week that we would only be using the DIO0 part of the library for now. On V4b boards this is the pin location: