cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure STM32F407VG for Ethernet with LAN8720A (PHY) using STM32CubeMX

Rick V.
Associate II

I have a development board (STM32F2(4)0x ETH CARD made by Mikroelectronica that has an STM32F407VG MCU and a built-in PHY using the LAN8720A. I cannot seem to figure out what I need to set in Cube MX in order to get the Ethernet port to connect to another computer.

Thanks to Piranha's comments, I mapped all signals from my MCU to the Ethernet jack. The signals that are not identified by CubeMX as being used are RXER, RST#, and nINT. Does anyone know what these might be used for and how to set them using CubeMX?

2 REPLIES 2
Piranha
Chief II

Ethernet PHY uses dedicated MDIO interface to configure registers. It has PHY addresses and is somewhat similar to I2C. Read RM0090 section 33.4.1 and LAN8720A datasheet sections 3.5 and 3.7 for more information. In your case PHY address should be 0. And even more important - the PHY on that board doesn't have it's own crystal/oscillator and nINTSEL strap is configured for external 50 MHz input from MCU's MCO output.

Thanks Piranha, I grabbed those documents, read the sections you outlined and I have to say, I asked for it, and I got it. I believe I'm a bit more confused than I was when I started. I used STM32CubeMX to generate the shell application. It is showing me all of the pins that are used and it all makes sense when I look at the schematic of the development board. The only one that doesn't make sense is the PB14_nINT signal. I see from the documents that this line directs where the clock comes from but the CubeMX doesn't use it. Could I simply be having a clock problem? I turned PB14 into a GPIO Output and set it low so that the PHY would take the clock from the MCO signal. That didn't work. I still get a "cable disconnected" indication on the PC side. Because I'm a first time, novice at this, I don't understand a lot of the internal working of the microcontroller. I did get the USB side to work and I can send and receive messages from the PC but I cannot get past first base with the Ethernet port. At this point, I don't even know what questions to ask.