facing issue in idf 4.4 ethernet basic example.

kesha.modhia
Posts: 44
Joined: Fri May 13, 2022 12:36 pm

facing issue in idf 4.4 ethernet basic example.

Postby kesha.modhia » Fri Jul 29, 2022 5:04 am

- I want to run ethernet in my board
- using esp32 wrover-I chip
- using idf version 4.4
- failing for ethernet basic example given in SDK itself.
- help out here I have attached all the necessary details below,


SET UP

CUSTOM BOARD
CHIP - esp32-wrover-I
SDK VERSION - IDF release/v4.4

DEBUG_LOGS

ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6624
load:0x40078000,len:14780
load:0x40080400,len:3792
entry 0x40080694
I (27) boot: ESP-IDF v4.4-dirty 2nd stage bootloader
I (27) boot: compile time 14:37:17
I (27) boot: chip revision: 1
I (30) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (37) boot.esp32: SPI Speed : 40MHz
I (42) boot.esp32: SPI Mode : DIO
I (46) boot.esp32: SPI Flash Size : 4MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label Usage Type ST Offset Length
I (67) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (75) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (82) boot: 2 factory factory app 00 00 00010000 00100000
I (90) boot: End of partition table
I (94) boot_comm: chip revision: 1, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=12810h ( 75792) map
I (137) esp_image: segment 1: paddr=00022838 vaddr=3ffb0000 size=024fch ( 9468) load
I (141) esp_image: segment 2: paddr=00024d3c vaddr=40080000 size=0b2dch ( 45788) load
I (162) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=35c84h (220292) map
I (242) esp_image: segment 4: paddr=00065cac vaddr=4008b2dc size=0210ch ( 8460) load
I (245) esp_image: segment 5: paddr=00067dc0 vaddr=50000000 size=00010h ( 16) load
I (254) boot: Loaded app from partition at offset 0x10000
I (254) boot: Disabling RNG early entropy source...
I (270) cpu_start: Pro cpu up.
I (271) cpu_start: Starting app cpu, entry point is 0x400811a8
I (257) cpu_start: App cpu up.
I (285) cpu_start: Pro cpu start user code
I (285) cpu_start: cpu freq: 160000000
I (285) cpu_start: Application information:
I (289) cpu_start: Project name: ethernet_basic
I (295) cpu_start: App version: v4.4-dirty
I (300) cpu_start: Compile time: Jul 28 2022 18:21:57
I (306) cpu_start: ELF file SHA256: f51b934fc0be704a...
I (312) cpu_start: ESP-IDF: v4.4-dirty
I (318) heap_init: Initializing. RAM available for dynamic allocation:
I (325) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (331) heap_init: At 3FFB3D70 len 0002C290 (176 KiB): DRAM
I (337) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (343) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (350) heap_init: At 4008D3E8 len 00012C18 (75 KiB): IRAM
I (357) spi_flash: detected chip: gd
I (360) spi_flash: flash io: dio
W (364) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (378) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (388) esp_netif_lwip: LwIP stack has been initialized
I (398) esp_netif_lwip: esp-netif has been successfully initialized
I (398) eth_example: ~~~ in example ~~~~~~~~
I (408) eth_example: ~~~ 1 ~~~~~~~~
I (408) eth_example: ~~~ 2 ~~~~~~~~
E (518) esp.emac: emac_esp32_init(355): reset timeout
E (518) esp_eth: esp_eth_driver_install(222): init mac failed

ESP_ERROR_CHECK failed: esp_err_t 0x107 (ESP_ERR_TIMEOUT) at 0x40086368
file: "../main/ethernet_example_main.c" line 124
func: app_main
expression: esp_eth_driver_install(&config, &eth_handle)

abort() was called at PC 0x4008636b on core 0


