ESP32-LAN8720 custom board: get no IP address
-
- Posts: 18
- Joined: Tue Apr 19, 2022 2:36 pm
Re: ESP32-LAN8720 custom board: get no IP address
I also tried to bridged the PMOS Q1, to power the LAN8720 together with the ESP32, so that after 200ms after ESP32-EN is high, only the oscillator is enabled and the analog switches connect REFCLOCKO to ESP32-GPIO0. Still no success.
-
- Posts: 211
- Joined: Fri May 07, 2021 10:35 am
Re: ESP32-LAN8720 custom board: get no IP address
Thanks for the detailed description. Sorry for misleading, I looked to the "WROOM" version and falsely considered it as the latest version . Last thing which crossed my mind related to HW is to double check the RJ45 part number. I noticed that there are two versions "SA" and "SB" and each one has different pinout (it already happened to me that the distributor screwed it up and sent different part).
Regarding debugging try the following, if you already didn't:
1) connect the board directly to computer (setup DHCP server on your computer)
2) if you are on Linux, run ethtool <name_of_your_eth_if> you should see result of autonegotiation, something like:
Settings for enx00e04c6801ac:
...
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
...
It should indicate the autonegotiation works
3) Try to capture some traffic on the interface connected to your board. Use Wireshark or tcpdump. You should see "DHCP Discover" message issued by your board.
4) Increase log level for "esp.emac" by
to see if EMAC is able to receive something (send some broadcast message from your computer with know Ethernet frame length).
Regarding debugging try the following, if you already didn't:
1) connect the board directly to computer (setup DHCP server on your computer)
2) if you are on Linux, run ethtool <name_of_your_eth_if> you should see result of autonegotiation, something like:
Settings for enx00e04c6801ac:
...
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
...
It should indicate the autonegotiation works
3) Try to capture some traffic on the interface connected to your board. Use Wireshark or tcpdump. You should see "DHCP Discover" message issued by your board.
4) Increase log level for "esp.emac" by
Code: Select all
esp_log_level_set("esp.emac", ESP_LOG_DEBUG);
-
- Posts: 18
- Joined: Tue Apr 19, 2022 2:36 pm
Re: ESP32-LAN8720 custom board: get no IP address
1. I can confirm, that the RJ45 connector is the SA part, with the "ARJP-11A MASA-B-A-EMU2" printed on the RJ45 connector. I measured the resistance and the inductance between the pads of the RJ45 connector, to be sure. I compared the values with a LAN8720 breakout board from waveshare, everything looked similar. We had not connected pin 7 of the RJ45 to GND, what seems to be a RF filter, so I soldered a wire from RJ45-pin7 to GND. But also no success.
2. here is the output of ethtool:
micha@iwan-ThinkPad-T440p:~/esp/eth_basic$ ethtool enp0s25
Settings for enp0s25:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Auto-negotiation: on
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
MDI-X: Unknown (auto)
netlink error: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: no
3. I used wireshark, but can not receive any message when I connect only the board to my PC, where a DHCP server ist installed. We also have a DHCP server running in our office network, and can not see any packet from the MAC address of our board. After reset-ing the ESP32 board, it should send an ARP message to the DHCP, but nothing.
Because the yellow LED is not blinking or lighting at all, and we can not see any message from the MAC of the ESP32 board, I would conclude that the problem will be before the link establishing.
I have attached the boot log, with the "esp_log_level_set("esp.emac", ESP_LOG_DEBUG);" called at the beginning in the main. But as said above, there seems no package send. Btw, I have set the log level to "verbose" in menuconfig.
2. here is the output of ethtool:
micha@iwan-ThinkPad-T440p:~/esp/eth_basic$ ethtool enp0s25
Settings for enp0s25:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Auto-negotiation: on
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
MDI-X: Unknown (auto)
netlink error: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: no
3. I used wireshark, but can not receive any message when I connect only the board to my PC, where a DHCP server ist installed. We also have a DHCP server running in our office network, and can not see any packet from the MAC address of our board. After reset-ing the ESP32 board, it should send an ARP message to the DHCP, but nothing.
Because the yellow LED is not blinking or lighting at all, and we can not see any message from the MAC of the ESP32 board, I would conclude that the problem will be before the link establishing.
I have attached the boot log, with the "esp_log_level_set("esp.emac", ESP_LOG_DEBUG);" called at the beginning in the main. But as said above, there seems no package send. Btw, I have set the log level to "verbose" in menuconfig.
- Attachments
-
- esp32_LAN8720_noIP_bootlog.txt
- (25.8 KiB) Downloaded 424 times
-
- Posts: 211
- Joined: Fri May 07, 2021 10:35 am
Re: ESP32-LAN8720 custom board: get no IP address
There must be something wrong between LAN8720 (including) and the RJ45 because it seems that even auto-negotiation does not work. There is no Link partner information and link is not detected in the report provided by ethtool. "Ethernet Link Up" is also missing in the ESP32 log you provided. Note that the link should be auto-negotiated without any intervention from ESP32 in your current HW design. However, could you please confirm by running some "Hello word" example on your WROOM version? You only need to modify it to enable RMII CLK (in the latest HW revision it is done automatically by HW).
-
- Posts: 18
- Joined: Tue Apr 19, 2022 2:36 pm
Re: ESP32-LAN8720 custom board: get no IP address
Hi ESP_ondrej,
after encircling the problem to the LAN8720 - RJ45 connector, we searched more around and found, that many others have similar problems with the LAN8720, where others finally ether gave up with the LAN8720 (https://www.crowdsupply.com/silicogniti ... reset-saga, now use a RTL8201), or moved from external clock oscillator to a ESP32-generated RMII clock (Olimex, who did finally 6 PCB revisions).
We have tried to reset the LAN8720 by a I2C port expander, but no success so far. Finally, we feel no longer confident with the LAN8720, and want to use an other PHY. What RMII PHY would you suggest for the ESP32-WROVER? I have seen a reference design from Espressif, what is using the IP101GRI. Would you suggest the IP101GRI? An other option would be the RTL8201, do you have experience with this as well?
after encircling the problem to the LAN8720 - RJ45 connector, we searched more around and found, that many others have similar problems with the LAN8720, where others finally ether gave up with the LAN8720 (https://www.crowdsupply.com/silicogniti ... reset-saga, now use a RTL8201), or moved from external clock oscillator to a ESP32-generated RMII clock (Olimex, who did finally 6 PCB revisions).
We have tried to reset the LAN8720 by a I2C port expander, but no success so far. Finally, we feel no longer confident with the LAN8720, and want to use an other PHY. What RMII PHY would you suggest for the ESP32-WROVER? I have seen a reference design from Espressif, what is using the IP101GRI. Would you suggest the IP101GRI? An other option would be the RTL8201, do you have experience with this as well?
-
- Posts: 211
- Joined: Fri May 07, 2021 10:35 am
Re: ESP32-LAN8720 custom board: get no IP address
Did you desolder R18 and pull RST low by adding 10k pull down resistor? Then wait for Phy_pwr (OSC is enabled), push RST to high and start Ethernet initialization.We have tried to reset the LAN8720 by a I2C port expander, but no success so far.
Regarding PHY chip suggestion, we use IP101 in our reference board. However, notice that we use separate GPIO to bring it out of reset. It is kept in reset to not produce RMII REFCLK during power-up.
-
- Posts: 18
- Joined: Tue Apr 19, 2022 2:36 pm
Re: ESP32-LAN8720 custom board: get no IP address
yes, we try to remove R18, and soldered an 10k resistor to GND. We soldered an pin from the I2C GPIO Expander to the reset input on the LAN8720, and switched that pin high after booting first with 1 second, then 10 seconds, but no IP address. We could see with the green LED in the RJ45 connector, that the reset was released after 1 and after 10 seconds. We also unsoldered the RJ45 connector with PoE(ARJP11A-MASA-B-A-EMU2), and soldered instead a Hanrun HR911105A, but also no success.
I think, we have to give up on the LAN8720. We have now made a schematic with an ESP32-WROVER and a IP101GR, and copied most from the Espressif Reference Schematic. Could I send you the new schematics, and ask you to look over the Ethernet part, if everything is correct?
I think, we have to give up on the LAN8720. We have now made a schematic with an ESP32-WROVER and a IP101GR, and copied most from the Espressif Reference Schematic. Could I send you the new schematics, and ask you to look over the Ethernet part, if everything is correct?
-
- Posts: 211
- Joined: Fri May 07, 2021 10:35 am
Re: ESP32-LAN8720 custom board: get no IP address
Yes, you can send me the schematics. I can give it a quick look.
However, your issue with LAN8720 is really strange. Could you please try to switch the LAN8720 to 10mbps mode (either by ESP or by boot strap resistors)? You could also check if R8-R11 have correct value. You could also try to generate some traffic on PC and measure signals at Eth_RD on scope. You can also try to switch LAN870 to loopback mode from ESP32 and send some L2 traffic, see example here https://github.com/espressif/esp-idf/bl ... tap.c#L164 how.
However, your issue with LAN8720 is really strange. Could you please try to switch the LAN8720 to 10mbps mode (either by ESP or by boot strap resistors)? You could also check if R8-R11 have correct value. You could also try to generate some traffic on PC and measure signals at Eth_RD on scope. You can also try to switch LAN870 to loopback mode from ESP32 and send some L2 traffic, see example here https://github.com/espressif/esp-idf/bl ... tap.c#L164 how.
-
- Posts: 18
- Joined: Tue Apr 19, 2022 2:36 pm
Re: ESP32-LAN8720 custom board: get no IP address
can I send you the schematic to your PM? Could you give me your email?
-
- Posts: 211
- Joined: Fri May 07, 2021 10:35 am
Re: ESP32-LAN8720 custom board: get no IP address
I sent you PM. Have you received it?
Who is online
Users browsing this forum: No registered users and 111 guests