-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add initial support for the Raspberry Pi Pico 2 #77368
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
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f92cc94
drivers: clock_control: rpi_pico: Add support for the RP2350.
ajf58 6c2e435
soc: rp2350: Add initial support for the Raspberry Pi RP2350
ajf58 ee8d1f7
drivers: hwinfo: rp2350: Add initial support for RP2350
ajf58 c353720
drivers: clock_control: rpi_pico: Start tick generators for timers
ajf58 35c4cfc
drivers: watchdog: rpi_pico: Add support for RP2350
soburi 24e57fa
drivers: counter: rpi_pico_timer: Add support for RP2350
ajf58 073139a
pinctrl: raspberrypi: rp2350: Add support for RP2350X
ajf58 ba1b5e7
rp2350: Fix for storing larger pinctrl alt func
petejohanson fb5048f
boards: Add initial support for the Raspberry Pi Pico 2
ajf58 2cc9d23
UF2: Enable support for Raspberry Pi RP2350
oscardagrach 443e397
samples: rpi_pico2: Add ADC-related samples for rpi_pico2
ajf58 830b4f4
tests: drivers: adc_api: Add support for the Raspberry Pi Pico 2
ajf58 0530c53
doc: rpi_pico2: Document Raspberry Pi Pico 2 and related changes
ajf58 9a41e3e
boards: raspberrypi: rpi_pico2: Add OpenOCD runner configuration
ajf58 03d4037
tests: gpio_api_1pin: rpi_pico2: Support using external pulldowns
ajf58 b32a31e
rpi_pico2: rp2350: Add PIO support and extend samples
c63ca09
rpi_pico2: rp2350: Add DMA support
ajf58 e31b959
drivers: dma: rpi_pico: Refactor DMA files for Raspberry Pi SoCs
ajf58 d3e0359
tests: drivers: dma: Increase test coverage for RP2350A
ajf58 c15aba4
samples: drivers: led: pwm: Add rpi_pico2 board
ajf58 8c6d543
rp2350: Define and implement a cpucluster of Cortex-M33s
ajf58 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2021 Yonatan Schachter | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* Pico and Pico 2 boards (but not Pico W) have a common LED placement. */ | ||
/ { | ||
leds { | ||
compatible = "gpio-leds"; | ||
led0: led_0 { | ||
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; | ||
label = "LED"; | ||
}; | ||
}; | ||
|
||
pwm_leds { | ||
compatible = "pwm-leds"; | ||
status = "disabled"; | ||
pwm_led0: pwm_led_0 { | ||
pwms = <&pwm 9 PWM_MSEC(20) PWM_POLARITY_NORMAL>; | ||
label = "PWM_LED"; | ||
}; | ||
}; | ||
|
||
aliases { | ||
led0 = &led0; | ||
pwm-led0 = &pwm_led0; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2021, Yonatan Schachter | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* The Pico and Pico 2 are pin compatible. */ | ||
&pinctrl { | ||
uart0_default: uart0_default { | ||
group1 { | ||
pinmux = <UART0_TX_P0>; | ||
}; | ||
group2 { | ||
pinmux = <UART0_RX_P1>; | ||
input-enable; | ||
}; | ||
}; | ||
|
||
i2c0_default: i2c0_default { | ||
group1 { | ||
pinmux = <I2C0_SDA_P4>, <I2C0_SCL_P5>; | ||
input-enable; | ||
input-schmitt-enable; | ||
}; | ||
}; | ||
|
||
i2c1_default: i2c1_default { | ||
group1 { | ||
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>; | ||
input-enable; | ||
input-schmitt-enable; | ||
}; | ||
}; | ||
|
||
spi0_default: spi0_default { | ||
group1 { | ||
pinmux = <SPI0_CSN_P17>, <SPI0_SCK_P18>, <SPI0_TX_P19>; | ||
}; | ||
group2 { | ||
pinmux = <SPI0_RX_P16>; | ||
input-enable; | ||
}; | ||
}; | ||
|
||
pwm_ch4b_default: pwm_ch4b_default { | ||
group1 { | ||
pinmux = <PWM_4B_P25>; | ||
}; | ||
}; | ||
|
||
adc_default: adc_default { | ||
group1 { | ||
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>; | ||
input-enable; | ||
}; | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024 Andrew Featherstone | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if BOARD_RPI_PICO2 | ||
|
||
config USB_SELF_POWERED | ||
default n | ||
|
||
endif # BOARD_RPI_PICO2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (c) 2024 Andrew Featherstone | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config BOARD_RPI_PICO2 | ||
select SOC_RP2350A_M33 if BOARD_RPI_PICO2_RP2350A_M33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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(uf2 "--board-id=RP2350") | ||
|
||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) | ||
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
board: | ||
name: rpi_pico2 | ||
ajf58 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
full_name: Raspberry Pi Pico 2 | ||
vendor: raspberrypi | ||
socs: | ||
- name: rp2350a |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.. zephyr:board:: rpi_pico2 | ||
|
||
Overview | ||
******** | ||
|
||
The Raspberry Pi Pico 2 is the second-generation product in the Raspberry Pi | ||
Pico family. From the `Raspberry Pi website <https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html>`_ is referred to as Pico 2. | ||
|
||
There are many limitations of the board currently. Including but not limited to: | ||
- The Zephyr build only supports configuring the RP2350A with the Cortex-M33 cores. | ||
- As with the Pico 1, there's no support for running any code on the second core. | ||
|
||
Hardware | ||
******** | ||
|
||
- Dual Cortex-M33 or Hazard3 processors at up to 150MHz | ||
- 520KB of SRAM, and 4MB of on-board flash memory | ||
- USB 1.1 with device and host support | ||
- Low-power sleep and dormant modes | ||
- Drag-and-drop programming using mass storage over USB | ||
- 26 multi-function GPIO pins including 3 that can be used for ADC | ||
- 2 SPI, 2 I2C, 2 UART, 3 12-bit 500ksps Analogue to Digital - Converter (ADC), 24 controllable PWM channels | ||
yonsch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 2 Timer with 4 alarms, 1 AON Timer | ||
- Temperature sensor | ||
- 3 Programmable IO (PIO) blocks, 12 state machines total for custom peripheral support | ||
|
||
- Flexible, user-programmable high-speed IO | ||
- Can emulate interfaces such as SD Card and VGA | ||
|
||
Supported Features | ||
================== | ||
|
||
The ``rpi_pico2/rp2350a/m33`` board target supports the following | ||
hardware features: | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Peripheral | ||
- Kconfig option | ||
- Devicetree compatible | ||
* - NVIC | ||
- N/A | ||
- :dtcompatible:`arm,v8m-nvic` | ||
* - ADC | ||
- :kconfig:option:`CONFIG_ADC` | ||
- :dtcompatible:`raspberrypi,pico-adc` | ||
* - Clock controller | ||
- :kconfig:option:`CONFIG_CLOCK_CONTROL` | ||
- :dtcompatible:`raspberrypi,pico-clock-controller` | ||
* - Counter | ||
- :kconfig:option:`CONFIG_COUNTER` | ||
- :dtcompatible:`raspberrypi,pico-timer` | ||
* - DMA | ||
- :kconfig:option:`CONFIG_DMA` | ||
- :dtcompatible:`raspberrypi,pico-dma` | ||
* - GPIO | ||
- :kconfig:option:`CONFIG_GPIO` | ||
- :dtcompatible:`raspberrypi,pico-gpio` | ||
* - HWINFO | ||
- :kconfig:option:`CONFIG_HWINFO` | ||
- N/A | ||
* - I2C | ||
- :kconfig:option:`CONFIG_I2C` | ||
- :dtcompatible:`snps,designware-i2c` | ||
* - PWM | ||
- :kconfig:option:`CONFIG_PWM` | ||
- :dtcompatible:`raspberrypi,pico-pwm` | ||
* - SPI | ||
- :kconfig:option:`CONFIG_SPI` | ||
- :dtcompatible:`raspberrypi,pico-spi` | ||
* - UART | ||
- :kconfig:option:`CONFIG_SERIAL` | ||
- :dtcompatible:`raspberrypi,pico-uart` | ||
* - UART (PIO) | ||
- :kconfig:option:`CONFIG_SERIAL` | ||
- :dtcompatible:`raspberrypi,pico-uart-pio` | ||
|
||
Connections and IOs | ||
=================== | ||
|
||
The default pin mapping is unchanged from the Pico 1 (see :ref:`rpi_pico_pin_mapping`). | ||
|
||
Programming and Debugging | ||
************************* | ||
|
||
As with the Pico 1, the SWD interface can be used to program and debug the | ||
device, e.g. using OpenOCD with the `Raspberry Pi Debug Probe <https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html>`_ . | ||
|
||
References | ||
********** | ||
|
||
.. target-notes:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright (c) 2024, Andrew Featherstone | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350a-pinctrl.h> | ||
|
||
#include "../common/rpi_pico-pinctrl-common.dtsi" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.