Commit Graph

29 Commits (511df14eb0419ded01888022959d6eeb8f32d6b4)

Author SHA1 Message Date
Veijo Pesonen a7ef67a92a fixup! LWIP PBUF_POOL_BUFSIZE increased to fit also IPv6 header 2018-02-21 08:25:46 +02:00
Veijo Pesonen e1d9d8783d LWIP PBUF_POOL_BUFSIZE increased to fit also IPv6 header
IPv6 header requires 20 more bytes compared to IPv4 header.
2018-02-20 15:45:44 +02:00
Kevin Bracey cd06ebb3c7 lwIP: Add memory configs to JSON
We currently set the lwIP pbuf pool size small - to 5 x 576-byte
buffers.

This is insufficient to hold a single DTLS handshake flight, so can
cause cloud client connections to fail. STM-based platforms are failing
handshake because of this. (K64F works because it doesn't use the pbuf
pool for reception, but lwIP does recommend drivers use the pbuf pool).

Not changing the default memory sizes here, as intended for a patch
release, but adding mbed configuration options to allow the numbers to
be adjusted for memory tuning in an application.

In a future minor revision, I would recommend increasing the default
PBUF_POOL_SIZE - we are well below lwIP's out-of-the-box default - and
offsetting by a reduction in MEM_SIZE for the drivers that don't use
PBUF_RAM.
2017-10-10 11:34:21 +03:00
Jimmy Brisson 84a28adc09 Merge pull request #4997 from kjbracey-arm/lwip_debug
Correct LWIP_DEBUG definition
2017-09-05 11:19:13 -05:00
Kevin Bracey 5a7405e1a3 Correct LWIP_DEBUG definition
Commit f602c936 incorrectly started defining LWIP_DEBUG as either 0 or
1.

lwipopts.h locally was changed to use #if, but all existing users
continued to use #ifdef. Therefore defining it to 0 was accidentally
enabling it for quite a few users.

This would have pulled in some unwanted lwIP code, and affected some
drivers, eg k64f_emac.c allocating an extra 2K of stack.

Correct lwipopts.h to either define it as 1 or leave it undefined, and
change the #if tests back to #ifdef, so all are consistent.
2017-08-31 11:51:10 +03:00
Mika Leppänen 2adbf721d2 Added dual Ipv4/Ipv6 stack support to lwip address configuration
Added new configuration option "both-addr-timeout" that defines
how long to wait that addresses from both systems become available.
2017-08-22 13:14:40 +03:00
Mika Leppänen 23f8ac903e Removed random and tcp_isn modules header dependencies to lwip conf 2017-08-22 10:17:20 +03:00
Rob Meades 921d1fa6fa Increase PPP stack size from 512 bytes to 768 bytes.
PPP is running close to the edge of its default thread stack size of 512 bytes. When it experiences an FCS error on the incoming data (for example. caused by character loss when the incoming serial rate is too high for it to process in time) it performs some additional work which overruns the thread's stack, hitting the OS "stack underflow" check. Increasing the PPP stack size to 768 bytes resolves this problem.
2017-07-03 09:46:23 +01:00
Hasnain Virk d29e05896f Check Ethernet before including lwipopts_conf.h
lwipopts_conf.h is used by target dependent Ethernet drivers for
configuring various parameters.
By default, Ethernet is enabled and in this case lwipopts_conf.h
will be included.
In case of PPP  being enabled, it is desirable to not pull in any Ethernet
related code.
2017-06-12 09:57:16 +03:00
Christopher Haster f11f2b35e0 lwip: Increased DHCP timeout to 60 seconds
This matches the timeout used in linux:
https://linux.die.net/man/5/dhclient.conf

This resolves several issues noticed during testing when we
have a very large number of devices that try to get an IP address
around the same time.
2017-06-10 15:14:28 +01:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Hasnain Virk 24de27c989 Major Refactoring & extensions
For keep supporting external APIs with the same name (supposedly there are a larger
number of users of those APIs), BufferedSerial and ATParser are being renamed.
BufferedSerial becomes UARTSerial, will complement a  future USBSerial etc.
ATParser becomes ATCmdParser.

* UARTSerial moves to /drivers

* APN_db.h is moved from platform to cellular/util/.

* Original CellularInterface is restored for backward compatability (again, supposedly there
  are users of that).

* A new file, CellularBase is added which will now servce as the base class for all
  upcoming drivers.

* Special restructuring for the driver has been undertaken. This makes a clear cut distinction
  between an on-board or an off-board implementation.
  	- PPPCellularInterface is a generic network interface that works with a generic FileHandle
          and PPP. A derived class is needed to pass that FileHandle.
        - PPPCellularInterface provides some base functionality like network registration, AT setup,
          PPP connection etc. Lower level job is delegated to the derived classes and various modem
          specific APIs are provided which are supposed to be overridden.
        - UARTCellularInterface is derived from PPPCellularInterface. It constructs a FileHandle and
          passes it back to PPPCellularInterface as well as provides modem hangupf functionality.
          In future we could proive a USBInterface that would derive from PPPCellularInterface and could
          pass the FileHandle back.
	- OnboardCellularInterface is derived from UARTCellularInterfae and provides hooks to
          the target provided implementation of onbard_modem_api.h. An off-board modem, i.e, a modem on
          a shield has to override the modem_init(), modem_power_up() etc as it cannot use
          onboard_modem_api.h.
