Skip to content
Open
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
17 changes: 2 additions & 15 deletions .murdock
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,8 @@
#export APPS="examples/basic/hello-world tests/unittests"

QUICKBUILD_BOARDS="
adafruit-itsybitsy-m4
atmega256rfr2-xpro
esp32-wroom-32
esp32s3-devkit
frdm-k64f
hifive1b
msb-430
msba2
native32
native64
nrf52840dk
qn9080dk
samr21-xpro
stk3200
stm32f429i-disc1"
rpi-pico-2-riscv
rpi-pico-2-arm"

# this configures boards that are available via pifleet
case "${CI_MURDOCK_PROJECT}" in
Expand Down
3 changes: 3 additions & 0 deletions boards/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ DIRS += $(RIOTBOARD)/common/init
ifneq (,$(filter boards_common_adafruit-nrf52-bootloader,$(USEMODULE)))
DIRS += $(RIOTBOARD)/common/adafruit-nrf52-bootloader
endif
ifneq (,$(filter boards_common_rpi_pico_2,$(USEMODULE)))
DIRS += $(RIOTBOARD)/common/rpi-pico-2
endif
ifneq (,$(filter boards_common_seeedstudio-xiao-nrf52840,$(USEMODULE)))
DIRS += $(RIOTBOARD)/common/seeedstudio-xiao-nrf52840
endif
Expand Down
3 changes: 3 additions & 0 deletions boards/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# SORT THIS ALPHABETICALLY BY COMMON BOARD NAME!
ifneq (,$(filter boards_common_rpi_pico_2,$(USEMODULE)))
include $(RIOTBOARD)/common/rpi-pico-2/Makefile.features
endif
ifneq (,$(filter boards_common_seeedstudio-xiao-nrf52840,$(USEMODULE)))
include $(RIOTBOARD)/common/seeedstudio-xiao-nrf52840/Makefile.features
endif
3 changes: 3 additions & 0 deletions boards/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
ifneq (,$(filter boards_common_adafruit-nrf52-bootloader,$(USEMODULE)))
include $(RIOTBOARD)/common/adafruit-nrf52-bootloader/Makefile.include
endif
ifneq (,$(filter boards_common_rpi_pico_2,$(USEMODULE)))
include $(RIOTBOARD)/common/rpi-pico-2/Makefile.include
endif
ifneq (,$(filter boards_common_seeedstudio-xiao-nrf52840,$(USEMODULE)))
include $(RIOTBOARD)/common/seeedstudio-xiao-nrf52840/Makefile.include
endif
3 changes: 3 additions & 0 deletions boards/common/rpi-pico-2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = boards_common_rpi_pico_2

include $(RIOTBASE)/Makefile.base
Empty file.
2 changes: 2 additions & 0 deletions boards/common/rpi-pico-2/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# add the common header files to the include path
INCLUDES += -I$(RIOTBOARD)/common/rpi-pico-2/include
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

/**
* @ingroup boards_rpi_pico_2
* @ingroup boards_rpi_pico_2_arm
* @{
*
* @file
Expand All @@ -16,11 +16,10 @@
* @author Tom Hert <[email protected]>
*/

#include "RP2350.h"
#include "cpu.h"
#include "cpu_conf.h"
#include "periph_conf.h"
#include "periph_cpu.h"

#include "periph/gpio.h"

/** GPIO Pin ID for the onboard LED */
#define LED0_PIN_ID 25u
Expand Down
62 changes: 62 additions & 0 deletions boards/common/rpi-pico-2/include/periph_conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* SPDX-FileCopyrightText: 2025 Tom Hert <[email protected]>
* SPDX-FileCopyrightText: 2025 HAW Hamburg
* SPDX-License-Identifier: LGPL-2.1-only
*/

#pragma once

/**
* @ingroup boards_rpi_pico_2_arm
* @{
*
* @file
* @brief Board periph definitions for the Raspberry Pi Pico 2
*
* @author Tom Hert <[email protected]>
*/

#include <stdint.h>

