Skip to content

Commit 6db20bf

Browse files
Deomid Ryabkovcesantabot
authored andcommitted
Add a README for the Ethernet lib
PUBLISHED_FROM=8ad4fd51cf353787bc417a1b26a2ec87fc044e18
1 parent afb6786 commit 6db20bf

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Ethernet support
2+
3+
## ESP32
4+
5+
ESP32 includes an Ethernet MAC and requires an external PHY, connected over RMII interface.
6+
7+
Two PHY models are currently supported: Microchip LAN87x0 ([LAN8710](http://ww1.microchip.com/downloads/en/DeviceDoc/00002164B.pdf) supports both MII and RMII; [LAN8720](http://ww1.microchip.com/downloads/en/DeviceDoc/00002165B.pdf) is RMII only) and [TI TLK110](http://www.ti.com/lit/ds/symlink/tlk110.pdf). PHY model selection is a compile-time option and is set [here](https://github.com/mongoose-os-libs/ethernet/blob/master/mos_esp32.yml#L5).
8+
9+
There is a detailed article on how to connect a PHY yourself [here](https://sautter.com/blog/ethernet-on-esp32-using-lan8720/), but it is much easier to buy a dev board which already has one, for example, [Olimex ESP32-EVB](https://www.olimex.com/Products/IoT/ESP32-EVB/open-source-hardware).
10+
11+
Once wired, there are anumber of settings you will need to enable Ethernet support in mOS by setting `eth.enable=true` config option.
12+
13+
There are also a number of settings you may want to tweak:
14+
* `eth.phy_addr` - PHY has SMI address selection pins, set this accordingly. `0` is the default.
15+
* `eth.mdc_gpio` and `eth.mdio_gpio` - most of the RMII pins are fixed, but the SMI interface pins can be adjusted if necessary. These can be any bi-directional GPIO pins. The defaults, `23` and `18` respecively.
16+
17+
Note: the defaults match the EVB-ESP32 board, so if you use that, you won't need to adjust anything except setting `eth.enable` to `true`.

mos_esp32.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ sources:
22
- src/esp32
33

44
cdefs:
5-
# 8720 or 8710 in RMII mode.
5+
# Select the PHY model. Only one at a time, not both.
66
MGOS_ETH_PHY_LAN87x0: 1
7+
# MGOS_ETH_PHY_TLK110: 1
78

89
config_schema:
910
- ["eth.phy_addr", "i", 0, {title: "RMII PHY address"}]

0 commit comments

Comments
 (0)