cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f746 ETHERNET issue

clock.1166
Senior

Hi,

Could anyone help with this problem? Its driving me mad!!!

I have designed an ethernet interface  for an F746-100 MCU

I have changed pins to avoid using Port G and I have used the  circuit below.

The RJ45 connector is a standard RB1-125BAG1A and the ethernet chip is a LAN8742A

Can anyone tell me if there are any mistakes in this?

I cannot get any connection at all - F746-100 will not ping.

Green LED ON and Yellow LED flashes continuously.

I have an STM32F746 - 144 Nucleo with the same software (apart from the two pins that are changed) -works fine.

The 25MHz xtal works OK (same signal on both boards) and the LAN8742_STATUS_OK returns 0  on both boards when I debug.

There appears to be no errors in the setup LAN8742.c or the ethernetif.c when I debug. This code works OK on the NUCLEO board and I can display a small webpage. Both sets of code use only ETH and LWIP, fixed IP, on a standard Cubeide setup. I assume that the only difference is the two GPIO allocations (PG13>PB12 and PG11>PB11) which I have altered in software.

I have the same sort of signals on both boards on TXP/TXN/RXP/RXN

Can some kind soul tell me if there is anything obviously wrong with my hardware?

Thanks.

Chris

21 REPLIES 21
clock.1166
Senior

Hi STea,

Answers to your questions:

  1. verify if there is a change in the VDD level between the two boards . ** NUC VDD 3.3V    F746-100 3.27V
  2. check if you can visualize the signals from the TXD0 and TXD1 to see if there is traffic between the MCU and the LAN8742A ** Scope shows no signals on either, but there are signals on TD_P/N and RD_P/N
  3. try to read the status of  LAN8742A with the help of the init function api in LAN8742.c in run mode (toggle an LED when LAN8742_STATUS_OK returns 0 ) ** Always returns 0 -OK
  4. the RST pin in your design seems to be not connected can you give more info on it its not clear in the   picture ** ** Connected to 47K to VDD and 100nF to ground and MCU NRST pin. N/O switch to ground.
  5. can you give us information about the clock source feed to the MCU . **Looks fine - 50MHz 4V peak to peak sinewave.

Thanks again.

LCE
Principal

Let's hope the 50 MHz is a sine wave on your scope only due to bad probe / setup / scope.  ;)

I recommend not only checking the PHY register values by a HAL function's return value, check the PHY's register contents, and things like auto negotiation completed, 100M / 10M, full / half duplex.

clock.1166
Senior

Hi LCE,

The 50Mhz is referred to in sect 3.7.4 of LAN8742A spec.

 

'When configured for REF_CLK Out Mode, the device generates the 50 MHz RMII REF_CLK and the nINT interrupt is not available. REF_CLK Out Mode allows a low-cost 25 MHz crystal to be used as the reference for REF_CLK'.

I'm coming to the conclusion that my problems may be due to the relatively long test points on the 8742A chip and this may be causing reflections on the PCB?

I will check the things you have mentioned.

Thanks,

Chris

LCE
Principal

"relatively long test points on the 8742A chip"

whatever that means... screenshot?

clock.1166
Senior

Sorry!

I meant the tracks to my test points are longer than necessary.

I wondered whether this would cause H.F. ringing.

I have cut these tracks so there is minimal length between the LAN I/F and the MCU, but no change.

I have been running two IDE's one with a NUCLEO F746 and my own board F746-100 and  comparing the same basic software produced by STM32Cubeide.

Setup of LAN8742A  runs identically on both boards without errors and register values are identical.

Whatever I do, the green LED stays ON and the yellow led flashes regularly, even when I am stepping through the code from start to where it runs quite happily - while(1) {} etc. but LED's flashing the same and no ethernet.

If I reset the chip and restart debug there is a short delay then the lights flash again as above.

It must be a hardware problem, but I cant see what.

 

I just do not understand this.

I am going to battle on with this and when I sort it, I will post the whole project here to help some other unfortunates like me !!!!

Thanks.

 

 

LCE
Principal

Okay, so you checked the PHY registers.
Important question concerning at least the hardware / layout between PHY - transformer - RJ45:

Did the PHY finish auto-negotiation with the host? And did it "negotiate" 100M / full-duplex?

If yes, then this part is probably okay, and you have to check the connection between PHY - STM.

I would start "simple", checking all GPIOs and their alternate functions and speed settings, comparing all settings to the datasheet.
And then there is still the option of unsoldered pins, or solder bridges.

Ref clock from PHY = 50 MHz gets to the STM pin?

Hello @clock.1166 

LED's flushing like this is the expected behaviour .in fact the green LED in the Ethernet port indicates a successful connection to a network device, while the yellow LED indicates network activity or data transmission. When data is being transmitted, the yellow LED will blink or flash but it can be handled by the LAN8742A without the MCU intervening . so even if the firmware from MCU side is not working you will see those LEDs flashing indicating connection establishment on PHY level .

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
clock.1166
Senior

Thanks STea, I've learnt a bit more!

 

I've erased the MCU on both the Nucleo and the STM32F746-100.

 

The leds on the Nucleo flash green ON -  yellow flashing irregularly as normal.

The leds on the F746-100 flash green ON -  yellow flashing around 10Hz regularly.

Since there  is no software on either board, why are they different?

It must be something in the hardware?

Chris

 

clock.1166
Senior

JOY of JOYS!!!

A *** mistake -

4 resistors on Ethernet circuitry were incorrect.
I am not too familiar with SMD markings, and I wrongly assumed '4992' was 49.9 ohms, when in fact they are 49.9Kohms.
It was not possible to measure them on the board since they were across a coil.
I replaced them with 4 standard resistors and ethernet works OK!

Thank you all so much for helping me.

The circuit and the project I uploaded are guaranteed to work, so hopefully this will help others.

Chris

image.png

  

alleluia !  Very glad to see your tenacity and dedication to find it . @clock.1166  Well done !  
thank you again for all the sharing and experience with Community members .

Now , you can release your creativity!

Cheers,

STOne-32