Commit Graph

165 Commits (1403dfc086b406650d4b3b38b38835b415cc55c9)

Author SHA1 Message Date
Bartek Szatkowski a8229b5351 Make sure all RTOS attribute structures are 0-ed before use 2017-05-30 18:55:56 +01:00
Bartek Szatkowski b01f13d1a0 Make sure all system threads and mutexes have clear names 2017-05-30 18:55:55 +01: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
Martin Kojtal 8f295177ce Merge pull request #4317 from c1728p9/reduce_test_overhead
Reduce test overhead in preperation for CMSIS 5
2017-05-17 10:13:25 +01:00
Bartek Szatkowski 6a0fcd3c58 Reduce test overhead in preparation for CMSIS 5
Reduce RAM consumption so all tests can still be built when using
CMSIS/RTX5. Also reduce clutter by removing the per target stack size
defines in the tests.
2017-05-14 19:25:19 -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 55753be8ef lwip corrected coverity and compiler warnings
Coverity ids: 1373147 and 1374442.
2017-05-10 10:20:44 +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
Jimmy Brisson 3b11b23371 Merge pull request #4238 from tung7970/fix-mbedos
lwip - power up emac before reading its settings
2017-05-08 11:15:45 -05:00
0x6d61726b acf18ac9c7 removed warning: unused variable 'ethhdr' [-Wunused-variable] 2017-04-30 16:29:47 +02:00
Tony Wu 0b2bfca6da lwip - delay mbed_lwip_set_mac_address until device is inited
mbed_lwip_set_mac_address calls mbed_mac_address to get hwaddr
from device, but device may not be accessible until it is powered
up and initialized.

This patch delays mbed_lwip_set_mac_address call until device is
ready.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-04-28 00:30:40 +08:00
Tony Wu cdc40ff3bb lwip - power up emac before reading its settings
emac settings are only available after powered up.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-04-28 00:15:07 +08: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
Sam Grove 8af190f550 Merge pull request #4112 from adamgreen/fixLpc17xxEthernetIsrAlwaysLinkedIn
Only link in LPC17xx ethernet ISR as needed
2017-04-06 11:16:10 -05:00
Sam Grove 7a35a4df51 Merge pull request #3992 from u-blox/c030-dev
Introducing UBLOX_C030 platform.
2017-04-06 11:07:58 -05:00
Adam Green be0bab3f40 Only link in LPC17xx ethernet ISR as needed
Originally the ethernet ISR would be linked in to all mbed-os based
firmware because it was named ENET_IRQHandler() so that it would be
automatically placed in the FLASH image's interrupt vector table. This
meant that programs which made no use of the lwIP stack still pulled in
this ISR.

This commit changes the name of the routine so that the ISR isn't
automatically placed in the interrupt vector table at link time but is
instead dynamically placed in the interrupt vector table at runtime
when the lwIP stack is initialized. Now the ethernet ISR is only linked
in when it is actually needed.

Example arm-none-eabi-size output for a simple LED blinking program
showing the before and after size results:
   text	   data	    bss	    dec	    hex	filename
  13208	    148	   7784	  21140	   5294	LPC1768/HelloWorld.elf

   text	   data	    bss	    dec	    hex	filename
  12700	    148	   7468	  20316	   4f5c	LPC1768/HelloWorld.elf
2017-04-04 14:42:21 -07:00
Rob Meades 7387c09872 Introducing UBLOX_C030 platform. 2017-04-04 16:22:50 +01:00
Christopher Haster 2918270222 lpc1768: Removed invalid use of IP_SOF_BROADCAST_RECV option
From opt.h:
IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast
filter on recv operations.

The IP_SOF_BROADCAST_RECV option does not enable or disable recieving
broadcast packets, it only enables a software filter.
2017-03-28 13:37:36 -05:00
Anna Bridge ebfe04a841 Merge pull request #3975 from kjbracey-arm/lwip_buf_free
NSAPI/lwIP: Free held netbuf on close
2017-03-23 15:39:52 +00:00
Kevin Bracey 2f056f2814 NSAPI/lwIP: Free held netbuf on close
mbed_lwip_socket_recv() takes one netbuf at a time from the netconn API,
and it holds a partially-read netbuf if necessary in order to present as
a stream for TCP.

