cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 lwip Ethernet connection problem

I've built an STM32F767 board on which I used the LAN8742 Phy chip as per the Nucleo board. The firmware is CubeMX derived with lwip and FreeRTOS used, and all IP addresses are static. If I connect my board to a 100 Mbit hub and a PC then I can sometimes connect and then get reliable comms between the PC and my board. The trouble is that after connecting a PC or a Raspberry Pi to my board directly it doesn't connect. LED2 is lit solidly and LED1 flashes rapidly.

Does anyone have any suggestions? Why does my Phy say the link is up but the Pi says it's down?

Is it worth trying to force the Pi to work at 100 Mbit?

8 REPLIES 8

Tumbleweed city I see :(

Hello

when need to connect devices with no auto MDI-X capability , an ethernet crossover cable is the solution for this.

pin 1 goes to pin 3 for both sides of the cable

pin 2 goes to pin 6 for both sides of cable

The problem seems almost to be the opposite, all the devices have auto MDI-X capability. Neither regular nor cross over cables work.

MS.9
Associate III

Unlike ST, Microchip (who make the Phy on the Nucleo) are being responsive and helpful! My current best theory based on their suggestions is that I'm blowing up the Phy because I'm using PoE where a cable disconnect can overvoltage the Phy pins connected to the magnetics. This would be consistent with getting a connection and then it all stops working.

The overvoltage occurs on cable disconnection when one pair pin disconnects before the other, which means the pair is no longer balanced. The recommended fix is to add bidirectional TVSs across the pairs on the Phy side to clamp the differential voltage to no more than 5V. I've ordered some TVSs so magnifiers and my finest soldering iron is on standby.

Piranha
Chief II

Initial problem was a not working condition with custom board connected directly to PC or RPi. You have not explained where and what type of PoE are involved. The standard (active) PoE PSE doesn't enable power supply until the negotiation is complete. And NUCLEO-144 boards already have TVS protection for Ethernet PHY.

Have you tested this?

https://community.st.com/s/question/0D50X0000AhNBoWSQW/actually-working-stm32-ethernet-and-lwip-demonstration-firmware

Provide a DHCP server from a PC or RPi and it should work. It can be done easily by connection sharing or TFTPD32.

Piranha, your thread is one of the most valuable on here and I've been through it several times. I've strapped protection to a fresh board and fired it up and it looks like the Phy is connecting (judging by lights and Phy register contents) which is a step forward. Still no pings at the moment though and wireshark shows my board isn't responding to the ARP request. I don't know where to look next to see what is or isn't happening.

My board is the PSE end and for testing I'm mostly connecting it to a DLink switch with everything having a static IPV4 address. Using DHCP on the Pi would mean the application having to go through some form of discovery to find my board, which is a minor complexity I wanted to avoid.

The ultimate goal is just to have my board and a Pi connected together with the Pi getting its power as a PoE PD device. Using a dedicated PSE chips seems to work a treat and I can see the negotiation happening.

Can I have my money back please. Clearly ST can't produce a working Ethernet implementation :(