Page 9 of 26

Re: STM32 Ethernet Demo

Posted: Mon Mar 12, 2012 7:12 pm
by rubenswerk
I did another try with a ping utility, and it shows that most packets are replied within <1ms (average 0.68ms), but there are lots of packets with a response time >10ms.

I did this test with a direct point to point connection PC <-> Olimex board.

When I do the same measurement with my private network router, I get a very similar result.

If the MAC can store a maximum of 4 RX packets (I didn't change the config), how can the situation happen that I showed in my Wireshark capture - the answer to 10 packets all at once...!?

With this information in mind (4 RX buffers), I'm quite sure that the result of a PC based sniffer is quite unsure ;-)
Do you have good experience with Linux-based sniffers?

Re: STM32 Ethernet Demo

Posted: Mon Mar 12, 2012 7:34 pm
by Giovanni
I just retested it, pinging it with packets of 1024 bytes through my home router:

ping.jpg
ping.jpg (22.61 KiB) Viewed 6542 times


Do you have some process in your PC that could cause that? I also attached that very ancient ping utility but doubt it makes any difference.

Giovanni

Re: STM32 Ethernet Demo

Posted: Tue Mar 20, 2012 8:32 am
by mabl
Hi Giovanni,

I'm finally back from Australia and did give your new driver a quick test. It works, thank you so much! One thing I had to do was to activate software checksum calculation, any reason you don't do it in hardware?

Re: STM32 Ethernet Demo

Posted: Tue Mar 20, 2012 9:02 am
by Giovanni
Hi,

No particular reason, does lwIP support it? it could be eventually added as a configuration option to the driver. I stopped working on it waiting for feedback but it looks very stable.

Giovanni

Re: STM32 Ethernet Demo

Posted: Tue Mar 20, 2012 9:33 am
by mabl
Checksum calculation can be disabled in LwIP via the CHECKSUM_GEN_* macros. One problem we ran into early in this thread was wrong checksums in Ping packages - this is because the ICMP internal checksum cannot be disabled in lwip (which consequently messes up the hardware calculated checksum). Apart from this small patch on lwip - it works great with the wrapper driver.

Re: STM32 Ethernet Demo

Posted: Tue Mar 20, 2012 10:52 am
by Giovanni
I will add the option in the weekend but I think I will leave it disable by default in the demo or users would have to patch lwIP before being able to properly use it.

It would be good if lwIP maintainers add official support for automatic CRC in some future version.

Giovanni

Re: STM32 Ethernet Demo

Posted: Wed Mar 21, 2012 6:29 am
by mabl
Hallo Giovanni,

just an upgrade on this: In the trunk version of LwIP there is already a preprocessor switch CHECKSUM_GEN_ICMP and it will be included in lwip 1.4.1

http://lists.gnu.org/archive/html/lwip- ... 00018.html
http://git.savannah.gnu.org/cgit/lwip.g ... pv4/icmp.c

Re: STM32 Ethernet Demo

Posted: Wed Mar 21, 2012 9:06 am
by Giovanni
Excellent, we will make it default after integrating lwIP 1.4.1, is it already released?

Giovanni

Re: STM32 Ethernet Demo

Posted: Wed Mar 21, 2012 9:23 am
by mabl
No, but since it is only a bugfix release (and there is a newly updated 1.4.1 branch in the git repo) I suppose it's going to be released within the next weeks.

Re: STM32 Ethernet Demo

Posted: Wed Mar 21, 2012 9:29 am
by rubenswerk
I'm a little busy on other topics at the moment, but I had some time for hobby projects last weekend.

First of all, the STM32 lwIP demo (I took the latest trunk) seems to work fine, no problems at all. However, as mabl stated out, I would appreciate to have an option for hardware checksum. I would be sad to loose this very nice feature which was already working stable.

About my ping problem: thanks again Giovanni for the hint with other processes. I had an application running which does not cause any network traffic and only very low CPU load, but however, it's the root cause for the delayed packages. Without this process, the maximum ping time is 2ms after 1 hour of permanent high-speed pinging. For me, this is the proof that the timestamps of the pcap driver used by Wireshark are not reliable! It shows when my application called the send() function, but not when the OS actually transmitted the frame. I'm happy to know that there's no problem on the STM32 side.

In the meantime I received my STM32F4 Discovery board (sorry for being off topic). It was so easy to get the ChibiOS demo running on it. This is a perfect base for further developments, thank you Giovanni for providing this convenient example.

The native MAC driver, should it also work for the F4 peripheral? I ordered the Chinese PHY board and want to give it a try with the Discovery board. I'm afraid this will be quite challenging for me, I have to step quite deep into the ChibiOS configuration. Which approach would you recommend - shall I use the STM32F107 lwIP demo and adopt it to the F4 board, or shall I use the F4 demo as basis and add all the network stuff?

Kind regards, Ruwe