This held netbuf was not being freed when the socket was closed.
2017-03-21 11:14:39 +02:00
cyliangtw f429675dd0 [NUC472] remove dead code in nuc472_netif.c 2017-03-14 19:48:37 +08:00
cyliangtw c58631bb71 [NUC472] Adjust locally administered MAC address 2017-03-10 16:18:14 +08:00
MS30 CYLiang fa0f928de4 [NUC472] Support unique locally administered MAC address 2017-03-10 16:18:14 +08:00
Martin Kojtal 05e7aad52a Merge pull request #3832 from geky/lwip-fix-test-timeout
lwip: Increase timeout on network tests with python projects
2017-03-06 16:52:15 +00:00
Christopher Haster 2d41da2c63 Storage/lwip: Renamed lwip/errno.h -> lwip/lwip_errno.h to avoid conflicts 2017-02-23 14:23:39 -06:00
Christopher Haster ff3fc8b532 lwip: Increase timeout on tests
Sometimes when under heavy load, the CI machines can take a significant
amount of time to bring up a python process (~10s). The timeouts for
the network tests were chosen without much thought, and didn't leave
much room for this sort of delay.

This patch brings up timeouts for ntetwork tests 20s -> 60s
2017-02-23 12:18:43 -06:00
Sam Grove cf64f09230 Merge pull request #3721 from mikaleppanen/lwip_2_0_1_stable
Lwip 2.0.1 stable
2017-02-23 10:16:57 -06:00
Sam Grove 30ddefc968 Merge pull request #3654 from geky/header-rename
Renamed files in platform to match source names
2017-02-23 10:16:35 -06:00
Sam Grove 078995a021 Merge pull request #3482 from Neuromancer2701/patch-1
Update lwipopts.h
2017-02-23 10:15:24 -06:00
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
Mika Leppänen 90db9c0cb4 Corrected IAR compilation and removed compiler warnings 2017-02-21 14:31:26 +02:00
Mika Leppänen 30b6d2304d Set TCP socket created by accept to non-blocking mode 2017-02-21 14:31:10 +02:00
Mika Leppänen 93f02e4fed Renamed filter constant 2017-02-21 14:30:45 +02:00
Mika Leppänen b62df0033f Merged lwip 2.0.1 stable to mbed-os
* commit '61a7b15741c964dfa1f1a14244de38ea4e2ce22a':
  Squashed 'features/FEATURE_LWIP/lwip-interface/lwip/' changes from d7a6c6d..10f93f4
2017-02-21 14:27:32 +02:00
Sam Grove 7fc73e42f2 Merge pull request #3781 from geky/lwip-dtls-speed
lwip: Added delay to dtls handshake test to compensate for local network
2017-02-17 09:20:58 -06:00
Christopher Haster 64ccff3fe1 lwip: Added delay to dtls handshake test to compensate for local network
The speed of packets on the local network exceeds even the speed of
the ethernet hardware on some of the less powerful devices. Adding
a small delay which can be expected from a real DTLS handshake prevents
this condition from occuring.
2017-02-15 12:38:05 -06:00
Mika Leppänen 46396da1cf Added filter to send minus events to lwip adaptation 2017-02-13 09:50:38 +02:00
Sam Grove e0fb062ae8 Merge pull request #3649 from adustm/STM32F7_folderstruct
[STM32F7] Modify folder structure
2017-02-09 09:30:28 -06:00
adustm dd7c00f1b6 STM32F429 / F439 folder rework 2017-01-27 15:41:49 +01:00
adustm 0e70959e4d Modify forder structure so that targets with the same device can share
files
2017-01-26 14:21:26 +01:00
Martin Kojtal 4e28b25399 Merge pull request #3612 from bulislaw/fix_network_host_tool
tests: Fix error on MacOS for udp_dtls_handshake test
2017-01-26 10:33:32 +02:00
Martin Kojtal addd2b2965 Merge pull request #3548 from bridadan/reduce_stack_network_parallel_tests
Reduce thread stack size for parallel network tests
2017-01-26 10:21:46 +02:00
Bartek Szatkowski 537f4db0af tests: Fix error on MacOS for udp_dtls_handshake test 2017-01-19 13:13:18 +00:00
Brian Daniels bdd0ff4272 Reduce thread stack size for parallel network tests
This commit reduces the thread stack from 2k to 1k for each thread in
the parallel network tests. This allows the test to run on more
constrained devices (like the LPC1768).
2017-01-17 11:19:35 -06:00
Anna Bridge 9e24117b68 Merge pull request #3403 from geky/lwip-fix-tcp-connect-error
lwip - Fixed error codes for failed TCP connect
2017-01-10 10:43:37 +00:00
Sam Grove 7b83e0ff93 Merge pull request #3526 from geky/lwip-fix-static-ip-dns
lwip - Fix static IP address issues with IPv4
2017-01-09 10:27:11 -06:00
Sam Grove 6af7b2916f Merge pull request #3265 from geky/lwip-tests
lwip - Add more network tests
2017-01-09 10:08:17 -06:00
Christopher Haster bbcf8de9e3 lwip - Filtered network tests based on DEVICE_EMAC
Currently DEVICE_EMAC is incompatible with the EthernetInterface
2017-01-05 11:16:24 -06:00
Christopher Haster 5f728e1b66 lwip - Marked *_packet_pressure tests as "extended tests"
*_packet_pressure_parallel tests are useful for checking for synchronization
errors, but push the practical limitations of the network stack. Failing
these tests is not unreasonable.

