lwIP 50% packet loss Topic is solved

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

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

lwIP 50% packet loss  Topic is solved

Postby Pethead » Mon Mar 06, 2017 12:06 pm

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_50MHz.jpg
clock
threads.png
Running threads
packetloss.png
Packet loss

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: lwIP 50% packet loss

Postby Giovanni » Mon Mar 06, 2017 12:08 pm

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

Postby Pethead » Mon Mar 06, 2017 12:29 pm

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

Postby Pethead » Mon Mar 06, 2017 3:44 pm

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
IMG_20170306_154858.jpg
Working clock

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

Re: lwIP 50% packet loss

Postby Pethead » Fri Mar 10, 2017 9:18 am

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.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 14 guests