RP2040-HAT-MicroPython icon indicating copy to clipboard operation
RP2040-HAT-MicroPython copied to clipboard

Support for Wiznet RP2040 HAT in mainstream rp2 MicroPython firmware?

Open DeeJay opened this issue 3 years ago • 8 comments

Do WIznet have any plans to progress the Pull Request #8021/#8023 to allow support in the rp2 port of MicroPython?

DeeJay avatar Mar 29 '22 17:03 DeeJay

Currently, the MicroPython administrator is not accepting the pull request operation. So after that, there is no progress regarding the pull request operation.

Let me try to ask about this issue.

irinakim12 avatar Apr 11 '22 04:04 irinakim12

Thank you for your response.

I can see you are already talking to the Micropython developers.

I think you need to ask them for advice about how to implement your patch for w5100s in a way that does not cause merge conflicts with their own maintained code.

Those merge conflicts are the reason they have not accepted your suggested changes.

You already have the necessary filestore permissions to change your own copy of this file. The MicroPython developers are probably quite right not to allow your patch to that file to change the behaviour for other users.

DeeJay avatar Apr 11 '22 08:04 DeeJay

Clickable links for the curious: https://github.com/micropython/micropython/pull/8021 https://github.com/micropython/micropython/pull/8023

@irinakim12 your fork has a merge conflict, only you can fix it, you have all the permissions you need already. Unfortunately, you made your PR from https://github.com/irinakim12/micropython/tree/master , rebasing would be much easier if you keep master in sync with upstream and made your PR from https://github.com/irinakim12/micropython/tree/wiznet5k

You've been sitting on this for 5 months?

chabala avatar Apr 11 '22 19:04 chabala

FAO: Wiznet.

Have you seen this Pull Request needing your attention for progress to be made by someone contributing to the micropython port. https://github.com/Wiznet/ioLibrary_Driver/pull/120

DeeJay avatar Apr 25 '22 17:04 DeeJay

I'm from the MicroPython project -- we have full support for the W5100 HAT and the W5100 & W5500 EVB boards in upstream MicroPython.

Currently the HAT is supported by the EVB firmware (a Pico with the HAT is essentially identical to the EVB as far as the firmware is concerned). We plan to combine this into a single "board" with three variants on the downloads page, similar for example to the pyboard variants, see https://micropython.org/download/pybv11/ I'll update this issue when that's done.

We're seeing a bit of confusion from our users as to whether to use this driver provided by WizNet or the upstream one. It might be better if you can replace this repository with something pointing to https://micropython.org/download/?vendor=Wiznet

@irinakim12 it would be great to get your attention on https://github.com/Wiznet/ioLibrary_Driver/pull/120 (@andrewleech) Thanks!

jimmo avatar Sep 06 '22 06:09 jimmo

Hello guys, and thank you @jimmo

I have been testing the WizNet Driver for the W5100 HAT (https://github.com/Wiznet / RP2040-HAT-MicroPython) and it seems unstable to me. I must say that I was looking forward to the official micropython support for the W5100!

I have installed the firmware from https://micropython.org/download/?vendor=Wiznet and it works nice! Very reliable after a few hours of tests.

However, I may have found some strange bug:

With the official firmware from https://micropython.org/download/?vendor=Wiznet flashed, I can do:

import network nic = network.WIZNET5K(machine.SPI(0), machine.Pin(17), machine.Pin(20)) nic.active(True)

This will make the RP2040 crash silently.

BUT, If I start SPI first:

import network from machine import Pin,SPI spi0=SPI(0,2_000_000, mosi=Pin(19),miso=Pin(16),sck=Pin(18)) nic = network.WIZNET5K(machine.SPI(0), machine.Pin(17), machine.Pin(20)) nic.active(True)

Everything works fine! @jimmo, should I report this as a bug on the micropython repo?

thanks and best regards Rafael

rafaelaroca avatar Sep 07 '22 22:09 rafaelaroca

Hi @rafaelaroca, in your first example you don't configure the mosi=Pin(19),miso=Pin(16),sck=Pin(18) pins of machine.SPI(0) so it will likely be using different pins.

The second example configures all of these, hence works correctly.

This same issue came up a couple of days ago, in that the "default" pins for SPI documented in the official rpi docs didn't neccesarily match the defaults in micropython. This is slated to be fixed in https://github.com/micropython/micropython/pull/9224

andrewleech avatar Sep 07 '22 22:09 andrewleech

Thanks @rafaelaroca

There was an issue with default pin selection, I actually sent a PR to fix this earlier this week. Will hopefully be merged soon. https://github.com/micropython/micropython/pull/9224

Separately we need to fix the issue where the Wiznet driver locks up with a misconfigured SPI instance.

jimmo avatar Sep 07 '22 23:09 jimmo