#include "RP2350.h"
#include "periph_cpu.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Configuration details for an UART interface
*/
typedef struct {
UART0_Type *dev; /**< Base address of the I/O registers of the device */
gpio_t rx_pin; /**< GPIO pin to use for RX */
gpio_t tx_pin; /**< GPIO pin to use for TX */
IRQn_Type irqn; /**< IRQ number of the UART interface */
} uart_conf_t;

static const uart_conf_t uart_config[] = {
{
.dev = UART0,
.rx_pin = GPIO_PIN(0, 1),
.tx_pin = GPIO_PIN(0, 0),
.irqn = UART0_IRQ_IRQn
},
{
.dev = UART1,
.rx_pin = GPIO_PIN(0, 9),
.tx_pin = GPIO_PIN(0, 8),
.irqn = UART1_IRQ_IRQn
}
};

#define UART_0_ISR (isr_uart0)
#define UART_1_ISR (isr_uart1)

#define UART_NUMOF ARRAY_SIZE(uart_config)

#ifdef __cplusplus
}
#endif

/** @} */
6 changes: 3 additions & 3 deletions boards/rpi-pico-2/Kconfig → boards/rpi-pico-2-arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# SPDX-License-Identifier: LGPL-2.1-only

config BOARD
default "rpi-pico-2" if BOARD_RPI_PICO_2
default "rpi-pico-2-arm" if BOARD_RPI_PICO_2_ARM

config BOARD_RPI_PICO_2
config BOARD_RPI_PICO_2_ARM
bool
default y
select CPU_MODEL_RP2350
select CPU_MODEL_RP2350_ARM
File renamed without changes.
1 change: 1 addition & 0 deletions boards/rpi-pico-2-arm/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
USEMODULE += boards_common_rpi_pico_2
1 change: 1 addition & 0 deletions boards/rpi-pico-2-arm/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CPU := rp2350_arm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CPU_MODEL := RP2350
CPU_MODEL := RP2350_ARM
PORT_LINUX ?= /dev/ttyACM0

# JLink isnt tested yet on RP2350
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
echo "Make sure to use the Raspberry Pi OpenOCD version!"
echo "For further details see Appendix A Building OpenOCD:"
echo "https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf"
source [find target/rp2350.cfg]
set USE_CORE 0
set USE_CORE SMP
set RESCUE 1
$_TARGETNAME_0 configure -rtos auto
adapter speed 5000
rp2350.dap.core1 cortex_m reset_config sysresetreq
rp2350.dap.core0 cortex_m reset_config sysresetreq
5 changes: 5 additions & 0 deletions boards/rpi-pico-2-arm/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@defgroup boards_rpi_pico_2_arm Raspberry Pi Pico 2
@ingroup boards
@brief Support for the RP2350 based Raspberry Pi Pico board

See @ref boards_rpi_pico_2_riscv for further information.
11 changes: 11 additions & 0 deletions boards/rpi-pico-2-riscv/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2025 Tom Hert <[email protected]>
# SPDX-FileCopyrightText: 2025 HAW Hamburg
# SPDX-License-Identifier: LGPL-2.1-only

config BOARD
default "rpi-pico-2-riscv" if BOARD_RPI_PICO_2_RISCV

config BOARD_RPI_PICO_2_RISV
bool
default y
select CPU_MODEL_RP2350_RISCV
3 changes: 3 additions & 0 deletions boards/rpi-pico-2-riscv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = board

include $(RIOTBASE)/Makefile.base
1 change: 1 addition & 0 deletions boards/rpi-pico-2-riscv/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
USEMODULE += boards_common_rpi_pico_2
1 change: 1 addition & 0 deletions boards/rpi-pico-2-riscv/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CPU := rp2350_riscv
7 changes: 7 additions & 0 deletions boards/rpi-pico-2-riscv/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CPU_MODEL := RP2350_RISCV
PORT_LINUX ?= /dev/ttyACM0

