10 years, 8 months ago.

lwip raw example

Can someone provide an example for using the new ethernet interface library with NO_SYS = 1 option, i.e. "raw" lwip without rtos?

1 Answer

10 years, 8 months ago.

I have not tried with the new library, but the Server example originally published by Michael Wei, gives examples of how to use Raw API with mbed.

This relies on mbed library 26. To try with later library, you must at least change the file device.h to another name, to avoid conflict with the newer libraries.

http://mbed.org/users/RodColeman/code/LwIP_raw_API_serverExample/

I developed this example very much - for use as a fast TCP client, and it has worked reliably. (I have had no success with the HTTP client layers in the cookbook - both new and old versions are unsuitable for production, IME)

Accepted Answer

Hi Rod. I have started a project based on mbed hardware but I have not used mbed library. I need to add raw lwIP support but I need to minimize the code overhead caused when whole mbed library is include. Where can I download source of mbed library 26? I would like to get a clean and light weight compilation of you project. I would appreciate some other suggestions Best.

posted by sergio acosta 16 Feb 2014

Hi Sergio, If you import this programme: http://mbed.org/users/RodColeman/code/LwIP_raw_API_serverExample/ you will have mbed library 26 ready to use. this may cause difficulties with maintaining the code, but it does allow you to try out the raw LwIP API. This code is very reliable, and much lighter weight than any http client or server layers.

posted by Rod Coleman 17 Feb 2014

Thanks for your answer Rod. I like that reliable part. Just a couple of questions: just for getting clearness ,Is the ethernetif implementation (lpc_phy_dp83848, lpc17_emac....) ready on mbed library 26? Where is sys_now() implemented? thanks in advance foyr help

posted by sergio acosta 19 Feb 2014

Sergio, the ethernet i/f works very well, PHY and EMAC. I have not looked for sys_now - but you can select the project (in your compiler screen) and do and ADVANCED search for it.

posted by Rod Coleman 19 Feb 2014

I have already looked for sys_now. This is declared in sys.h but this is not defined anywhere. I think this must be encapsulated in mbed library. Thanks again Rod.

posted by sergio acosta 20 Feb 2014

Checking out your example code, It seems that sys_now() is not used.Ticker objects are used for lwIP stack periodic calls. This is getting clearer.

posted by sergio acosta 20 Feb 2014