pyboard with LAN8720

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Antonio
Posts: 3
Joined: Tue Mar 24, 2020 7:38 am

pyboard with LAN8720

Post by Antonio » Tue Mar 31, 2020 7:25 am

I have a board which have stm32f405 and LAN8720 PHY,it use the mcu mac, i want to use it in mpy,but when i import network module,the module has no 'LAN' method(only a router method),i download a pyboard network DFU , it has no 'LAN' method either.
Does any one test pyboard using its own mac with a PHY like LAN8720?
I think it maybe run faster with this PHY although it need eight PIN to connect to PHY with RMMI interface,because the mac is inside the mcu.
if anyone test pyboard with it,please share your DFU.
any help would be appreciated

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: pyboard with LAN8720

Post by jimmo » Tue Mar 31, 2020 12:15 pm

Hi,

The "network" builds have network drivers for CC3000 and WIZ820io included. This does not include the RMII/MII on-chip MAC driver.

I have not tried this myself but I understand it is possible on the pyboard v11 (with the F405).

You will need to build your own firmware and enable the RMII ethernet interface by adding the following to ports/stm32/boards/PYBV11/mpconfigboard.h

Then follow the build instructions (ports/stm32/README.md) and build using
make BOARD=PYBV11

Code: Select all

// Ethernet via RMII
#define MICROPY_HW_ETH_MDC          (pin_C1)
#define MICROPY_HW_ETH_MDIO         (pin_A2)
#define MICROPY_HW_ETH_RMII_REF_CLK (pin_A1)
#define MICROPY_HW_ETH_RMII_CRS_DV  (pin_A7)
#define MICROPY_HW_ETH_RMII_RXD0    (pin_C4)
#define MICROPY_HW_ETH_RMII_RXD1    (pin_C5)
#define MICROPY_HW_ETH_RMII_TX_EN   (pin_B11)
#define MICROPY_HW_ETH_RMII_TXD0    (pin_B12)
#define MICROPY_HW_ETH_RMII_TXD1    (pin_B13)
(You might want to double-check those pin assignments from the manual, but I assume you've already figured this out for wiring up your LAN8720)

(I copied this with some small pin modifications from the NUCLEO_F429ZI board definition)

acute
Posts: 6
Joined: Sat Jan 23, 2021 10:59 pm

Re: pyboard with LAN8720

Post by acute » Sat Jan 23, 2021 11:44 pm

Hi, Antonio!

Did this method help you? I'm going to try it myself, so I'm curious if this is the right way.

User avatar
water
Posts: 75
Joined: Sun Sep 24, 2017 9:16 am

Re: pyboard with LAN8720

Post by water » Thu Jan 28, 2021 3:22 pm

Interest on it.
Can we refer ESP32 network.LAN() implement, it works fine, it initialize with:

Code: Select all

lan = network.LAN(mdc = machine.Pin(23), mdio = machine.Pin(18), power = machine.Pin(17), phy_type = network.PHY_LAN8720, phy_addr = 1)
Relate link:
https://github.com/micropython/micropyt ... work_lan.c
https://github.com/micropython/micropyt ... issues/172

And can you share your STM32F405 -> LAN8720 hardware wiring?

Post Reply