Page 7 of 9
Re: [INFO] lwIP version 2.0
Posted: Wed Oct 11, 2017 3:16 pm
by steved
This is my own application. Possibly the fact that I'm using sockets throughout masks an interfacing problem at the direct-to-lwIP level.
Marginally different board also - F429.
I'll try and dig out one of the boards supported by the demo and try that sometime.
Re: [INFO] lwIP version 2.0
Posted: Wed Oct 11, 2017 3:25 pm
by Giovanni
Thanks, I want to bring the whole thing to 17.6.x if it is stable enough.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Fri Oct 13, 2017 3:15 pm
by rasm
Hi,
When I submitted the patches I didn't use lwIP's embedded HTTP server for the demos because I thought that the existing code was more helpful for a beginner starting ChibiOS/lwIP development.
I attach a patch that should fix the LWIP_TCPIP_CORE_LOCKING issue. I've tested this patch with the Olimex E407 board and the demo works regardless of the LWIP_TCPIP_CORE_LOCKING value.
Re: [INFO] lwIP version 2.0
Posted: Fri Oct 13, 2017 6:18 pm
by steved
Interesting that I had quite unconsciously defined all these values in my own lwipopts.h file, so wouldn't have seen any problem!
A couple of differences between the two configuration files:
1. I found:
#define TCPIP_THREAD_STACKSIZE 550
was sufficient.
2. I've actually used higher thread priorities ATM:
This was a conscious change; whether it actually matters I'm not sure; will try and reducing this at some point.
Code: Select all
#define TCPIP_THREAD_PRIO (NORMALPRIO + 2) /* Increased from LOWPRIO + 1 */
#define LWIP_THREAD_PRIORITY (NORMALPRIO + 1) /* Increased from LOWPRIO */
I think I read somewhere (a long time ago) that the TCPIP thread needs a higher priority than the worker thread; not sure whether this is important.
Re: [INFO] lwIP version 2.0
Posted: Sun Oct 15, 2017 1:28 pm
by Giovanni
Changes committed, I also changed the relative priorities as suggested by steved but still based on LOWPRIO.
The settings in static_lwipopts.h can be overridden from lwipopts.h so it can be changed.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Wed Nov 15, 2017 9:55 pm
by steved
These changes also fix bug #824 (line 58 on in cc.h)
And probably bug #729 - the change as suggested in the bug tracker has been implemented (lwipthread.c line 365)
Re: [INFO] lwIP version 2.0
Posted: Thu Nov 30, 2017 10:55 am
by Giovanni
Thanks marked those as closed.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Mon Jan 01, 2018 4:24 pm
by Lucas
Hi!
I'm a beginner in lwip. The RT-STM32-LWIP-FATFS-USB demo works perfect at STM32F746 discovery.
(latest version 17.6.3, LWIP 2.0.3)
I have implemented MQTT app with official instructions (
http://www.nongnu.org/lwip/2_0_x/group__mqtt.html)
But I have issue witch memp_malloc as shown in attachment.
It returns NULL.
Have you implemented official MQTT app with success? Where should I look for a solution?
Thank you a lot.
Re: [INFO] lwIP version 2.0
Posted: Mon Jan 01, 2018 6:32 pm
by Giovanni
Hi,
Sorry, never used that, it could be a memory leak, for some reason elements are not returned to the pool.
Giovanni
Re: [INFO] lwIP version 2.0
Posted: Tue Mar 13, 2018 11:07 am
by ych
Giovanni wrote:I wanted to have httpd_opts.h in the application directory and I discovered:
1) httpd_opts.h is placed together with other headers, OK... let's rename it so it will find my copy.
2) httpd.c includes "lwip/apps/httpd.h" which includes "httpd_opts.h" (without path).
3) fs.c includes "lwip/apps/httpd_opts.h" (with path).
So you need to have both "./ext/lwip/src/include" (empty dir) and "./ext/lwip/src/include/lwip/apps" in your search path AND you cannot relocate the file. At very least I need to edit the inclusion in fs.c and rename httpd_opts.h in something else.
After advanced configuration of httpd application (custom file system, SSI, etc.), I found that if you want to have
httpd_opts.h in the application directory then it is not enough to patch
fs.c. You also need to patch
fsdata.h and
httpd.h:
Code: Select all
diff --git a/ext/lwip/src/apps/httpd/fsdata.h b/ext/lwip/src/apps/httpd/fsdata.h
index c004a3f..fc52fe0 100644
--- a/ext/lwip/src/apps/httpd/fsdata.h
+++ b/ext/lwip/src/apps/httpd/fsdata.h
@@ -32,7 +32,9 @@
#ifndef LWIP_FSDATA_H
#define LWIP_FSDATA_H
-#include "lwip/apps/httpd_opts.h"
+/* CHIBIOS FIX */
+//#include "lwip/apps/httpd_opts.h"
+#include "httpd_opts.h"
#include "lwip/apps/fs.h"
struct fsdata_file {
diff --git a/ext/lwip/src/include/lwip/apps/httpd.h b/ext/lwip/src/include/lwip/apps/httpd.h
index 57831dd..1ab58d2 100644
--- a/ext/lwip/src/include/lwip/apps/httpd.h
+++ b/ext/lwip/src/include/lwip/apps/httpd.h
@@ -41,7 +41,9 @@
#ifndef LWIP_HDR_APPS_HTTPD_H
#define LWIP_HDR_APPS_HTTPD_H
-#include "httpd_opts.h"
+/* CHIBIOS FIX */
+//#include "httpd_opts.h"
+#include <httpd_opts.h>
#include "lwip/err.h"
#include "lwip/pbuf.h"
But it seems dirty patches.
Why do we need to have exactly
httpd_opts.h in the application directory?
When
httpd_opts.h include
lwip/opt.h, and
lwip/opt.h include
lwipopts.h, which already in the application directory.
So for me, it will be much cleaner to put necessary redefinitions of default defines for httpd just in
lwipopts.h (as it seems was planned by developers of lwip). Or if someone wants to have httpd configuration in the separate file then just create some
lwiphttpdopts.h and include it from
lwipopts.h. Such implementation allows to remove ChibiOS specific path of
fs.c.