|
|
2 лет назад | |
|---|---|---|
| .. | ||
| basic | 2 лет назад | |
| enc28j60 | 2 лет назад | |
| iperf | 2 лет назад | |
| .build-test-rules.yml | 2 лет назад | |
| README.md | 2 лет назад | |
See the README.md file in the upper level examples directory for more information about examples.
| GPIO | RMII Signal | Notes |
|---|---|---|
| GPIO21 | TX_EN | EMAC_TX_EN |
| GPIO19 | TX0 | EMAC_TXD0 |
| GPIO22 | TX1 | EMAC_TXD1 |
| GPIO25 | RX0 | EMAC_RXD0 |
| GPIO26 | RX1 | EMAC_RXD1 |
| GPIO27 | CRS_DV | EMAC_RX_DRV |
| GPIO | Function | Notes |
|---|---|---|
| GPIO0 | EMAC_TX_CLK/CLK_OUT1 | input/output |
| GPIO16 | EMAC_CLK_OUT | output |
| GPIO17 | EMAC_CLK_180 | output |
| GPIO | SMI Signal | Notes |
|---|---|---|
| GPIO23 | MDC | Output to PHY |
| GPIO18 | MDIO | Bidirectional |
| GPIO | DM9051 |
|---|---|
| GPIO14 | SPI_CLK |
| GPIO13 | SPI_MOSI |
| GPIO12 | SPI_MISO |
| GPIO15 | SPI_CS |
| GPIO4 | Interrupt |
| NC | Reset |
Warning: Please consult Espressif Technical reference manual along with datasheet for specific ESP Module you use when assigning any other pins, especially when choosing from system configuration menu for the ethernet examples, some pins cannot be used (they may already be utilized for different purpose like SPI Flash/RAM, some pins might be inputs only, etc.).
In the Example Ethernet Configuration menu:
Internal EMAC is selected:
Ethernet PHY Device, by default, the ESP32-Ethernet-Kit has an IP101 on board.SMI MDC GPIO number and SMI MDIO GPIO number respectively.SPI Ethernet is selected:
PHY Reset GPIO number, you may have to change the default value according to your board schematic. PHY hardware reset can be disabled by set this value to -1.PHY Address, you may have to change the default value according to your board schematic.In the Component config > Ethernet menu:
Support ESP32 internal EMAC controller sub-menu:
PHY interface, select Reduced Media Independent Interface (RMII), ESP-IDF currently only support RMII mode.RMII clock mode, select one of the source that RMII clock (50MHz) comes from: Input RMII clock from external or Output RMII clock from internal.Output RMII clock from internal is enabled, you also have to set the GPIO number that used to output the RMII clock, under RMII clock GPIO number. In this case, you can set the GPIO number to 16 or 17.Output RMII clock from GPIO0 (Experimental!) is also enabled, then you have no choice but GPIO0 to output the RMII clock.Amount of Ethernet DMA Rx buffers and Amount of Ethernet DMA Tx buffers, you can set the amount of DMA buffers used for Tx and Rx.Support SPI to Ethernet Module sub-menu, select the SPI module that you used for this example. Currently ESP-IDF only supports DM9051, W5500 and KSZ8851SNL.If you observe undefined behavior (e.g. LCD glitches) of any SPI device which works normally when Ethernet is not connected over internal EMAC, you need to adjust EMAC DMA burst length (the DMA is shared resource between EMAC and the SPI). The same applies when you observe Ethernet frames corruption at the output of SPI Ethernet module and you use combination of internal EMAC and SPI Ethernet module as network interfaces. To configure the EMAC DMA burst length, modify internal Ethernet initialization as follows:
esp32_emac_config.dma_burst_len = ETH_DMA_BURST_LEN_4; // or other appropriate value