Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 9 months ago.
3G Modem and LwIP
Hi MBED folks,
I'm working on a small board I designed (for the MBED-LPC1768) which is basically just some peripherals (Accelerometer & USB) and a 1A power. On the USB port I'm plugging a 3G dongle (Huawei E372) which is perfectly detected and the Serial Streams are greatly created (I can send and receive AT Commands).
Now when I try to hook up the LwIP stuffs, nothing is behaving like I expect and I really hope someone have a clue about resolving this issue.
- What I see is the execution freezing in the middle of "somewhere" (no blue led of the death).
Here, When I init the LwIP Stack.
[USB_DBG: /src/Pyrn3GModem/PPPIPInterface.cpp:134]Trying to connect with PPP [USB_DBG: /src/Pyrn3GModem/ATCommandsInterface.cpp:268]Trying to read a new line from stream [USB_DBG: /src/Pyrn3GModem/PPPIPInterface.cpp:63]LwIP: Init Stack [USB_DBG: /src/Pyrn3GModem/USBSerialStream.cpp:81]Waiting for data availability -1 ms (-1 is infinite) [USB_DBG: /src/Pyrn3GModem/PPPIPInterface.cpp:65]LwIP: Wait for setup [USB_DBG: /src/Pyrn3GModem/PPPIPInterface.cpp:68]LwIP: setup done [USB_DBG: /src/Pyrn3GModem/USBSe // <<=== Middle of somewhere
- I can notice the RAM Usage is quite high 82%. I don't really know how this info is computed but something near 100% usage is alarming me (code static analysis??).
- When I reduce LwIP features (disabling DNS for instance) it goes further => To dialing. But unfortunately stops when the ppp writes/reads begins (sio_write/read).
- I'm Using http://developer.mbed.org/users/donatien/code/lwip_ppp_ethernet/ LwIP implementation.
- The PPP interface is fully inspired from http://developer.mbed.org/users/mbed_official/code/VodafoneUSBModem/.
- The 1A power does not seems to be causing the issue here.
Now, since tweeking the LwIP opts and disabling some features allows the code to run a little longer. I suspect missing RAM or something like that (maybe some threads requering memory for stack usage). Furthermore I could not find some option that greatly decrease the estimated RAM usage (always about 80->90%). Do you think I'm going in the right direction? Any idea of how can I track this weird bug?
Thank you very much for your time,
Regards, Clément
For those who have this kind of issue. I figured out that increasing the PPP_THREAD_STACKSIZE in lwipopts.h resolve the problem. My guess is that, when the thread got executed it could stack ovf and the behaviour is undefined when it try to switch to another thread. Not absolutely sure but it's the best explanation i have. Cheers, Clem
posted by Clément BENOIT 08 Apr 2015HEllo Clement,
I am interested as well about this subject. Could you please tell me what changes have you made on VodafoneUSBModem in order to work with that new version of 3G stick ?
Thank you ! Daniel
posted by Daniel Dumitru 22 Mar 2017