ESP32-EVB-rev C ethernet not working

Started by patxitron, December 12, 2017, 07:48:23 PM

Previous topic - Next topic

patxitron

Recently I bought an ESP32-EVB board. I'm trying to use the wired network. First I tryed using micropython using the same commands used in the las post of this issue https://github.com/micropython/micropython-esp32/issues/172 but in my board this result on two errors repeating continuosly:


E (961727) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (962727) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff


Today I'm trying to do it using arduino code. I've got the blink example working with one of the relays, but when I try to execute the ETH_LAN8720 example, it outputs the same two errors as in the micropython case.

Is there any efuse or setup I'm skipping in order to get the ethernet working? Maybe I need to configure a MAC address? How?

Thank you in advance and best regards.

LubOlimex

#1
Hello,

Why don't you start with our ESP-IDF example here: https://github.com/OLIMEX/ESP32-EVB/tree/master/SOFTWARE ? If you get "emac: emac rx buf err!" error the workaround are described in this forum thread: https://www.olimex.com/forum/index.php?topic=5891.0 and also here: https://github.com/OLIMEX/ESP32-EVB/issues/11

In the official Arduino for ESP32 (https://github.com/espressif/arduino-esp32) make sure after installation to select the ESP32-EVB board in the board manager.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

patxitron

Same errors, captured after flashing and reseting:


rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1b (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:0x3fff0018,len:4
load:0x3fff001c,len:5716
load:0x40078000,len:0
load:0x40078000,len:13804
entry 0x40079030
I (69) boot: Detected ESP32
I (32) boot: ESP-IDF v3.1-dev-51-gd2bd9cc 2nd stage bootloader
I (32) boot: compile time 17:16:39
I (32) boot: Enabling RNG early entropy source...
I (38) boot: SPI Speed      : 40MHz
I (42) boot: SPI Mode       : DIO
I (46) boot: SPI Flash Size : 4MB
I (50) boot: Partition Table:
I (54) boot: ## Label            Usage          Type ST Offset   Length
I (61) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (69) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (76) boot:  2 factory          factory app      00 00 00010000 00100000
I (84) boot: End of partition table
I (88) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x09fac ( 40876) map
I (111) esp_image: segment 1: paddr=0x00019fd4 vaddr=0x3ffb0000 size=0x02154 (  8532) load
I (115) esp_image: segment 2: paddr=0x0001c130 vaddr=0x40080000 size=0x00400 (  1024) load
I (118) esp_image: segment 3: paddr=0x0001c538 vaddr=0x40080400 size=0x03ad8 ( 15064) load
I (133) esp_image: segment 4: paddr=0x00020018 vaddr=0x400d0018 size=0x24bac (150444) map
I (188) esp_image: segment 5: paddr=0x00044bcc vaddr=0x40083ed8 size=0x049f8 ( 18936) load
I (196) esp_image: segment 6: paddr=0x000495cc vaddr=0x400c0000 size=0x00000 (     0) load
I (201) boot: Loaded app from partition at offset 0x10000
I (201) boot: Disabling RNG early entropy source...
I (206) cpu_start: Pro cpu up.
I (210) cpu_start: Starting app cpu, entry point is 0x40080e38
I (0) cpu_start: App cpu up.
I (220) heap_init: Initializing. RAM available for dynamic allocation:
I (227) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (233) heap_init: At 3FFBB930 len 000246D0 (145 KiB): DRAM
I (239) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (246) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (252) heap_init: At 400888D0 len 00017730 (93 KiB): IRAM
I (258) cpu_start: Pro cpu start user code
I (276) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (279) emac: mac version 1137a
I (279) emac: emac start !!!

I (279) emac: emac reset done
I (289) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
E (1299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (2299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (3299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (4299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (5299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (6299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (7299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (8299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (9299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (10299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (11299) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (12299) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff


patxitron

I guess I need to clarify one thing: My previous post is using your ESP-IDF example.

Best regards.

LubOlimex

Hey,

Can you share a picture of your hardware setup - Ethernet cables, board, etc

I feel like it might be too long or faulty Ethernet cable. The only similar thing that I found was this: https://github.com/espressif/arduino-esp32/issues/744

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

patxitron

Ok, I solved it. Still I don't know exactly how I have it done, but playing in the gtkterm with the DTR and RTS signals I have it working now.

Best regards.

meyer

Hello,

I have exact the same problem on win10, using actual esp-idf ethernet example with ESP32-OVB Rev C.
Settings:
CONFIG_PHY_TLK110=
CONFIG_PHY_LAN8720=y
CONFIG_PHY_ADDRESS=0
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=
CONFIG_PHY_SMI_MDC_PIN=23
CONFIG_PHY_SMI_MDIO_PIN=18

Have installed the drvier from olimex. Flashing works as expected, but when running I get this error:

I (294) emac: emac start !!!

I (294) emac: emac reset done
E (1304) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (2304) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (3304) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (4304) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (5304) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff

Also tried other valus for CONFIG_PHY_CLOCK

best regards, Frank



meyer

Solved it by using another usb port. It seems the one didnt have enough power.

Skippy

I have a very similar problem. At first I had the problem as described above, which I fixed by putting a powered USB hub between the computer and the board. It also works if I used my laptop rather than my desktop.

Now I get:

I (200) cpu_start: App cpu up.
I (220) heap_init: Initializing. RAM available for dynamic allocation:
I (226) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (232) heap_init: At 3FFBB9A0 len 00024660 (145 KiB): DRAM
I (239) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (245) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (251) heap_init: At 40088C30 len 000173D0 (92 KiB): IRAM
I (258) cpu_start: Pro cpu start user code
I (276) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (278) emac: mac version 1137a
I (278) emac: emac start !!!

I (278) emac: emac reset done
I (288) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (308) emac: emac start success !!!
I (4308) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (4308) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (4308) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (4308) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (4318) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (4328) emac: eth link_up!!!
E (4498) emac: emac rx buf err!!

E (4498) emac: emac rx buf err!!

E (6168) emac: emac rx buf err!!

I (6318) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (6318) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (6318) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (6318) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (6328) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
E (6728) emac: emac rx buf err!!

I (8328) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (8328) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (8328) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (8328) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (8338) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (10338) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (10338) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (10338) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (10338) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (10348) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (12358) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
I (12358) Olimex_ESP32_EVB_REV_B_eth_example: ETHIP:0.0.0.0
I (12358) Olimex_ESP32_EVB_REV_B_eth_example: ETHPMASK:0.0.0.0
I (12358) Olimex_ESP32_EVB_REV_B_eth_example: ETHPGW:0.0.0.0
I (12368) Olimex_ESP32_EVB_REV_B_eth_example: ~~~~~~~~~~~
E (12458) emac: emac rx buf err!!

E (13978) emac: emac rx buf err!!

and like that for ever. It never gets an IP address. The link lights are on, and I've tried different cables. Any ideas how I can get it to work?



Skippy

Also I tried an external power supply with no improvements

Skippy

I've solved my own problem, as it says elsewhere on this forum the version of this example program that comes with the Espressif IDF devkit works, the one on olimex's github doesn't.

emiguns

#11
Hi, my name is Emilio,
Could someone help me solve the problem of the mistake Emac timed out of PHY etc etc?
I am not very good at the card program evb-revC and use some samples with the IDE of Arduino.
Sometimes the board works properly and sometimes not.
I used a usb cable or a proper power supply but it is still same problem.
Greetings.

My error on serial display:

E (2247) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (3247) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (4247) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (5247) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (6247) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (7247) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (8247) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (9247) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
E (10247) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (11247) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
...............
...............

ashigupta

Hi,

I also facing the same problem
E (1346) emac: Timed out waiting for PHY register 0x2 to have value 0x0243(mask 0xffff). Current value 0xffff
E (2346) emac: Timed out waiting for PHY register 0x3 to have value 0x0c54(mask 0xfff0). Current value 0xffff
E (3346) emac: Timed out waiting for PHY register 0x2 to have value 0x0243(mask 0xffff). Current value 0xffff
E (4346) emac: Timed out waiting for PHY register 0x3 to have value 0x0c54(mask 0xfff0). Current value 0xffff
E (5346) emac: Timed out waiting for PHY register 0x2 to have value 0x0243(mask 0xffff). Current value 0xffff


Below is the configuration i am using in sdkconfig file

#
# Example Configuration
#
CONFIG_PHY_IP101=y
CONFIG_PHY_TLK110=
CONFIG_PHY_LAN8720=
CONFIG_PHY_ADDRESS=1
CONFIG_PHY_CLOCK_GPIO0_IN=
CONFIG_PHY_CLOCK_GPIO0_OUT=y
CONFIG_PHY_CLOCK_GPIO16_OUT=
CONFIG_PHY_CLOCK_GPIO17_OUT=
CONFIG_PHY_CLOCK_MODE=1
CONFIG_PHY_USE_POWER_PIN=
CONFIG_PHY_SMI_MDC_PIN=23
CONFIG_PHY_SMI_MDIO_PIN=18

If any one has solved this please let me know the possible solution.

LubOlimex

#13
@ashigupta Your configuration is totally NOT ok.

Try this:

CONFIG_PHY_TLK110=
CONFIG_PHY_LAN8720=y
CONFIG_PHY_ADDRESS=0
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=
CONFIG_PHY_SMI_MDC_PIN=23
CONFIG_PHY_SMI_MDIO_PIN=18

Read more here: https://github.com/OLIMEX/ESP32-EVB/issues/11
Technical support and documentation manager at Olimex