Page 23 of 26

Re: STM32 Ethernet Demo

Posted: Sun Dec 09, 2012 4:53 pm
by DeusExMachina
ok, but may be some code cleanup needed...
I used 2.5.0 from git repo.
I changed only board.h and makefile in ARMCM4-STM32F407-LWIP demo.
In makefile I changed line 68 (link to discovery board)

Code: Select all

include $(CHIBIOS)/boards/ST_STM32F4_DISCOVERY/board.mk

After this i modified board.h in ST_STM32F4_DISCOVERY/board.h (in attachment)
After building and flashing you can go to http://192.168.1.20/ and see this text:
Welcome to our lwIP HTTP server!

This is a small test page.

Re: STM32 Ethernet Demo

Posted: Wed Dec 12, 2012 5:11 pm
by DeusExMachina
I think it will be more interesting to create more complicated web demo (like ST one). I'll try to port setting leds and ADC value output. May be it is worth to port some useful services, like tftp.

Re: STM32 Ethernet Demo

Posted: Wed Dec 12, 2012 6:42 pm
by Giovanni
That would be cool, the current web server is really minimal.

Giovanni

Re: STM32 Ethernet Demo

Posted: Thu Dec 13, 2012 7:12 am
by tkj
DeusExMachina wrote:I think it will be more interesting to create more complicated web demo (like ST one). I'll try to port setting leds and ADC value output. May be it is worth to port some useful services, like tftp.

Wait a minute. Then what about the tutorial on our blog?
That clearly describes how to get the STM32F4DISCOVERY board to work with an external Phy using the ST Webserver example.

Re: STM32 Ethernet Demo

Posted: Thu Dec 13, 2012 1:56 pm
by DeusExMachina
I mean using this stuff with Chibi, not FreeRTOS or bare API.

Re: STM32 Ethernet Demo

Posted: Wed Dec 19, 2012 6:07 pm
Hi ALL!

First of all thank you for bringing the ethernet functionality to Chibios/RT. It's very useful.
I have a couple o STM32F4DISCOVERY boards and a DP83848 connected to one of them.

I have started with ARMCM4-STM32F407-LWIP example changing it as described 3 posts earlier to let this work with my DISCOVERY board.
It was piece of cake. Everything have compiled, uploaded to MCU and started as it should.

The example page is available as it should. But unfortunately the amount of lost package is at about 40%. I have tested it with many examples:
1. simple pinging w/o any spiecial parameters
2. embeeded site request from my PCs web browser
3. written another example, which was requesting a HTTP GET from MCU to external server

In all cases the problem was exacly same: it is working fluently for ex. 10 seconds, then for 5 secs. nothing (pocket loss), again ok for some seconds, then again nothing form some seconds and all over again.
When everything is working ok- no packet loss (20s max), then it is working very fast.

I have tested it using the latest trunk of Chibios/RT and both LWIP 1.4.0 and .1.4.1. Whatever i do i am having very same problem: pocket flood, nothing, pocket flood, nothing......

Any ideas what to check?
Should i start separate thread for this problem?

Greetings
Piotr Klimczak

Re: STM32 Ethernet Demo

Posted: Wed Dec 19, 2012 6:52 pm
by Giovanni
Yes, this is something to be investigated.

Giovanni

Re: STM32 Ethernet Demo

Posted: Wed Jan 02, 2013 2:47 am
by rubenswerk
Hello and a happy new year!

I'm using lwip raw functions for UDP communication. To set it up, I do something like this at the begin of lwip_task:

Code: Select all

my_pcb = udp_new();
udp_bind(my_pcb, IP_ADDR_ANY, 12345);
udp_recv(my_pcb, my_UDP_receive_function, NULL);


udp_recv() registers a callback function for receiving incoming UDP packets.
In general, this works.
What I would like to know: which stack is used for the callback function? main stack, process stack, lwip_task stack... or does it depend on the actual program execution position at the moment when the MAC interrupt occurs?

Regards RuWe

Re: STM32 Ethernet Demo

Posted: Wed Jan 02, 2013 8:48 am
by Giovanni
Hi,

I think it is the lwIP's internal thread, its stack size is configured inside the lwIP configuration file.

Giovanni

Re: STM32 Ethernet Demo

Posted: Wed Jan 02, 2013 9:31 am
by mabl
You are using the lwip RAW API, which is forbidden when using LwIp with an operating system. You have to use netconn or sockets.