STM32 Ethernet Demo

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome.
User avatar
DeusExMachina
Posts: 215
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: STM32 Ethernet Demo

Postby DeusExMachina » Sun Dec 09, 2012 4:53 pm

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.
Attachments
board.h.zip
(6.17 KiB) Downloaded 817 times

User avatar
DeusExMachina
Posts: 215
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: STM32 Ethernet Demo

Postby DeusExMachina » Wed Dec 12, 2012 5:11 pm

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.

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

Re: STM32 Ethernet Demo

Postby Giovanni » Wed Dec 12, 2012 6:42 pm

That would be cool, the current web server is really minimal.

Giovanni

tkj
Posts: 11
Joined: Tue Oct 30, 2012 11:46 pm

Re: STM32 Ethernet Demo

Postby tkj » Thu Dec 13, 2012 7:12 am

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.

User avatar
DeusExMachina
Posts: 215
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: STM32 Ethernet Demo

Postby DeusExMachina » Thu Dec 13, 2012 1:56 pm

I mean using this stuff with Chibi, not FreeRTOS or bare API.

nannou9@gmail.com
Posts: 33
Joined: Sat Aug 25, 2012 9:53 pm
Been thanked: 1 time
Contact:

Re: STM32 Ethernet Demo

Postby nannou9@gmail.com » 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

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

Re: STM32 Ethernet Demo

Postby Giovanni » Wed Dec 19, 2012 6:52 pm

Yes, this is something to be investigated.

Giovanni

rubenswerk
Posts: 94
Joined: Wed Feb 22, 2012 11:39 am
Location: Austria

Re: STM32 Ethernet Demo

Postby rubenswerk » Wed Jan 02, 2013 2:47 am

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

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

Re: STM32 Ethernet Demo

Postby Giovanni » Wed Jan 02, 2013 8:48 am

Hi,

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

Giovanni

mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Location: Karlsruhe, Germany
Been thanked: 1 time
Contact:

Re: STM32 Ethernet Demo

Postby mabl » Wed Jan 02, 2013 9:31 am

You are using the lwip RAW API, which is forbidden when using LwIp with an operating system. You have to use netconn or sockets.


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 1 guest