Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for W55RP20-EVB-Pico and WIZNET_PIO_SPI communication.#10440

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
wizhannah wants to merge7 commits intoadafruit:main
base:main
Choose a base branch
Loading
fromwizhannah:W55RP20-EVB-Pico

Conversation

@wizhannah
Copy link

The W55RP20-EVB-Pico is an evaluation board for the W55RP20, a SiP (System in Package) chip that integrates the W5500 (wired TCP/IP controller) and the RP2040. As a result, both the features of the Raspberry Pi Pico and the W5500 can be utilized.

The W55RP20 features two identical PIO (Programmable Input/Output) blocks, one of which is used for communication with the W5500. For more detailed information on PIO, please refer to section 3 "PIO" in the RP2040 datasheet.

This PR adds initial support for the W55RP20-EVB-Pico board. The changes included in this PR are as follows:

  1. Added support for W55RP20-EVB-Pico under ports/raspberrypi/boards/
  2. Implemented WIZNET_PIO_SPI in both:
    • common-hal/busio/
    • shared-bindings/busio/
  3. New files were created in the ports/raspberrypi/wiznet_pio_spi directory:
    • wiznet_pio_spi.c
    • wiznet_pio_spi.h
    • wiznet_pio_spi.pio

The wiznet5k_simpleserver example ran without any issues:

import boardimport busioimport digitalioimport adafruit_wiznet5k.adafruit_wiznet5k_socketpool as socketpoolfrom adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5Kprint("Wiznet5k SimpleServer Test")# For Adafruit Ethernet FeatherWingcs = digitalio.DigitalInOut(board.W5K_CS)spi_bus = busio.WIZNET_PIO_SPI(board.W5K_SCK, MOSI=board.W5K_MOSI, MISO=board.W5K_MISO)# Initialize ethernet interfaceeth = WIZNET5K(spi_bus, cs, is_dhcp=True)# Initialize a socket for our serverpool = socketpool.SocketPool(eth)server = pool.socket()  server_ip = eth.pretty_ip(eth.ip_address)  server_port = 50007 server.bind((server_ip, server_port)) server.listen() while True:    print(f"Accepting connections on {server_ip}:{server_port}")    conn, addr = server.accept()    print(f"Connection accepted from {addr}, reading exactly 1024 bytes from client")    with conn:        data = conn.recv(1024)        if data:            print(data)            conn.send(data)    print("Connection closed")

image

Additionally, the following examples were also tested and passed successfully:

  • Adafruit IO (DownLink, UpLink, Up&DownLink)
  • DHCP
  • DNS
  • HTTP (Webclient, Webserver)
  • Loopback
  • MQTT
  • SNTP

Copy link
Collaborator

@dhalbertdhalbert left a comment

Choose a reason for hiding this comment

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

Thanks for adding these new boards.

We don't put board- or port-specific stuff inshared-bindings. The idea ofshared-bindings is that the Python API is common across all the ports that implement it.

Instead, put the port-specific stuff inports/raspberrypi/bindings. There are already some RP2xxx-specific things there, which you can use as models.

In this case, it would make sense to create a new module, called, saypiospi with a classpiospi.SPI(). The you can have a flag, say,CIRCUITPY_PIOSPI, which would be enabled only for these boards.

I am not sure if this is true, but is it the case that this PIO implementation is not limited to Wiznet boards? Could it be used on any PIO-capable RP2 board? That is why I suggested the name above. Internally, you can then drop the "wiznet" part of the names, and just use 'piospi`.

We could also consider naming the top-level modulepiobusio. for right now only includes SPI, but could include PIO-based I2C or UART in the future.

How does this all sound to you?

@wizhannah
Copy link
Author

Thank you for your detailed explanation.
I was also wondering whether it would be appropriate to put Wiznet-specific code under shared-bindings, so your clarification is very helpful.

Thank you for your suggestion, but in this case, I believe the PIO SPI code is limited to Wiznet boards, since wizchip_pio_spi.c implements the SPI protocol specifically for the W5500 chip.

Given this, would it be appropriate to create a new module named wiznet_pio, with a class wiznet_pio.SPI()?
For example, should I place the files like this?
port/raspberrypi/common-hal/wiznet_pio/SPI.c
port/raspberrypi/bindigs/wiznet_pio/SPI.c

Please let me know if this structure is correct, or if you have any further recommendations.

@dhalbert
Copy link
Collaborator

Thank you for your suggestion, but in this case, I believe the PIO SPI code is limited to Wiznet boards, since wizchip_pio_spi.c implements the SPI protocol specifically for the W5500 chip.

Given this, would it be appropriate to create a new module named wiznet_pio, with a class wiznet_pio.SPI()? For example, should I place the files like this? port/raspberrypi/common-hal/wiznet_pio/SPI.c port/raspberrypi/bindings/wiznet_pio/SPI.c

Please let me know if this structure is correct, or if you have any further recommendations.

Sorry for the delay in replying. I thought maybe the PIO SPI could be used for any SPI device, but if that's not true, then your naming makes sense. So there would be aCIRCUITPY_WIZNET_PIO, and it would be turned on only for these boards.

If there is only SPI inwiznet_pio, you might name itwiznet_piospi. If you think you might add some more wiznet functionality, it could just bewiznet.

You will need__init__.* files as well.

@wizhannah
Copy link
Author

Thank you for your feedback. As you suggested, I changed the module name to wiznet and added the PIO SPI functionality.

However, while my local build does not exceed the flash size for the wiznet_w55rp20_evb_pico board, the pre-commit workflow fails with a "region FLASH_FIRMWARE overflowed" error.
Could you please let me know why this is happening? Is there anything specific I should do to pass the pre-commit workflow?

@dhalbert
Copy link
Collaborator

The pre-commit errors have to do with formatting style changes:https://github.com/adafruit/circuitpython/actions/runs/16258353450/job/45898635679?pr=10440#logs. If you install pre-commit locally, pre-commit will check locally and fix up the source. Seehttps://learn.adafruit.com/building-circuitpython/build-circuitpython#install-pre-commit-3096511 for details.

The size issue is for certain builds. Some languages are larger than others.en_US, which you are building, fits, but some others do not. Instead of turning off features, the easiest thing to do would be to turn down the compiler optimization a bit. Right now it is-O3. Add this line as the last linethempconfigboard.mk for the overlowing board. Also add a blank line for readability

OPTIMIZATION_FLAGS = -O2

@wizhannahwizhannah requested a review fromdhalbertJuly 16, 2025 05:24
@wizhannah
Copy link
Author

Thank you for your helpful feedback. I have made the changes according to your suggestions.
Could you please review them again?

@anecdataanecdata linked an issueJul 23, 2025 that may beclosed by this pull request
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dhalbertdhalbertAwaiting requested review from dhalbert

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

W55RP20 Support Requirements

2 participants

@wizhannah@dhalbert

[8]ページ先頭

©2009-2025 Movatter.jp