ESP32 外接LAN8720,GPIO0对其提供CLK,Ethernet例程初始化出错

kelly1947
Posts: 7
Joined: Mon Sep 16, 2019 6:49 am

ESP32 外接LAN8720,GPIO0对其提供CLK,Ethernet例程初始化出错

Postby kelly1947 » Tue Oct 15, 2019 11:25 am

我用ESP32外接LAN8720,因为要使用ESP32的第二路UART,只能使用GPIO0提供CLK。
使用的代码是IDF里的ethernet例子,报错如下:

Code: Select all

I (229) cpu_start: App cpu up.
I (247) heap_init: Initializing. RAM available for dynamic allocation:
I (254) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (260) heap_init: At 3FFB40A8 len 0002BF58 (175 KiB): DRAM
I (266) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (273) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (279) heap_init: At 400885D0 len 00017A30 (94 KiB): IRAM
I (285) cpu_start: Pro cpu start user code
I (303) cpu_start: Chip Revision: 1
W (303) cpu_start: Chip revision is higher than the one configured in menuconfig. Suggest to upgrade it.
I (307) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (319) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
E (1329) emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0xffff
E (2329) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0(mask 0xfff0). Current value 0xffff
E (2329) emac: Initialise PHY device Timeout
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40084140
0x40084140: _esp_error_check_failed at /mnt/hgfs/workspace/esp32/IDF/esp-idf-v3.3/components/esp32/panic.c:720

file: "/mnt/hgfs/workspace/esp32/project/ethernet/main/ethernet_example_main.c" line 153
func: app_main
expression: esp_eth_enable()

ELF file SHA256: 597d55ebf237c1cffa5f47c73148a159b22726d94a7b78100bd941d7d5fc906e

Backtrace: 0x40083cdc:0x3ffb5e80 0x40084143:0x3ffb5ea0 0x400d32c1:0x3ffb5ec0 0x400d1742:0x3ffb5f20 0x40085d91:0x3ffb5f40
0x40083cdc: invoke_abort at /mnt/hgfs/workspace/esp32/IDF/esp-idf-v3.3/components/esp32/panic.c:715

0x40084143: _esp_error_check_failed at /mnt/hgfs/workspace/esp32/IDF/esp-idf-v3.3/components/esp32/panic.c:721

0x400d32c1: app_main at /mnt/hgfs/workspace/esp32/project/ethernet/main/ethernet_example_main.c:153 (discriminator 1)

0x400d1742: main_task at /mnt/hgfs/workspace/esp32/IDF/esp-idf-v3.3/components/esp32/cpu_start.c:542

0x40085d91: vPortTaskWrapper at /mnt/hgfs/workspace/esp32/IDF/esp-idf-v3.3/components/freertos/port.c:403


Rebooting...
使用的Example Config如下:

Code: Select all

#
# Example Configuration
#
CONFIG_PHY_IP101=
CONFIG_PHY_TLK110=
CONFIG_PHY_LAN8720=y
CONFIG_PHY_ADDRESS=1
CONFIG_PHY_CLOCK_GPIO0_IN=y
CONFIG_PHY_CLOCK_GPIO0_OUT=
CONFIG_PHY_CLOCK_GPIO16_OUT=
CONFIG_PHY_CLOCK_GPIO17_OUT=
CONFIG_PHY_CLOCK_MODE=0
CONFIG_PHY_USE_POWER_PIN=y
CONFIG_PHY_POWER_PIN=5
CONFIG_PHY_SMI_MDC_PIN=23
CONFIG_PHY_SMI_MDIO_PIN=18
请问这个是在哪里出了问题呢?我看了官方的开发板也是使用了IO0提供CLK给IP101,且我测试了代码是可以用的。

ESP_houwenxiang
Posts: 92
Joined: Tue Jun 26, 2018 3:09 am

Re: ESP32 外接LAN8720,GPIO0对其提供CLK,Ethernet例程初始化出错

Postby ESP_houwenxiang » Fri Oct 18, 2019 11:50 am

Hi
请检查 IO0 上是否有电容, 作为 CLK 输出 pin 的时候最好 IO0 上没有接电容, 这会影响时序.

谢谢!!
wookooho

Who is online

Users browsing this forum: No registered users and 3 guests