Skip to content
Merged
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
@@ -1,5 +1,5 @@
# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info.
name = "Raspberry Pi Foundation Raspberry Pi Pico 2"
name = "Raspberry Pi Foundation Raspberry Pi Pico 2 W"

[modules]
__future__ = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CIRCUITPY_BUILD_EXTENSIONS = ["hex", "uf2"]
BLOBS=["hal_infineon"]
NAME="Raspberry Pi Pico 2 W"

# Non-Zephyr build of the same board; nvm and CIRCUITPY must sit where it puts them.
counterpart = "raspberrypi/raspberry_pi_pico2_w"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is autogenerated when a board is built. Do not edit. Do commit it to git. Other scripts use its info.
name = "Raspberry Pi Foundation Raspberry Pi Pico"
name = "Raspberry Pi Foundation Raspberry Pi Pico W"

[modules]
__future__ = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CIRCUITPY_BUILD_EXTENSIONS = ["hex", "uf2"]
BLOBS=["hal_infineon"]
NAME="Raspberry Pi Pico W"

# Non-Zephyr build of the same board; nvm and CIRCUITPY must sit where it puts them.
counterpart = "raspberrypi/raspberry_pi_pico_w"
2 changes: 1 addition & 1 deletion ports/zephyr-cp/common-hal/microcontroller/Processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#pragma once

#if CONFIG_HWINFO_NRF
#if CONFIG_HWINFO_NRF || CONFIG_HWINFO_RPI_PICO
#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 8
#else
// Extra long and the remainder will be left empty. Will print out the actual length.
Expand Down
16 changes: 16 additions & 0 deletions ports/zephyr-cp/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
#include <zephyr/dfu/mcuboot.h>
#endif

#if defined(CONFIG_SOC_FAMILY_RPI_PICO)
#include <hardware/structs/psm.h>
#include <hardware/structs/watchdog.h>
#endif

#if defined(CONFIG_TRACING_PERFETTO) && defined(CONFIG_BOARD_NATIVE_SIM)
#include "perfetto_encoder.h"
#include <zephyr/sys/mem_stats.h>
Expand Down Expand Up @@ -254,6 +259,17 @@ void reset_cpu(void) {
cp_retained_save();
#endif

#if defined(CONFIG_SOC_FAMILY_RPI_PICO)
// On RP2 the Arm system reset leaves the USB controller running, so the
// host never sees the board go away. Reset the whole chip through the
// watchdog instead, as pico-sdk's watchdog_reboot() does. Zephyr's
// hal_rpi_pico does not build watchdog.c, so write the registers here.
hw_clear_bits(&watchdog_hw->ctrl, WATCHDOG_CTRL_ENABLE_BITS);
watchdog_hw->scratch[4] = 0;
hw_set_bits(&psm_hw->wdsel, PSM_WDSEL_BITS & ~(PSM_WDSEL_ROSC_BITS | PSM_WDSEL_XOSC_BITS));
hw_set_bits(&watchdog_hw->ctrl, WATCHDOG_CTRL_TRIGGER_BITS);
#endif

// Try a warm reboot first. It won't return if it works but isn't always
// implemented.
sys_reboot(SYS_REBOOT_WARM);
Expand Down
Loading