ESP32 以太网启动失败问题

nick.pt
Posts: 3
Joined: Tue Nov 23, 2021 7:29 am

ESP32 以太网启动失败问题

Postby nick.pt » Thu Nov 25, 2021 1:42 am

硬件:ESP32-WROVER-B + IP101
IDF版本:v4.1
系统:windown + ESP Command Prompt
配置如下:
Snipaste_2021-11-25_09-24-14.png
Snipaste_2021-11-25_09-24-14.png (41.26 KiB) Viewed 4389 times
Snipaste_2021-11-25_09-23-42.png
Snipaste_2021-11-25_09-23-42.png (48.03 KiB) Viewed 4389 times

打了3塊板使用 example/ethernet/basic 例程進行測試
LOG如下:

No.1:
  1. [0;32mI (12) [boot] ESP-IDF v4.1.1-1-g599be5b9bc-dirty 2nd stage bootloader[0m
  2. [0;32mI (12) [boot] compile time 17:54:32[0m
  3. [0;32mI (12) [boot] chip revision: 1[0m
  4. [0;32mI (16) [boot_comm] chip revision: 1, min. bootloader chip revision: 0[0m
  5. [0;32mI (23) [boot.esp32] SPI Speed      : 40MHz[0m
  6. [0;32mI (28) [boot.esp32] SPI Mode       : DIO[0m
  7. [0;32mI (32) [boot.esp32] SPI Flash Size : 16MB[0m
  8. [0;32mI (37) [boot] Enabling RNG early entropy source...[0m
  9. [0;32mI (42) [boot] Partition Table:[0m
  10. [0;32mI (46) [boot] ## Label            Usage          Type ST Offset   Length[0m
  11. [0;32mI (53) [boot]  0 nvs              WiFi data        01 02 00009000 00006000[0m
  12. [0;32mI (61) [boot]  1 phy_init         RF data          01 01 0000f000 00001000[0m
  13. [0;32mI (69) [boot]  2 factory          factory app      00 00 00010000 00100000[0m
  14. [0;32mI (76) [boot] End of partition table[0m
  15. [0;32mI (80) [boot_comm] chip revision: 1, min. application chip revision: 0[0m
  16. [0;32mI (88) [esp_image] segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0d3a0 ( 54176) map[0m
  17. [0;32mI (117) [esp_image] segment 1: paddr=0x0001d3c8 vaddr=0x3ffb0000 size=0x02074 (  8308) load[0m
  18. [0;32mI (121) [esp_image] segment 2: paddr=0x0001f444 vaddr=0x40080000 size=0x00404 (  1028) load[0m
  19. [0;32mI (125) [esp_image] segment 3: paddr=0x0001f850 vaddr=0x40080404 size=0x007c8 (  1992) load[0m
  20. [0;32mI (134) [esp_image] segment 4: paddr=0x00020020 vaddr=0x400d0020 size=0x2f07c (192636) map[0m
  21. [0;32mI (215) [esp_image] segment 5: paddr=0x0004f0a4 vaddr=0x40080bcc size=0x09ad8 ( 39640) load[0m
  22. [0;32mI (239) [boot] Loaded app from partition at offset 0x10000[0m
  23. [0;32mI (239) [boot] Disabling RNG early entropy source...[0m
  24. [0;32mI (240) [cpu_start] Pro cpu up.[0m
  25. [0;32mI (243) [cpu_start] Application information:[0m
  26. [0;32mI (248) [cpu_start] Project name:     ethernet_basic[0m
  27. [0;32mI (254) [cpu_start] App version:      781b332-dirty[0m
  28. [0;32mI (260) [cpu_start] ELF file SHA256:  10e45567284965c7...[0m
  29. [0;32mI (266) [cpu_start] ESP-IDF:          v4.1.1-1-g599be5b9bc-dirty[0m
  30. [0;32mI (272) [cpu_start] Starting app cpu, entry point is 0x40081270[0m
  31. [0;32mI (0) [cpu_start] App cpu up.[0m
  32. [0;32mI (283) [heap_init] Initializing. RAM available for dynamic allocation:[0m
  33. [0;32mI (290) [heap_init] At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
  34. [0;32mI (296) [heap_init] At 3FFB37E0 len 0002C820 (178 KiB): DRAM[0m
  35. [0;32mI (302) [heap_init] At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
  36. [0;32mI (309) [heap_init] At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
  37. [0;32mI (315) [heap_init] At 4008A6A4 len 0001595C (86 KiB): IRAM[0m
  38. [0;32mI (322) [cpu_start] Pro cpu start user code[0m
  39. [0;32mI (340) [spi_flash] detected chip: generic[0m
  40. [0;32mI (341) [spi_flash] flash io: dio[0m
  41. [0;32mI (341) [cpu_start] Starting scheduler on PRO CPU.[0m
  42. [0;32mI (0) [cpu_start] Starting scheduler on APP CPU.[0m
  43. [0;32mI (359) [system_api] Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
  44. [0;31mE (459) [ip101] ip101_pwrctl(296): power up timeout[0m
  45. [0;31mE (459) [ip101] ip101_init(336): power control failed[0m
  46. [0;31mE (459) [esp_eth] esp_eth_driver_install(199): init phy failed[0m
  47. ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x400848dc
  48. file: "../main/ethernet_example_main.c" line 125
  49. func: app_main
  50. expression: esp_eth_driver_install(&config, &eth_handle)
  51.  
  52. ELF file SHA256: 10e45567284965c7
  53.  
  54. Backtrace: 0x40084241:0x3ffb5690 0x400848df:0x3ffb56b0 0x400d5379:0x3ffb56d0 0x400d202a:0x3ffb5740 0x40084c4d:0x3ffb5760
PHY init 失敗.

No.2
  1. [0;32mI (12) [boot] ESP-IDF v4.1.1-1-g599be5b9bc-dirty 2nd stage bootloader[0m
  2. [0;32mI (12) [boot] compile time 17:54:32[0m
  3. [0;32mI (12) [boot] chip revision: 1[0m
  4. [0;32mI (16) [boot_comm] chip revision: 1, min. bootloader chip revision: 0[0m
  5. [0;32mI (23) [boot.esp32] SPI Speed      : 40MHz[0m
  6. [0;32mI (28) [boot.esp32] SPI Mode       : DIO[0m
  7. [0;32mI (32) [boot.esp32] SPI Flash Size : 16MB[0m
  8. [0;32mI (37) [boot] Enabling RNG early entropy source...[0m
  9. [0;32mI (42) [boot] Partition Table:[0m
  10. [0;32mI (46) [boot] ## Label            Usage          Type ST Offset   Length[0m
  11. [0;32mI (53) [boot]  0 nvs              WiFi data        01 02 00009000 00006000[0m
  12. [0;32mI (61) [boot]  1 phy_init         RF data          01 01 0000f000 00001000[0m
  13. [0;32mI (69) [boot]  2 factory          factory app      00 00 00010000 00100000[0m
  14. [0;32mI (76) [boot] End of partition table[0m
  15. [0;32mI (80) [boot_comm] chip revision: 1, min. application chip revision: 0[0m
  16. [0;32mI (88) [esp_image] segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0d3d0 ( 54224) map[0m
  17. [0;32mI (117) [esp_image] segment 1: paddr=0x0001d3f8 vaddr=0x3ffb0000 size=0x02074 (  8308) load[0m
  18. [0;32mI (121) [esp_image] segment 2: paddr=0x0001f474 vaddr=0x40080000 size=0x00404 (  1028) load[0m
  19. [0;32mI (125) [esp_image] segment 3: paddr=0x0001f880 vaddr=0x40080404 size=0x00798 (  1944) load[0m
  20. [0;32mI (134) [esp_image] segment 4: paddr=0x00020020 vaddr=0x400d0020 size=0x2f07c (192636) map[0m
  21. [0;32mI (216) [esp_image] segment 5: paddr=0x0004f0a4 vaddr=0x40080b9c size=0x09b20 ( 39712) load[0m
  22. [0;32mI (239) [boot] Loaded app from partition at offset 0x10000[0m
  23. [0;32mI (239) [boot] Disabling RNG early entropy source...[0m
  24. [0;32mI (240) [cpu_start] Pro cpu up.[0m
  25. [0;32mI (243) [cpu_start] Application information:[0m
  26. [0;32mI (248) [cpu_start] Project name:     ethernet_basic[0m
  27. [0;32mI (254) [cpu_start] App version:      781b332-dirty[0m
  28. [0;32mI (260) [cpu_start] Compile time:     Nov 23 2021 17:53:45[0m
  29. [0;32mI (266) [cpu_start] ELF file SHA256:  5a035742e77154c0...[0m
  30. [0;32mI (272) [cpu_start] ESP-IDF:          v4.1.1-1-g599be5b9bc-dirty[0m
  31. [0;32mI (279) [cpu_start] Starting app cpu, entry point is 0x40081274[0m
  32. [0;32mI (0) [cpu_start] App cpu up.[0m
  33. [0;32mI (289) [heap_init] Initializing. RAM available for dynamic allocation:[0m
  34. [0;32mI (296) [heap_init] At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
  35. [0;32mI (302) [heap_init] At 3FFB37E0 len 0002C820 (178 KiB): DRAM[0m
  36. [0;32mI (309) [heap_init] At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
  37. [0;32mI (315) [heap_init] At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
  38. [0;32mI (322) [heap_init] At 4008A6BC len 00015944 (86 KiB): IRAM[0m
  39. [0;32mI (328) [cpu_start] Pro cpu start user code[0m
  40. [0;32mI (346) [spi_flash] detected chip: generic[0m
  41. [0;32mI (347) [spi_flash] flash io: dio[0m
  42. [0;32mI (347) [cpu_start] Starting scheduler on PRO CPU.[0m
  43. [0;32mI (0) [cpu_start] Starting scheduler on APP CPU.[0m
  44. [0;32mI (365) [system_api] Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
  45. [0;32mI (385) [esp_eth.netif.glue] 40:f5:20:7b:75:f3[0m
  46. [0;32mI (385) [esp_eth.netif.glue] ethernet attached to netif[0m
  47. [0;32mI (395) [eth_example] Ethernet Started[0m
  48. [0;32mI (14395) [eth_example] Ethernet Link Up[0m
  49. [0;32mI (14395) [eth_example] Ethernet HW Addr 40:f5:20:7b:75:f3[0m
  50. [0;32mI (64395) [eth_example] Ethernet Link Down[0m
拿不到IP

No.3
  1. [0;32mI (12) [boot] ESP-IDF v4.1.1-1-g599be5b9bc-dirty 2nd stage bootloader[0m
  2. [0;32mI (12) [boot] compile time 17:54:32[0m
  3. [0;32mI (12) [boot] chip revision: 1[0m
  4. [0;32mI (16) [boot_comm] chip revision: 1, min. bootloader chip revision: 0[0m
  5. [0;32mI (23) [boot.esp32] SPI Speed      : 40MHz[0m
  6. [0;32mI (28) [boot.esp32] SPI Mode       : DIO[0m
  7. [0;32mI (32) [boot.esp32] SPI Flash Size : 16MB[0m
  8. [0;32mI (37) [boot] Enabling RNG early entropy source...[0m
  9. [0;32mI (42) [boot] Partition Table:[0m
  10. [0;32mI (46) [boot] ## Label            Usage          Type ST Offset   Length[0m
  11. [0;32mI (53) [boot]  0 nvs              WiFi data        01 02 00009000 00006000[0m
  12. [0;32mI (61) [boot]  1 phy_init         RF data          01 01 0000f000 00001000[0m
  13. [0;32mI (69) [boot]  2 factory          factory app      00 00 00010000 00100000[0m
  14. [0;32mI (76) [boot] End of partition table[0m
  15. [0;32mI (80) [boot_comm] chip revision: 1, min. application chip revision: 0[0m
  16. [0;32mI (88) [esp_image] segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0d3a0 ( 54176) map[0m
  17. [0;32mI (117) [esp_image] segment 1: paddr=0x0001d3c8 vaddr=0x3ffb0000 size=0x02074 (  8308) load[0m
  18. [0;32mI (121) [esp_image] segment 2: paddr=0x0001f444 vaddr=0x40080000 size=0x00404 (  1028) load[0m
  19. [0;32mI (125) [esp_image] segment 3: paddr=0x0001f850 vaddr=0x40080404 size=0x007c8 (  1992) load[0m
  20. [0;32mI (134) [esp_image] segment 4: paddr=0x00020020 vaddr=0x400d0020 size=0x2f07c (192636) map[0m
  21. [0;32mI (215) [esp_image] segment 5: paddr=0x0004f0a4 vaddr=0x40080bcc size=0x09ad8 ( 39640) load[0m
  22. [0;32mI (239) [boot] Loaded app from partition at offset 0x10000[0m
  23. [0;32mI (239) [boot] Disabling RNG early entropy source...[0m
  24. [0;32mI (240) [cpu_start] Pro cpu up.[0m
  25. [0;32mI (243) [cpu_start] Application information:[0m
  26. [0;32mI (248) [cpu_start] Project name:     ethernet_basic[0m
  27. [0;32mI (254) [cpu_start] App version:      781b332-dirty[0m
  28. [0;32mI (260) [cpu_start] ELF file SHA256:  10e45567284965c7...[0m
  29. [0;32mI (266) [cpu_start] ESP-IDF:          v4.1.1-1-g599be5b9bc-dirty[0m
  30. [0;32mI (272) [cpu_start] Starting app cpu, entry point is 0x40081270[0m
  31. [0;32mI (0) [cpu_start] App cpu up.[0m
  32. [0;32mI (283) [heap_init] Initializing. RAM available for dynamic allocation:[0m
  33. [0;32mI (290) [heap_init] At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
  34. [0;32mI (296) [heap_init] At 3FFB37E0 len 0002C820 (178 KiB): DRAM[0m
  35. [0;32mI (302) [heap_init] At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
  36. [0;32mI (309) [heap_init] At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
  37. [0;32mI (315) [heap_init] At 4008A6A4 len 0001595C (86 KiB): IRAM[0m
  38. [0;32mI (322) [cpu_start] Pro cpu start user code[0m
  39. [0;32mI (340) [spi_flash] detected chip: generic[0m
  40. [0;32mI (341) [spi_flash] flash io: dio[0m
  41. [0;32mI (341) [cpu_start] Starting scheduler on PRO CPU.[0m
  42. [0;32mI (0) [cpu_start] Starting scheduler on APP CPU.[0m
  43. [0;32mI (359) [system_api] Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
  44. [0;32mI (379) [esp_eth.netif.glue] 40:f5:20:7b:7c:1b[0m
  45. [0;32mI (379) [esp_eth.netif.glue] ethernet attached to netif[0m
  46. [0;32mI (389) [eth_example] Ethernet Started[0m
  47. [0;32mI (12389) [eth_example] Ethernet Link Up[0m
  48. [0;32mI (12389) [eth_example] Ethernet HW Addr 40:f5:20:7b:7c:1b[0m
  49. [0;32mI (20849) [esp_netif_handlers] eth ip: 192.168.68.232, mask: 255.255.255.0, gw: 192.168.68.1[0m
  50. [0;32mI (20849) [eth_example] Ethernet Got IP Address[0m
  51. [0;32mI (20849) [eth_example] ~~~~~~~~~~~[0m
  52. [0;32mI (20849) [eth_example] ETHIP:192.168.68.232[0m
  53. [0;32mI (20859) [eth_example] ETHMASK:255.255.255.0[0m
  54. [0;32mI (20859) [eth_example] ETHGW:192.168.68.1[0m
  55. [0;32mI (20869) [eth_example] ~~~~~~~~~~~[0m
  56. [0;32mI (26389) [eth_example] Ethernet Link Down[0m
燒錄完的前幾次可以成功, 斷電一段時間後上電就會像No.1一樣的現象.

有人可以幫忙告知上述問題怎麼產生的, 以及如何解決嗎?
3塊板子同樣的code卻有截然不同的結果, 沒有頭緒.
感謝閱文的各位.

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: ESP32 以太网启动失败问题

Postby ESP_morris » Thu Nov 25, 2021 7:45 am

你是用的 GPIO0 输出RMII时钟,看你的情况,像是MAC和PHY侧拿到的RMII时钟相位对不上,导致数据平面通信不稳定,出现一会link up 一会就 link down的现象. GPIO0直接输出时钟的话建议再接一个反相器.

我们推荐RMII时钟由外部提供,从GPIO0输入. 参看官方的开发板.

nick.pt
Posts: 3
Joined: Tue Nov 23, 2021 7:29 am

Re: ESP32 以太网启动失败问题

Postby nick.pt » Thu Nov 25, 2021 9:27 am

ESP_morris wrote:
Thu Nov 25, 2021 7:45 am
你是用的 GPIO0 输出RMII时钟,看你的情况,像是MAC和PHY侧拿到的RMII时钟相位对不上,导致数据平面通信不稳定,出现一会link up 一会就 link down的现象. GPIO0直接输出时钟的话建议再接一个反相器.

我们推荐RMII时钟由外部提供,从GPIO0输入. 参看官方的开发板.
電路是參考官方的開發板的, 目前GPIO0輸出是有接個反向器的. No.2板 IP拿不到估計是相位對不上造成.
請問No.1這種現象有什麼辦法可以解決了? PHY總是初始化失敗, power up timeout.

Who is online

Users browsing this forum: No registered users and 96 guests