ESP32-LAN8720 custom board: get no IP address
Posted: Thu Jul 28, 2022 4:20 pm
Dear all,
we made a custom board, where we now have the 3th revision. The ESP32-WROVER is connected via RMII to a LAN8720. The earlier Revisions had an ESP32-WROOM, and the Ethernet always came up. We used an 74LVC1G3157 analog switch between GPIO0on the ESP32, and the REFCLOCKO on the LAN8720, in all 3 versions. The difference between the last revision (with working Ethernet) and this revision is, that in the last revision the analog switch was activated by a ESP32-GPIO, and now by a reset monitor, what enables the analog switch 200ms after the ESP32-EN lines goes high.
The ESP32 scan some pins, like GPIO0 after boot, to enter bootloader mode or override intern settings. That's why the REFCLOCKO can not be hard wired from the LAN8720, but instead is delayed activated. But that all look ok, and I am not sure if this is the reason, why we not get an IP address.
I flashed the example from ../esp/esp-idf/examples/ethernet/basic on the board, and here is the output:
.....
D (1439) efuse: In EFUSE_BLK0__DATA1_REG is used 8 bits starting with 0 bit
D (1449) efuse: In EFUSE_BLK0__DATA2_REG is used 8 bits starting with 16 bit
D (1469) esp_eth: new ethernet driver @0x3ffbd4c4
I (1469) esp_eth.netif.netif_glue: 4c:75:25:5b:c6:db
I (1469) esp_eth.netif.netif_glue: ethernet attached to netif
D (1469) esp_eth: ---> esp_eth_start after -> ESP_GOTO_ON_FALSE(eth_driver, ESP_ERR_INVALID_ARG, err, TAG, ...);
D (1479) esp_eth: ---> esp_eth_start after atomic_compare_exchange_strong
D (5489) esp_eth: ---> esp_eth_start after phy->negotiate
D (5489) event: running post ETH_EVENT:0 with handler 0x400d9d20 and context 0x3ffbd590 on loop 0x3ffb8dcc
0x400d9d20: eth_action_start at /home/micha/esp/esp-idf/components/esp_eth/src/esp_eth_netif_glue.c:125
D (5489) esp_eth.netif.netif_glue: eth_action_start: 0x3ffbd538, 0x3f406048, 0, 0x3ffbd6d8, 0x3ffbd4c4
D (5499) esp_netif_handlers: esp_netif action has started with netif0x3ffb9cf8 from event_id=0
D (5509) esp_netif_lwip: check: remote, if=0x3ffb9cf8 fn=0x400dc25c
0x400dc25c: esp_netif_start_api at /home/micha/esp/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:700
D (5509) esp_eth: ---> esp_eth_start after esp_event_post
D (5509) esp_netif_lwip: esp_netif_start_api 0x3ffb9cf8
D (5519) esp_netif_lwip: esp_netif_get_hostname esp_netif:0x3ffb9cf8
D (5529) esp_netif_lwip: check: local, if=0x3ffb9cf8 fn=0x400dcb18
0x400dcb18: esp_netif_update_default_netif_lwip at /home/micha/esp/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:188
D (5539) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3ffb9cf8
V (5539) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3ffb9cf8
D (5549) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (5559) event: running post ETH_EVENT:0 with handler 0x400d6724 and context 0x3ffbd698 on loop 0x3ffb8dcc
0x400d6724: eth_event_handler at /home/micha/esp/eth_basic/main/ethernet_example_main.c:45
I (5569) eth_example: Ethernet Started
D (5569) esp_eth: ---> esp_eth_start after get_link
D (5579) esp_eth: ---> esp_eth_start after esp_timer_start_periodic
After the code ->eth_example: Ethernet Started<- is reached, it wait forever to receive the IP address.
The switch, where the ESP32 is connected with a Ethernet cable, does not show a device present. The green LED on the RJ45 connector on the ESP32 board light permanent, the orange LED blinks after power on or reset and is then off. The LEDs are controlled by the LAN8720
Does somebody have an idea, what could be the reason for the error? We have triple checked the hardware, and can not see why it should not work. Any hint is highly welcome.
we made a custom board, where we now have the 3th revision. The ESP32-WROVER is connected via RMII to a LAN8720. The earlier Revisions had an ESP32-WROOM, and the Ethernet always came up. We used an 74LVC1G3157 analog switch between GPIO0on the ESP32, and the REFCLOCKO on the LAN8720, in all 3 versions. The difference between the last revision (with working Ethernet) and this revision is, that in the last revision the analog switch was activated by a ESP32-GPIO, and now by a reset monitor, what enables the analog switch 200ms after the ESP32-EN lines goes high.
The ESP32 scan some pins, like GPIO0 after boot, to enter bootloader mode or override intern settings. That's why the REFCLOCKO can not be hard wired from the LAN8720, but instead is delayed activated. But that all look ok, and I am not sure if this is the reason, why we not get an IP address.
I flashed the example from ../esp/esp-idf/examples/ethernet/basic on the board, and here is the output:
.....
D (1439) efuse: In EFUSE_BLK0__DATA1_REG is used 8 bits starting with 0 bit
D (1449) efuse: In EFUSE_BLK0__DATA2_REG is used 8 bits starting with 16 bit
D (1469) esp_eth: new ethernet driver @0x3ffbd4c4
I (1469) esp_eth.netif.netif_glue: 4c:75:25:5b:c6:db
I (1469) esp_eth.netif.netif_glue: ethernet attached to netif
D (1469) esp_eth: ---> esp_eth_start after -> ESP_GOTO_ON_FALSE(eth_driver, ESP_ERR_INVALID_ARG, err, TAG, ...);
D (1479) esp_eth: ---> esp_eth_start after atomic_compare_exchange_strong
D (5489) esp_eth: ---> esp_eth_start after phy->negotiate
D (5489) event: running post ETH_EVENT:0 with handler 0x400d9d20 and context 0x3ffbd590 on loop 0x3ffb8dcc
0x400d9d20: eth_action_start at /home/micha/esp/esp-idf/components/esp_eth/src/esp_eth_netif_glue.c:125
D (5489) esp_eth.netif.netif_glue: eth_action_start: 0x3ffbd538, 0x3f406048, 0, 0x3ffbd6d8, 0x3ffbd4c4
D (5499) esp_netif_handlers: esp_netif action has started with netif0x3ffb9cf8 from event_id=0
D (5509) esp_netif_lwip: check: remote, if=0x3ffb9cf8 fn=0x400dc25c
0x400dc25c: esp_netif_start_api at /home/micha/esp/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:700
D (5509) esp_eth: ---> esp_eth_start after esp_event_post
D (5509) esp_netif_lwip: esp_netif_start_api 0x3ffb9cf8
D (5519) esp_netif_lwip: esp_netif_get_hostname esp_netif:0x3ffb9cf8
D (5529) esp_netif_lwip: check: local, if=0x3ffb9cf8 fn=0x400dcb18
0x400dcb18: esp_netif_update_default_netif_lwip at /home/micha/esp/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:188
D (5539) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3ffb9cf8
V (5539) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3ffb9cf8
D (5549) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (5559) event: running post ETH_EVENT:0 with handler 0x400d6724 and context 0x3ffbd698 on loop 0x3ffb8dcc
0x400d6724: eth_event_handler at /home/micha/esp/eth_basic/main/ethernet_example_main.c:45
I (5569) eth_example: Ethernet Started
D (5569) esp_eth: ---> esp_eth_start after get_link
D (5579) esp_eth: ---> esp_eth_start after esp_timer_start_periodic
After the code ->eth_example: Ethernet Started<- is reached, it wait forever to receive the IP address.
The switch, where the ESP32 is connected with a Ethernet cable, does not show a device present. The green LED on the RJ45 connector on the ESP32 board light permanent, the orange LED blinks after power on or reset and is then off. The LEDs are controlled by the LAN8720
Does somebody have an idea, what could be the reason for the error? We have triple checked the hardware, and can not see why it should not work. Any hint is highly welcome.