# JLink isnt tested yet on RP2350
# ifeq ($(PROGRAMMER),jlink)
# JLINK_DEVICE = RP2350_M33_0
# endif
8 changes: 8 additions & 0 deletions boards/rpi-pico-2-riscv/dist/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Make sure to use the Raspberry Pi OpenOCD version!"
echo "For further details see Appendix A Building OpenOCD:"
echo "https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf"
source [find target/rp2350-riscv.cfg]
set USE_CORE SMP
set RESCUE 1
$_TARGETNAME_0 configure -rtos auto
adapter speed 5000
43 changes: 33 additions & 10 deletions boards/rpi-pico-2/doc.md → boards/rpi-pico-2-riscv/doc.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@defgroup boards_rpi_pico_2 Raspberry Pi Pico 2
@defgroup boards_rpi_pico_2_riscv Raspberry Pi Pico 2
@ingroup boards
@brief Support for the RP2350 based Raspberry Pi Pico board
@brief Support for the RP2350 RISCV based Raspberry Pi Pico board

@warning The support for the Raspberry Pi Pico 2 is still in a very early stage!
See [Known Issues](#rpi_pico_2_known_issues).
See [Known Issues](#rpi_pico_2_riscv_known_issues).

## Overview

Expand Down Expand Up @@ -55,6 +55,12 @@ If you are using picotool, you need to hold the bootselect button
your computer via USB. This will put the board into bootloader mode,
allowing you to flash it.

Generally while Picotool is the easiest way to flash the board,
it does not allow for debugging using GDB.

It does tend to be more reliable than OpenOCD though,
especially when switching between RISC-V and ARM cores.

### Flashing using OpenOCD

If you have two Raspberry Pi Pico boards,
Expand All @@ -76,21 +82,39 @@ To do this, you need to connect the board to your computer
and use the following command:

```bash
PROGRAMMER=openocd BOARD=rpi-pico-2 make flash
PROGRAMMER=openocd BOARD=rpi-pico-2-riscv make flash
```

or, if you want to use the CortexM:

```bash
PROGRAMMER=openocd BOARD=rpi-pico-2-arm make flash
```

You can then debug your application using GDB with the following command:

```bash
PROGRAMMER=openocd BOARD=rpi-pico-2 make debug
PROGRAMMER=openocd BOARD=rpi-pico-2-riscv make debug
```

or, if you want to use the CortexM:

```bash
PROGRAMMER=openocd BOARD=rpi-pico-2-arm make debug
```

### Flashing using Picotool

Simply connect the board to your computer via USB and use the following command:

```bash
BOARD=rpi-pico-2 make flash
BOARD=rpi-pico-2-riscv make flash
```

or, if you want to use the CortexM:

```bash
BOARD=rpi-pico-2-arm make flash
```

This is the default method for flashing the Raspberry Pi Pico 2.
Expand All @@ -100,17 +124,16 @@ However, it does not allow for debugging using GDB.
RIOT will download and install the Picotool locally in the RIOT folder.
This process will take some minutes to complete.

## Known Issues {#rpi_pico_2_known_issues}
## Known Issues {#rpi_pico_2_riscv_known_issues}

Currently RP2350 support is rather minimal,
as such peripheral support is extremely limited.
The following peripherals are supported:

- XH3IRQ RISC-V Interrupt Controller (CortexM Interrupts also work)
- GPIO
- Non-configurable write-only UART (UART0 using Pin 0 and 1)
- UART
- The UART Baudrate is set to 115200.
- UART does not work via USB, you need to connect it directly to the GPIO pins.

More peripherals will be added in the future.
It should also be noted that we currently only support the Cortex M33 cores,
not the RISC-V Hazard cores.
1 change: 0 additions & 1 deletion boards/rpi-pico-2/Makefile.features

This file was deleted.

20 changes: 0 additions & 20 deletions boards/rpi-pico-2/include/periph_conf.h

This file was deleted.

2 changes: 1 addition & 1 deletion cpu/riscv_common/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
DIRS = periph
DIRS += periph

include $(RIOTBASE)/Makefile.base
Loading
Loading