2017-05-31 15:02:11 +03:00
Hasnain Virk b51fbe817b mbedtls md5 or lwip internal crypt Fudge
Some targets define MBEDTLS_md5_C in targets.json in order to force the system to use
external mbedtls instead of lwip internal crypt, i.e.,  polarssl.
LWIP's internal md5 mechanism is tied to PPP  for some reason. In a previosly merged commit
an attempt was made to steal md5 functions by faking that PPP was turned on. However
that solution was broken in case of really turning on PPP  functionality.

This commit fixes the breakage and also corrects the logic in case a target decides to use
external md5 implementation from mbedtls or otherwise (i.e, wants to stick to the internal
implementation).
2017-05-31 15:02:11 +03:00
Hasnain Virk 658ddf7c30 ARMCC link errors fixed, nsapi_ppp glue layer changed
GCC have not been capable enough to catch some linker errors which arose when
ethernet support for LWIP was disabled. Checks have been added to make sure that
unrefrenced code is not linked in.

nsapi_ppp glue layer is made more transparent to public cellular API. Storage of IP
addresses is removed. PPP layer already stores the addresses, so we pass the pointer back
to the upper layers.

If PPP is not used, we provide dummy functions.
2017-05-31 15:02:11 +03:00
Hasnain Virk f602c936ff Redirecting LWIP debug trace to mbed-trace
This piece of code redirects LWIP debug trace to mbed-trace if configured.
This enables us to have universal traces.
2017-05-31 15:02:11 +03:00
Hasnain Virk 3b44f4758d Adding support for APN lookup
Mainly reutilizing code from ublox C027 support lib.
As we are using external PDP context, i.e., an external IP stack,
we will pass username and password to underlying stack running PPP.
We only support CHAP as the authentication protocol.
2017-05-31 15:02:11 +03:00
Kevin Bracey ae7fd61d65 RAM optimizations
Trying to save RAM wherever possible for Ublox C027 platform
2017-05-31 15:02:11 +03:00
Kevin Bracey f37f265ed5 Add more LWIP JSON configuration, including PPP
Add configuration to control Ethernet, PPP and TCP support.

Replaces LWIP_TRANSPORT_ETHERNET/PPP defines formerly used by targets.

Ethernet and PPP can be enabled simultaneously.

DHCPv4 is now only enabled if IPv4 and Ethernet are both enabled - we
assume PPP uses IPCP for configuration.

PPP configuration adjusted to cope with LWIP 2.0 changes, and
optimised for RAM a little.
2017-05-31 15:02:11 +03:00
Bartek Szatkowski b793a3fb89 Update codebase for CMSIS5/RTX5
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Sam Grove 6a96481d4d Merge pull request #4311 from kjbracey-arm/lwip_cksum
Disable lwIP checksum-on-copy
2017-05-18 09:28:10 -05:00
Kevin Bracey 69ec30b7b9 Disable lwIP checksum-on-copy
Current version of lwIP has a bug in its checksum-on-copy code - see

      https://github.com/ARMmbed/mbed-os/issues/4140
  and https://savannah.nongnu.org/bugs/?50914

Pending a fix from lwIP, set LWIP_CHECKSUM_ON_COPY to 0 to work around.
Will impact performance.
2017-05-12 10:24:17 +03:00
Mika Leppänen 053139b85d lwip added support for random library and TCP ISN initialisation
lwip now uses mbed client random library under common pal when available.
Ported lwip reference TCP initial sequence number handling to mbed-os
lwip stack. Handling is based on RFC 6528.
2017-05-10 10:20:44 +03:00
Tony Wu e9d3cf4468 lwip - make lwip thread stack size configurable
Define tcpip-thread-stacksize and default-thread-stacksize in
lwip's mbed_lib.json, and use them accordingly in lwipopts.h.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-04-10 17:09:27 +08:00
Seth King c83bcbf9cc Update lwipopts.h
Enable broadcast by disabling Broadcast filters 
resolve #3163
2016-12-20 15:04:32 -05:00
Colin Hogben b516503fcb lwip: Expose principal socket limits as configuration parameters.
Allow the limits on numbers of sockets to be changed via the
configuration system.  The help texts show the RAM penalty from
increasing each value.
2016-10-19 21:37:52 +01:00
Colin Hogben 55485ae61e lwip: Annotate with memory used by config parameters 2016-10-19 14:49:04 +01:00
Colin Hogben b7a48b1220 lwip: Allow several configuration macros to be set externally.
Manually rebasing after the monster restructuring.
2016-10-19 14:49:03 +01:00
andreas.larsson f5675cc822 Increased the stack size for the lwIP thread from 1024 to 1200. Needed for the u-blox ODIN-W2 driver. The actually needed size has not been measured. 2016-10-04 15:52:56 +02:00
Christopher Haster ba99a1f31d restructure - Restructured features/net directory
features/net/network-socket -> features/netsocket
features/net/FEATURE_IPV4 -> features/FEATURE_LWIP
features/net/nanostack-binaries -> features/nanostack
features/net/FEATURE_NANOSTACK -> features/nanostack/FEATURE_NANOSTACK
2016-09-30 19:18:09 -05:00