*_packet_pressure tests are a little bit less unreasonable, but also
push the practical limitations of the network stack. Hopefully these
will become stable in the near future.
2017-01-05 10:58:15 -06:00
Christopher Haster 6f375d20f8 lwip - Fixed missing dns servers after bringup with static ipv4 address
Generalized handling of dns servers when brought up with both ipv4 and
ipv6 addresses. Falls back to google dns servers if not dns server is
found through dhcp.

Also added support for the `add_dns_server` method to lwip to support
custom servers.
2017-01-04 12:12:16 -06:00
Christopher Haster 146577731e lwip - Fixed lwip connected state after bringup with static ips
Thanks to @YixiaoLi for noting this was incorrect
2017-01-04 12:10:47 -06:00
adustm ee3faa408d fix for #3387 need to disable the data cache for Ethernet to use the DMA
descriptors if they are located in SRAM1 and SRAM2
2016-12-22 17:57:50 +01:00
Seth King c83bcbf9cc Update lwipopts.h
Enable broadcast by disabling Broadcast filters 
resolve #3163
2016-12-20 15:04:32 -05:00
Christopher Haster 51a093d6d8 lwip - Added windowing to tcp packet pressure tests
Despite being able to buffer an arbitrary stream of data,
TCP send is still limited by the available buffer space in the
network stack. Errors from TCP send are perfectly reasonable
and should be handled by reducing the buffer that is attempted.
2016-12-19 16:12:01 -06:00
Christopher Haster 2da71a7f87 lwip - Reduced size of buffers in echo-parallel tests
These tests could adopt the dynamically sized buffers used for the
packet-pressure tests, however throughput is not an important feature
of these tests.
2016-12-19 16:11:49 -06:00
Christopher Haster 4551dfa667 lwip - Moved dropped packets into debug condition
Printing out dropped packets caused significantly more overhead in the
parallel tests due to increased noise on the network. This noise would
push the tests past their provided timeouts.
2016-12-19 12:05:43 -06:00
Christopher Haster 39714f303d lwip - Added parallel versions of the packet pressure tests 2016-12-19 12:05:43 -06:00
Christopher Haster 8e7a3c8b04 lwip - Added handling of packet loss to udp echo test
Before the test would only succeed if all packets (16) succeed. Updated
to succeed if 75% succed.
2016-12-19 12:05:43 -06:00
Christopher Haster 9df82e5811 lwip - Added parallel versions of the echo tests
Simply runs the echo tests with multiple sockets in parallel
2016-12-19 12:05:43 -06:00
Christopher Haster 5c51a3d5ba lwip - Restructured pressure tests to use dynamic buffers and avoid floods
Dynamic buffers gives the network stack the maximum throughput while
still supporting smaller devices. This should expose the largest number
of issues across differently sized platforms.

Additionally, restructured the UDP tests to avoid unintentionally flooding
the recieving side with bad data after failed packets.

