2024-01-28 06:19 AM - last edited on 2024-01-30 01:04 AM by SofLit
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
Solved! Go to Solution.
2024-01-30 07:06 AM
Hi STea,
Answers to your questions:
Thanks again.
2024-01-30 08:22 AM
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.
2024-01-31 03:44 AM
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
2024-01-31 07:45 AM
"relatively long test points on the 8742A chip"
whatever that means... screenshot?
2024-01-31 09:23 AM
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.
2024-02-01 01:09 AM - edited 2024-02-01 01:09 AM
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?
2024-02-01 03:10 AM
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
2024-02-01 04:28 AM
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
2024-02-01 06:55 AM
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
2024-02-01 02:03 PM
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