lwIP 50% packet loss Topic is solved

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

lwIP 50% packet loss

Post by Pethead »

Hello,

I'm using lwIP in a project to stream video from an ov7725 camera module over ethernet. However, sending the images over ethernet was really slow so I checked the connection and I can see that I'm losing about 50% of all the packets by just pinging the device.

I set up the web server demo again and I tried pinging the device to see if it was something with my program that was causing it and it wasn't. So right now I'm just running the web server demo and when I ping the device I'm losing about 50% of all the packets, any ideas why?

I'm using STM32F407 with LAN_8720A ethernet PHY (EasyMX Pro V7 Development board)

I've also tried increasing the TCPIP_MBOX_SIZE as mentioned in this thread and I don't think it's a clocking problem since the clock looks like stable 50 MHz.
Attachments
clock
clock
Running threads
Running threads
Packet loss
Packet loss
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: lwIP 50% packet loss

Post by Giovanni »

Hi,

Last time I tested there was no packet loss, it could be caused by external causes too.

Giovanni
Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

Re: lwIP 50% packet loss

Post by Pethead »

Any suggestions on how/where to start debugging this? I'm thinking that it's some kind setting in lwipopts.h but I might be wrong.
Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

Re: lwIP 50% packet loss

Post by Pethead »

When I configure the LAN8720A chip to work in 10 Mbit mode it works like a charm without any packet loss.

After all it was a clock problem, you can't use the MCO2 for some reason because it can't generate a good enough clock for the PHY. So now I have configured the MCO1 to generate a 50 MHz clock to the and it works in 100 Mbit mode. So now I don't have an 48 MHz clock signal for USB and other stuff.

If you look at my picture and compare it to the one in the first post you can see the difference between them.
Attachments
Working clock
Working clock
Pethead
Posts: 37
Joined: Mon Jul 11, 2016 1:47 pm
Has thanked: 1 time

Re: lwIP 50% packet loss

Post by Pethead »

The connection with the 50MHz signal generated on MCO1 from PLL was not good enough since it could not hold a stable connection speed, I'm assuming it generates too much jitter. It was solved by using a 50 MHz external crystal.
Post Reply