Also, added a bit more documentation
2016-12-19 12:05:43 -06:00
Christopher Haster 2295e40fc0 lwip - Reduced buffer used for packet-pressure tests
A larger buffer gives the network stack the best options for maximizing
throughput. However, the initial buffer size did not fit on small
targets. Resized 8192 -> 1024.
2016-12-19 12:05:43 -06:00
Christopher Haster 0d42ba6401 lwip - Added connectivity tests
Checks for connecting/disconnecting the network interface
2016-12-19 12:05:42 -06:00
Christopher Haster 938770e9ac lwip - Added udp_dtls_handshake test
Added test for the pattern of packets used during the DTLS
handshake. This pattern (5x ~300 byte packets) has been very
problematic for new network interfaces.
2016-12-19 12:05:42 -06:00
Christopher Haster fb00d20f56 lwip - Removed nist_internet_time_service test
- Unreliable service would occasionally lead to false-failures
- Redundant with hello world and echo tests
2016-12-19 12:05:42 -06:00
Christopher Haster ad79c20c6a lwip - Added packet pressure tests
Attempt to maximize the devices bandwidth with an exponentially growing
transaction of random sequences. Also prints the time taken and bandwidth
reached during the tests.
2016-12-19 12:05:42 -06:00
Sam Grove 899c5422ac Merge pull request #3436 from ARMmbed/net_echo_test_host_fix
Fix network echo test host scripts for Mac
2016-12-15 10:40:39 -06:00
Bartek Szatkowski b77f663520 Add defined port fallback for network echo tests
The 0 aka 'any' port doesn't for on Mac, but, only, using defined port
may interfere with running multiple tests on CI.
2016-12-15 09:27:02 +00:00
Bartek Szatkowski 859c160ddc Fix network echo test host scripts for Mac
It seems that the 0 aka 'any port' doesn't work well on Mac, causing
[Errno 49] Can't assign requested address errors.
2016-12-15 09:27:02 +00:00
cyliangtw 0053b70d1e [NUC472] Fix LWIP implementation contains printf issue #3441 2016-12-14 15:12:58 +08:00
Christopher Haster 9b2a02f9ec lwip - Fixed error codes for failed TCP connect
condition               posix error     mbed error
good host, closed port  ECONNREFUSED    NSAPI_ERROR_NO_CONNECTION
bad host                EHOSTUNREACH    NSAPI_ERROR_NO_CONNECTION
bad network             ENETUNREACH     NSAPI_ERROR_NO_CONNECTION
2016-12-08 16:46:21 -06:00
Mahadevan Mahesh 428e8b23c1 K66F: Enable LWIP feature
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-12-06 12:37:02 -06:00
Martin Kojtal ab46684d5d Merge pull request #3336 from mikaleppanen/lwip_dhcp_parse_corr
Squashed 'features/FEATURE_LWIP/lwip-interface/lwip/' changes from d7…
2016-12-02 15:51:19 +01:00
Martin Kojtal e261e30d05 Merge pull request #3193 from mikaleppanen/lwip_ipv6_eth_down_supp
Added clearing of ipv6 addresses to lwip bringdown function
2016-11-29 18:13:35 +01:00
Mika Leppänen 420d5c3bac Squashed 'features/FEATURE_LWIP/lwip-interface/lwip/' changes from d7a6c6d..cd60f73
cd60f73 Merge branch 'mbed-os-lwip-rc2-maint' into mbed-os-lwip-rc2-maint-prefixed
3a50479 fixed bug #49676 (Possible endless loop when parsing dhcp options) & added unit test for that

git-subtree-dir: features/FEATURE_LWIP/lwip-interface/lwip
git-subtree-split: cd60f73f110829e00df46593fea5db26bcfb1662
2016-11-29 15:00:02 +02:00
Bartek Szatkowski 20b7f05721 WiFi: Make WiFi default networking interface on Odin board
That disables Ethernet by default and makes sure the Ethernet tests are
not failing when it's disabled.
2016-11-16 12:00:09 +00:00
Anna Bridge 405f8937a7 Merge pull request #3191 from tung7970/fix-mbedos
Fix lwip_mac_address buffer overflow and set_ip_bytes out of bound access
2016-11-10 17:05:38 +00:00
Anna Bridge 805af00b87 Merge pull request #3194 from NXPmicro/Update_K64_SDK_Drivers
Update K64 sdk drivers
2016-11-10 17:05:02 +00:00
Mika Leppänen 4babe02b62 Added clearing of ipv6 addresses to lwip bringdown function 2016-11-10 09:07:35 +02:00
Christopher Haster b04a8da574 nsapi - Added test cases for gethostbyname
- test_dns_query
- test_dns_query_pref
- test_dns_literal
- test_dns_literal_pref
2016-11-09 12:11:02 -06:00
andreas.larsson e111810830 Added emac_stack_mem_copy. Needed by the u-blox ODIN-W2 driver. 2016-11-07 15:52:56 +01:00
Martin Kojtal 7eaf32baa0 Merge pull request #3075 from geky/nsapi-error-size-types-2
nsapi - Add standardized return types for size and errors
2016-11-07 11:13:40 +00:00
Tony Wu d039d30abe lwip - Fix lwip_mac_address buffer overflow
Sounds serious, but should be benign.

