Skip to content

boards: Add support WizNet W5500 EVB Pico2 #84834

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

Merged
merged 2 commits into from
Mar 12, 2025
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
2 changes: 1 addition & 1 deletion boards/wiznet/w5500_evb_pico/board.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
board:
name: w5500_evb_pico
full_name: W5500 Evaluation Pico
full_name: W5500-EVB-Pico
vendor: wiznet
socs:
- name: rp2040
19 changes: 19 additions & 0 deletions boards/wiznet/w5500_evb_pico2/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

if BOARD_W5500_EVB_PICO2

if NETWORKING

config NET_L2_ETHERNET
default y

endif # NETWORKING

config USB_SELF_POWERED
default n

config SYS_CLOCK_HW_CYCLES_PER_SEC
default 150000000

endif # BOARD_W5500_EVB_PICO2
5 changes: 5 additions & 0 deletions boards/wiznet/w5500_evb_pico2/Kconfig.w5500_evb_pico2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

config BOARD_W5500_EVB_PICO2
select SOC_RP2350A_M33 if BOARD_W5500_EVB_PICO2_RP2350A_M33
18 changes: 18 additions & 0 deletions boards/wiznet/w5500_evb_pico2/board.cmake
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)
6 changes: 6 additions & 0 deletions boards/wiznet/w5500_evb_pico2/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: w5500_evb_pico2
full_name: W5500-EVB-Pico2
vendor: wiznet
socs:
- name: rp2350a
Binary file not shown.
136 changes: 136 additions & 0 deletions boards/wiznet/w5500_evb_pico2/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
.. zephyr:board:: w5500_evb_pico2

Overview
********

W5500-EVB-Pico2 is a microcontroller evaluation board based on the Raspberry
Pi RP2350A and fully hardwired TCP/IP controller W5500 - and basically works
the same as Raspberry Pi Pico2 board but with additional Ethernet via W5500.
The USB bootloader allows the ability to flash without any adapter, in a
drag-and-drop manner. It is also possible to flash and debug the boards with
their SWD interface, using an external adapter.

Hardware
********

- Dual core Arm Cortex-M33 or Hazard3 processor running up to 133MHz
- 520KB on-chip SRAM
- 16MB on-board QSPI flash with XIP capabilities
- 26 GPIO pins
- 3 Analog inputs
- 2 UART peripherals
- 2 SPI controllers
- 2 I2C controllers
- 16 PWM channels
- USB 1.1 controller (host/device)
- 3 Programmable I/O (PIO) for custom peripherals
- On-board LED
- 1 Watchdog timer peripheral
- Wiznet W5500 Ethernet MAC/PHY

Supported Features
==================

.. zephyr:board-supported-hw::

Pin Mapping
===========

The peripherals of the RP2350A SoC can be routed to various pins on the board.
The configuration of these routes can be modified through DTS. Please refer to
the datasheet to see the possible routings for each peripheral.

External pin mapping on the W5500_EVB_PICO2 is identical to the Raspberry Pi
Pico2. Since GPIO 25 is routed to the on-board LED on, similar to the Raspberry
Pi Pico, the blinky example works as intended. The W5500 is routed to the SPI0
(P16-P19), with the reset and interrupt signal for the W5500 routed to P20 and
P21, respectively. All of these are shared with the edge connector on the
board.

Refer to `W55500 Evaluation Board Pico2 Documentation`_ for a board schematic and
other certifications.

Default Zephyr Peripheral Mapping:
----------------------------------

.. rst-class:: rst-columns

- UART0_TX : P0
- UART0_RX : P1
- I2C0_SDA : P4
- I2C0_SCL : P5
- I2C1_SDA : P14
- I2C1_SCL : P15
- SPI0_RX : P16
- SPI0_CSN : P17
- SPI0_SCK : P18
- SPI0_TX : P19
- W5500 Reset : P20
- W5500 Interrupt : P21
- ADC_CH0 : P26
- ADC_CH1 : P27
- ADC_CH2 : P28
- ADC_CH3 : P29

Programming and Debugging
*************************

Flashing
========

Using OpenOCD
-------------

The overall explanation regarding flashing and debugging is the same as or
``rpi_pico``.
See :ref:`rpi_pico_flashing_using_openocd`. in ``rpi_pico`` documentation.

A typical build command for w5500_evb_pico2 is as follows.
This assumes a CMSIS-DAP adapter such as the RaspberryPi Debug Probe,
but if you are using something else, specify ``RPI_PICO_DEBUG_ADAPTER``.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: w5500_evb_pico2
:goals: build flash
:gen-args: -DOPENOCD=/usr/local/bin/openocd

Using UF2
---------

If you don't have an SWD adapter, you can flash the Raspberry Pi Pico with
a UF2 file. By default, building an app for this board will generate a
:file:`build/zephyr/zephyr.uf2` file. If the Pico is powered on with the ``BOOTSEL``
button pressed, it will appear on the host as a mass storage device. The
UF2 file should be drag-and-dropped to the device, which will flash the Pico.

Debugging
=========

The SWD interface can also be used to debug the board. To achieve this, you can
either use SEGGER JLink or OpenOCD.

Using OpenOCD
-------------

Install OpenOCD as described for flashing the board.

Here is an example for debugging the :zephyr:code-sample:`blinky` application.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: w5500_evb_pico2
:maybe-skip-config:
:goals: debug
:gen-args: -DOPENOCD=/usr/local/bin/openocd

.. target-notes::

.. _pico_setup.sh:
https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh

.. _Getting Started with Raspberry Pi Pico:
https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

.. _W55500 Evaluation Board Pico2 Documentation:
https://docs.wiznet.io/Product/iEthernet/W5500/w5500-evb-pico2
11 changes: 11 additions & 0 deletions boards/wiznet/w5500_evb_pico2/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2025 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
}
}
59 changes: 59 additions & 0 deletions boards/wiznet/w5500_evb_pico2/w5500_evb_pico2-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2021, Yonatan Schachter
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350a-pinctrl.h>

&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_P0>;
};

group2 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

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;
};
};
};
Loading
Loading