Can't get LAN8720 fully working
Posted: Fri Jan 19, 2018 11:09 pm
I am using LAN8720A along with ESP-WROOM-32 on our custom PCB.
Clock is generated by GPIO17 and connected to GPIO0 and XTAL1.
I'm using the ethernet_example source with the current version of ESP-IDF
LAN8720A works fine when using the serial management commands.
But TCP/IP does not work at all.
I am not sure whether it's a h/w or s/w problem.
The lines RXDx / TXDx / CRS / show no activity (viewed with scope) when the transformer is connected to an ethernet line that carries some traffic to other tcp/ip-devices.
Shouldn't RXD0 / 1 at least show some activity then ?
The clock signal amplitude is 1.2Vpp. Is that perhaps too small for GPIO0 ?
I expected it to be near 3.3Vp since GPIO17 is powerful enough.
At least it's large enough for LAN8720A
This is the verbose log:
Perhaps there's a difference?
Or are there any other issues that I may have overlooked?
Clock is generated by GPIO17 and connected to GPIO0 and XTAL1.
I'm using the ethernet_example source with the current version of ESP-IDF
LAN8720A works fine when using the serial management commands.
But TCP/IP does not work at all.
I am not sure whether it's a h/w or s/w problem.
The lines RXDx / TXDx / CRS / show no activity (viewed with scope) when the transformer is connected to an ethernet line that carries some traffic to other tcp/ip-devices.
Shouldn't RXD0 / 1 at least show some activity then ?
The clock signal amplitude is 1.2Vpp. Is that perhaps too small for GPIO0 ?
I expected it to be near 3.3Vp since GPIO17 is powerful enough.
At least it's large enough for LAN8720A
This is the verbose log:
- I (415) eth_example: ---starting
D (415) emac: EMAC 50MHz inverted clock output on GPIO17
I (415) eth_example: ---eth_gpio_config_rmii
I (415) emac: mac version 1137a
I (415) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
V (425) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (435) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (445) intr_alloc: Connected src 38 to int 13 (cpu 0)
I (445) emac: emac start !!!
I (445) emac: emac reset done
D (455) lan8720: phy_lan8720_init()
D (455) lan8720: LAN8720 Registers:
D (455) lan8720: BCR 0x3000
D (465) lan8720: BSR 0x7809
D (465) lan8720: PHY1 0x0007
D (465) lan8720: PHY2 0xc0f1
D (465) lan8720: ANAR 0x01e1
D (475) lan8720: ANLPAR 0x0001
D (475) lan8720: ANER 0x0000
D (475) lan8720: MCSR 0x0000
D (485) lan8720: SM 0xffff
D (485) lan8720: SECR 0x0000
D (485) lan8720: CSIR 0xffff
D (485) lan8720: ISR 0xffff
D (495) lan8720: IMR 0x0040
D (495) lan8720: PSCSR 0x0002
D (505) event: SYSTEM_EVENT_ETH_START
V (505) event: enter default callback
I (505) emac: emac start success !!!
I (505) eth_example: ---esp_eth_enable
D (505) tcpip_adapter: check: local, if=2 fn=0x400f2208
D (515) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (525) tcpip_adapter: check: remote, if=2 fn=0x400f2208
V (525) event: exit default callback
D (2505) phy_common: phy_mii_check_link_status(DOWN)
D (4505) phy_common: p
hy_mii_check_link_status(UP)
D (4505) lan8720: LAN8720 Registers:
D (4505) lan8720: BCR 0x3100
D (4505) lan8720: BSR 0x782d
D (4505) lan8720: PHY1 0x0007
D (4505) lan8720: PHY2 0xc0f1
D (4505) lan8720: ANAR 0x0de1
D (4515) lan8720: ANLPAR 0xcde1
D (4515) lan8720: ANER 0x000b
D (4515) lan8720: MCSR 0x0000
D (4515) lan8720: SM 0xffff
I (4525) eth_example: ~~~~~~~~~~~
D (4525) lan8720: SECR 0x0009
D (4525) lan8720: CSIR 0xffff
I (4535) eth_example: ETHIP:0.0.0.0
D (4535) lan8720: ISR 0xffff
D (4535) lan8720: IMR 0x0040
D (4545) lan8720: PSCSR 0x0002
I (4545) eth_example: ETHPMASK:0.0.0.0
D (4545) lan8720: phy_lan8720_get_duplex_mode(FULL)
I (4555) eth_example: ETHPGW:0.0.0.0
D (4555) lan8720: phy_lan8720_get_speed_mode(100)
D (4555) phy_common: phy_mii_get_partner_pause_enable(TRUE)
I (4565) eth_example: ~~~~~~~~~~~
D (4565) lan8720: phy_lan8720_get_duplex_mode(FULL)
I (4575) emac: eth link_up!!!
D (4575) lan8720: LAN8720 Registers:
D (4575) lan8720: BCR 0x3100
D (4585) lan8720: BSR 0x782d
D (4585) lan8720: PHY1 0x0007
D (4585) lan8720: PHY2 0xc0f1
D (4585) lan8720: ANAR 0x0de1
D (4595) lan8720: ANLPAR 0xcde1
D (4595) lan8720: ANER 0x0009
D (4595) lan8720: MCSR 0x0000
D (4605) lan8720: SM 0xffff
D (4605) lan8720: SECR 0x0009
D (4605) lan8720: CSIR 0xffff
D (4605) lan8720: ISR 0xffff
D (4615) lan8720: IMR 0x0040
D (4615) lan8720: PSCSR 0x0002
D (4615) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (4625) lan8720: phy_lan8720_get_speed_mode(100)
D (4625) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (4635) lan8720: phy_lan8720_get_duplex_mode(FULL)
[...]
D (4765) lan8720: LAN8720 Registers:
D (4765) lan8720: BCR 0x3100
D (4765) lan8720: BSR 0x782d
D (4775) lan8720: PHY1 0x0007
D (4775) lan8720: PHY2 0xc0f1
D (4775) lan8720: ANAR 0x0de1
D (4775) lan8720: ANLPAR 0xcde1
D (4785) lan8720: ANER 0x0009
D (4785) lan8720: MCSR 0x0000
D (4785) lan8720: SM 0xffff
D (4795) lan8720: SECR 0x0009
D (4795) lan8720: CSIR 0xffff
D (4795) lan8720: ISR 0xffff
D (4795) lan8720: IMR 0x0040
D (4805) lan8720: PSCSR 0x0002
D (4805) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (4805) lan8720: phy_lan8720_get_speed_mode(100)
D (4815) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (4815) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (4825) lan8720: LAN8720 Registers:
D (4825) lan8720: BCR 0x3100
D (4835) lan8720: BSR 0x782d
D (4835) lan8720: PHY1 0x0007
D (4835) lan8720: PHY2 0xc0f1
D (4835) lan8720: ANAR 0x0de1
D (4845) lan8720: ANLPAR 0xcde1
D (4845) lan8720: ANER 0x0009
D (4845) lan8720: MCSR 0x0000
D (4855) lan8720: SM 0xffff
D (4855) lan8720: SECR 0x0009
D (4855) lan8720: CSIR 0xffff
D (4855) lan8720: ISR 0xffff
D (4865) lan8720: IMR 0x0040
D (4865) lan8720: PSCSR 0x0002
D (4865) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (4875) lan8720: phy_lan8720_get_speed_mode(100)
D (4875) phy_common: phy_mii_get_partner_pause_enable(TRUE)
D (4885) lan8720: phy_lan8720_get_duplex_mode(FULL)
D (4885) event: SYSTEM_EVENT_ETH_CONNECETED
V (4895) event: enter default callback
D (4895) tcpip_adapter: check: local, if=2 fn=0x400f2420
D (4895) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (4905) tcpip_adapter: check: remote, if=2 fn=0x400f2420
D (4905) tcpip_adapter: check: local, if=2 fn=0x400f2798
D (4915) tcpip_adapter: dhcp client init ip/mask/gw to all-0
D (4925) tcpip_adapter: if2 start ip lost tmr: enter
D (4925) tcpip_adapter: if2 start ip lost tmr: only sta support ip lost timer
D (4935) tcpip_adapter: dhcp client start successfully
D (4935) tcpip_adapter: call api in lwip: ret=0x0, give sem
D (4945) tcpip_adapter: check: remote, if=2 fn=0x400f2798
V (4945) event: exit default callback
D (6505) phy_common: phy_mii_check_link_status(UP)
I (6575) eth_example: ~~~~~~~~~~~
I (6575) eth_example: ETHIP:0.0.0.0
I (6575) eth_example: ETHPMASK:0.0.0.0
I (6575) eth_example: ETHPGW:0.0.0.0
I (6575) eth_example: ~~~~~~~~~~~
Perhaps there's a difference?
Or are there any other issues that I may have overlooked?