Signed-off-by: Tony Wu <tonywu@realtek.com>
2016-11-03 20:16:58 +08:00
Mahadevan Mahesh 177eaff847 K64F ENET: Update to remove unused variable. This is no longer available in the updated SDK ENET driver 2016-11-03 07:07:49 -05:00
Sam Grove 8b05a2a02b Merge pull request #3078 from infinnovation/lwip-config
lwip: Allow several configuration macros to be set externally (bis)
2016-11-03 02:15:10 -05:00
Christopher Haster 78b9357c80 nsapi - Adopted standardized return types in lwip 2016-11-02 15:25:22 -05:00
Sam Grove 2a3f4eda19 Merge pull request #3162 from geky/nsapi-warning-cleanup
lwip/nsapi - Clean up warnings in network code
2016-11-01 14:15:08 -05:00
Sam Grove fcfc7b46a7 Merge pull request #3135 from geky/lwip-fix-cyclic-buffer-leak
lwip - Fix memory leak in k64f cyclic-buffer overflow
2016-11-01 14:12:24 -05:00
Christopher Haster 8b7c051d03 lwip - Change k64f emac layer to drop frames on buffer exhaustion
Previously, exhausting hardware buffers would begin blocking the lwip
thread. This patch changes the emac layer to simply drop ethernet
frames, leaving recovery up to a higher level protocol.

This is consistent with the behaviour of the emac layer when unable
to allocate dynamic memory.
2016-10-28 15:22:08 -05:00
Christopher Haster 42105371ef lwip/nsapi - Cleaned up warnings in network code
- cc.h@57,1: "BYTE_ORDER" redefined
- lwip_inet_chksum.c@560,44: passing argument 1 of 'thumb2_checksum'
  discards 'const' qualifier from pointer target type
- lwip_pbuf.c@1172,9: variable 'err' set but not used
- SocketAddress.cpp@293,1: control reaches end of non-void function
2016-10-28 14:24:52 -05:00
Martin Kojtal ba47aa546b Merge pull request #2897 from geky/nsapi-consistent-unspec
nsapi - Standardize support of NSAPI_UNSPEC
2016-10-27 10:26:00 +02:00
Christopher Haster 2fd15f4f44 lwip - Fixed memory leak in k64f cyclic-buffer overflow
This was actually several bugs colluding together.

1. Confusion on the buffer-semaphore paradigm used led to misuse of the
tx semaphore and potential for odd behaviour.

2. Equality tests on tx_consume_index and tx_produce_index did not
handle overflow correctly. This would allow tx_consume_index to catch
up to tx_produce_index and trick the k64f_rx_reclaim function into
forgetting about a whole buffer of pbufs.

3. On top of all of that, the ENET_BUFFDESCRIPTOR_TX_READ_MASK was not
correctly read immediately after being set due to either a compiler
optimization or hardware delays. This caused k64f_low_level_output
to eagerly overrun existing buff-descriptors before they had been
completely sent. Adopting the counting-semaphore paradigm for 1 avoided
this concern.

As pointed out by @infinnovation, the overflow only occurs in the rare
case that the 120MHz CPU can actually generate packets faster than the
ENET hardware can transmit on a 100Mbps link.
2016-10-25 13:22:17 -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
Mika Leppänen 61c7f9821b Corrected lwip TCP socket accept ipv6 address conversion 2016-10-17 15:30:09 +03:00
adustm ff4fca6747 ADD NEW TARGET : NUCLEO_F756ZG, based on existing NUCLEO_F746ZG 2016-10-13 18:29:09 +02:00
adustm a07a271fe5 ADD NEW TARGET : NUCLEO_F439ZI, based on existing NUCLEO_F429ZI 2016-10-13 18:29:09 +02:00
Sam Grove 44dcb5f21f Merge pull request #2994 from 0xc0170/fix_issue#2993
lwip-interface: fix issue #2993
2016-10-13 11:14:10 -05:00
Martin Kojtal f8b682c943 lwip-interface: fix issue #2993
DEVICE_ are passed as command line -D, thus no inclusion is required.
``platform.h`` is C++ header file, should not be pulled in C files
2016-10-13 11:42:31 +01:00