Backtrace:0x40081a1a:0x3ffb70400x40086375:0x3ffb7060 0x4008bfce:0x3ffb7080 0x4008636b:0x3ffb70f0 0x400d693f:0x3ffb7110 0x4010597d:0x3ffb72b0 0x400890d9:0x3ffb72d0



SDKCONFIG FILE - example configuration for ethernet basic

#
# Example Configuration
#

CONFIG_EXAMPLE_GPIO_RANGE_MIN=0
CONFIG_EXAMPLE_GPIO_RANGE_MAX=33
CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y
# CONFIG_EXAMPLE_ETH_PHY_IP101 is not set
# CONFIG_EXAMPLE_ETH_PHY_RTL8201 is not set
CONFIG_EXAMPLE_ETH_PHY_LAN87XX=y
# CONFIG_EXAMPLE_ETH_PHY_DP83848 is not set
# CONFIG_EXAMPLE_ETH_PHY_KSZ8041 is not set
# CONFIG_EXAMPLE_ETH_PHY_KSZ8081 is not set
CONFIG_EXAMPLE_ETH_MDC_GPIO=23
CONFIG_EXAMPLE_ETH_MDIO_GPIO=18
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=-1
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
CONFIG_EXAMPLE_USE_SPI_ETHERNET=y
CONFIG_EXAMPLE_SPI_ETHERNETS_NUM=1
CONFIG_EXAMPLE_USE_DM9051=y
# CONFIG_EXAMPLE_USE_KSZ8851SNL is not set
# CONFIG_EXAMPLE_USE_W5500 is not set
CONFIG_EXAMPLE_ETH_SPI_HOST=1
CONFIG_EXAMPLE_ETH_SPI_SCLK_GPIO=14
CONFIG_EXAMPLE_ETH_SPI_MOSI_GPIO=13
CONFIG_EXAMPLE_ETH_SPI_MISO_GPIO=12
CONFIG_EXAMPLE_ETH_SPI_CLOCK_MHZ=50
CONFIG_EXAMPLE_ETH_SPI_CS0_GPIO=15
CONFIG_EXAMPLE_ETH_SPI_INT0_GPIO=4
CONFIG_EXAMPLE_ETH_SPI_PHY_RST0_GPIO=-1
CONFIG_EXAMPLE_ETH_SPI_PHY_ADDR0=1
# end of Example Configuration


idf.py menuconfig ->component config -> ethernet

#define CONFIG_ADC_CAL_LUT_ENABLE 1
#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1
#define CONFIG_ETH_ENABLED 1
#define CONFIG_ETH_USE_ESP32_EMAC 1
#define CONFIG_ETH_PHY_INTERFACE_RMII 1
#define CONFIG_ETH_RMII_CLK_INPUT 1
#define CONFIG_ETH_RMII_CLK_IN_GPIO 0
#define CONFIG_ETH_DMA_BUFFER_SIZE 512
#define CONFIG_ETH_DMA_RX_BUFFER_NUM 10
#define CONFIG_ETH_DMA_TX_BUFFER_NUM 10
#define CONFIG_ETH_USE_SPI_ETHERNET 1
#define CONFIG_ETH_SPI_ETHERNET_DM9051 1
#define CONFIG_ESP_EVENT_POST_FROM_ISR 1
#define CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR 1
Attachments
Screenshot (219).png
Screenshot (219).png (299.85 KiB) Viewed 1887 times
Screenshot (220).png
Screenshot (220).png (270.82 KiB) Viewed 1887 times

ESP_ondrej
Posts: 210
Joined: Fri May 07, 2021 10:35 am

Re: facing issue in idf 4.4 ethernet basic example.

Postby ESP_ondrej » Mon Aug 01, 2022 8:47 pm

Hi kesha.modhia,

it seems the EMAC is missing RMII REF CLK. Did you enable the oscillator? I think we've already discussed this topic in https://www.esp32.com/viewtopic.php?f=2 ... 8&start=10

Who is online

Users browsing this forum: Bing [Bot] and 103 guests