ESP32 can't talk to LAN8270 <SOLVED>
Posted: Mon Apr 08, 2019 8:02 pm
Not sure why I'm having a problem with this board a friend made. I'm running the ethernet_example in the IDF. I've checked and double checked that MDIO and MDC are the correct assigned pins. Not control over PHY power. I've included a scope capture that seems to indicate properly data coming from the ESP32. But the LAN8270 is not responding. Just a bunch of timeouts with register reading 0xffff on init.
I'm not expecting that with this info someone can debug the board. But was hoping that maybe somebody knew about some "gotchas" that may be impeding my progress. It appears the next step is to examine the LAN8270 and see if something is wrong with it.
John A
The init procedure writes to reg 2 & 3. The scope capture appears to be addressing reg2. It appears to have 32 ones, then SOF 01, then OPCODE 10, then PHY addr all ones, then register addr 2. It seems to release the bus and the signal is pulled high. Doesn't seem to obey the turnaround of two zeros. But maybe that's because MDIO is being pulled high.(296) emac: emac resetting ....
I (296) emac: emac reset done
D (296) lan8720: phy_lan8720_init()
D (306) lan8720: LAN8720 Registers:
D (306) lan8720: BCR 0xffff
D (306) lan8720: BSR 0xffff
D (316) lan8720: PHY1 0xffff
D (316) lan8720: PHY2 0xffff
D (316) lan8720: ANAR 0xffff
D (326) lan8720: ANLPAR 0xffff
D (326) lan8720: ANER 0xffff
D (326) lan8720: MCSR 0xffff
D (336) lan8720: SM 0xffff
D (336) lan8720: SECR 0xffff
D (336) lan8720: CSIR 0xffff
D (346) lan8720: ISR 0xffff
D (346) lan8720: IMR 0xffff
D (346) lan8720: PSCSR 0xffff
E (1356) emac: Timed out waiting for PHY register 0x2 to have value 0x0007 (mask 0xffff). Current value 0xffff
E (2356) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0 (mask 0xfff0). Current value 0xffff
I'm not expecting that with this info someone can debug the board. But was hoping that maybe somebody knew about some "gotchas" that may be impeding my progress. It appears the next step is to examine the LAN8270 and see if something is wrong with it.
John A