Commit Graph

584 Commits (2a4ef3f4640c091c3b8cbe2f62b3616b8282cfe0)

Author SHA1 Message Date
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
Anna Bridge e182ff48b6 Merge pull request #3428 from LMESTM/fix_i2c_asynch_test_slave_addr
Change slave address in I2C master slave asynch test
2016-12-19 17:41:38 +00:00
Anna Bridge 9e03765d04 Merge pull request #3422 from szechyjs/disco_f303vc_can
Enable CAN on DISCO_F303VC
2016-12-19 17:37:48 +00:00
Anna Bridge 3c84f49084 Merge pull request #3402 from geky/nsapi-fix-socket-close
nsapi - Fixed open/close issue in Socket
2016-12-19 17:25:09 +00:00
Michel Jaouen 71f570fbc7 USB_8 : audio loopback test at 16khz stereo 16bits
- Callback TX and RX interface is used.
2016-12-16 15:16:56 +01:00
Michel Jaouen 3a6a5ab858 USBAudio: tx/rx iso call back. 2016-12-16 15:16:55 +01:00
Hasnain Virk 35e4896ed3 [ONME-2844] Supporting non-blocking connect()
A few new error codes are added to nsapi_error_t and
support for non-blocking socket connect is added.
Nanostack's connect call will be non-blocking.
Whereas LWIP connect call is currently blocking, and it could be changed now
to be non-blocking.
2016-12-16 15:35:33 +02:00
ccli8 5fe22742f1 [NUC472/M453] Add target SPI pins into SPI SD test samples with Travis CI 2016-12-16 09:42:24 +08: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
Sam Grove 6b64dbc5fe Merge pull request #3434 from OpenNuvoton/nuvoton
[NUC472/M453] Fix stuck in lp_ticker_init and other updates
2016-12-15 10:38:35 -06:00
Anna Bridge ad8a77d1ae Merge pull request #3368 from simonqhughes/master
CFSTORE fixes for building with DEBUG trace enabled
2016-12-15 10:53:18 +00: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
Laurent MEUNIER 63cd036d5b Change slave address in I2C master slave asynch test
Change test slave address to 0x80 because 0x90 is used by a real slave
(temperature sensor) on few boards like the CI shield.
2016-12-12 14:54:36 +01:00
Jared Szechy f5f3dc8143 Enable CAN on DISCO_F303VC 2016-12-11 22:03:29 -05:00
ccli8 fc16917d37 [NUC472/M453] Add license header for USBEndpoints_NUC472/M453.h 2016-12-12 09:19:08 +08:00
Martin Kojtal 00696e623f Merge pull request #3378 from NXPmicro/K66_ENET
K66F: Enable LWIP feature
2016-12-09 15:36:58 +01:00
Martin Kojtal 04f940de2d Merge pull request #3324 from LMESTM/dev_i2c_common_code
Dev i2c common code
2016-12-09 15:30:00 +01:00
ccli8 8c0948d605 [NUC472/M453] Integrate with Travis CI
1. Add targets into build_travis.py and tests.py.
2. Add target SPI pins into SPI SD test samples.
3. Rename target TOOLCHAIN_GCC_ARM/retarget.c to avoid name collision of compiled retarget.o with platform/retargets.cpp.
2016-12-09 13:46:38 +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
Christopher Haster 3643b59109 nsapi - Fixed open/close issue in Socket
During open, the socket checked the internal stack variable,
assuming it would alway be null on a socket not connected to
the network. However, when a socket is closed, the stack variable
was not updated, causing the socket to incorrectly return a
parameter error if reopened.

The simple fix was to set the stack to null on close. A non-null
stack is a predicate for a non-null socket variable, so no additional
checks are needed in socket functions.
2016-12-08 16:14:15 -06:00
Bogdan Marinescu 337c1af22c Don't send events on close()
It's currently possible to generate a socket event when a non-blocking socket is closed:

1. _pending is set to 0 in https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPSocket.cpp#L22
   when the socket is created.
2. close() calls event() in https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/Socket.cpp#L66
3. event() increments _pending, and since _pending is 1 it will call _callback() in https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/TCPSocket.cpp#L167

However, if send() (for example) is called, this can happen:

- send() is called and sets _pending to 0.
- when the data is sent, event() is called, which sets _pending to 1 and calls _callback().
- if close() is called at this point, there won't be an event generated for close() anymore,
  since _pending will be set to 2.

Same thing for recv. Also, same thing for TCPServer and UDPSocket.

This PR changes the initial value of _pending to 1 instead of 0, so that
events are never generated for close().
2016-12-07 17:52:16 +02: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
Simon D Hughes a09ad071e6 Corrections of debug trace statements which prevent compilation when CFSTORE_DEBUG is defined. 2016-12-05 15:29:22 +00:00
ccli8 7f4881fbb2 [NUC472/M453] Support USB device 2016-12-05 15:12:15 +08: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 ab2e869a24 Merge pull request #3157 from SiliconLabs/SiliconLabs-EFR32
[Silicon Labs] Adding support for EFR32MG1 wireless SoC
2016-12-02 15:46:35 +01:00
Laurent MEUNIER 014a48d402 Add more supported boards to I2C master slave asynch test 2016-11-30 08:23:13 +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
Martin Kojtal c7d5ef09d0 Merge pull request #3341 from ARMmbed/ns_timeout-rename
Rename timeout.c to not collide with Timeout.cpp
2016-11-29 18:09:35 +01:00
Martin Kojtal 93c08f340a Merge pull request #3062 from jamike/TARGET_STM_USBDEVICE_FS
TARGET_STM :USB device FS
2016-11-29 18:07:11 +01:00
Seppo Takalo 119c118e22 Rename timeout.c to not collide with Timeout.cpp
IAR builds put all object files in same directory, so same
prefix is not allowed.
2016-11-29 17:32:28 +02: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
Simon Hughes 46411f7f73 CFSTORE issue 3327: fix to build CFSTORE SRAM mode (disabling flash storage). 2016-11-28 16:09:00 +00:00
Anna Bridge fd7d5eca14 Merge pull request #3270 from AlessandroA/update_uvisor
uVisor: Update to v0.26.1
2016-11-24 13:22:14 +00:00
Russ Butler f843d49247 Merge pull request #3267 from SeppoTakalo/mesh_refactor
ONME-2857: Ethernet interface for Nanostack
2016-11-22 12:59:50 -05:00
Alessandro Angelino 1321e12eca uVisor: Update to v0.26.1 2016-11-22 17:24:05 +00:00
Michel Jaouen bc17759226 USBHAL.h : fix indentation 2016-11-22 10:52:10 +01:00
Michel Jaouen ad09abb71f USBAudio , USBSerial :fix call back 2016-11-22 10:52:03 +01:00
Martin Kojtal f7068eb57a Merge pull request #3279 from yanesca/mbedtls-hardware-acceleration-configuration
Move crypto hardware acceleration configuration.
2016-11-21 23:22:16 +00:00
Martin Kojtal a987cc0bee Merge pull request #3271 from ARMmbed/odin_wifi_default_on
WiFi: Make WiFi default networking interface on Odin board
2016-11-21 23:19:02 +00:00
Mizuho 56d71a429e added static specifer in green_metrics.cpp 2016-11-19 08:17:05 +09:00
Janos Follath e9144ad771 Apply new naming convention to mbed TLS macros 2016-11-18 15:01:01 +00:00
Steven Cooreman 245e2e2e2d Revert "[EFR32] Adding hardware acceleration for mbed TLS"
This reverts commit c0301b15d2.
2016-11-18 11:05:36 +01:00
Steven Cooreman ad773716ff [EFR32] Move Nanostack driver to Nanostack folder
mbed compile doesn't support two different FEATURE_X folders being merged, so we'll have to move our nanostack driver into the Nanostack folder for the time being.
2016-11-18 10:58:36 +01:00
Janos Follath 9137574e4d Move mbed TLS configuration symbol to macro section
The configuration option for the mbed TLS specific hardware acceleration
has to be in the macro section and not in the device capabilities
section in targets.json.

The option has also been renamed to better reflect its function.
2016-11-18 09:55:16 +00:00
Janos Follath 80aedd2f39 Move crypto hardware acceleration configuration
The crypto hardware acceleration might require defining a lot of mbed
TLS specific macros. Enumerating all of them in `targets.json` creates
too much noise, therefore we move it into a target specific mbed TLS
header.

The target with crypto hardware acceleration has to
        - indicate its capability in `targets.json` by adding "CRYPTO"
          to the "device_has" section
        - has to define his crypto hardware acceleration related macros
          in an `mbedtls_device.h` header
        - place the `mbedtls_device.h` file in the
          `features/mbedtls/targets/TARGET_XXXX`
          directory specific to the target
2016-11-17 14:38:04 +00:00
Martin Kojtal 3aac153fa8 Merge pull request #3254 from pan-/nrf_long_write
[BLE - NRF5] Add support for long write requests.
2016-11-16 17:45:02 +00:00
Martin Kojtal 5750f31d6d Merge pull request #3238 from LMESTM/dev_i2c_stm32f4hal
Dev i2c stm32f4hal
2016-11-16 17:42:12 +00:00
Martin Kojtal 98029e3906 Merge pull request #3065 from geky/nsapi-remove-same-thread-asserts
nsapi - Remove assertions on same-thread send/recv
2016-11-16 17:41:13 +00:00
Seppo Takalo 3d5962db48 Return localhost from NanostackInterface::get_ip_address()
For NetworkStack::gethostbyname() to properly validate the
IP address version, we must return a valid address from
Networkstack::get_ip_address().
2016-11-16 19:07:23 +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
Seppo Takalo 9f8fe897d8 Add documentation for NanostackEthernetInterface. 2016-11-15 15:30:39 +02:00
Vincent Coubard c59e057717 Fix documentation of function allocateLongWriteRequest. 2016-11-15 13:25:10 +00:00
Vincent Coubard 969c63040e Various fixes regarding typos, dead code and consistency. 2016-11-15 13:22:12 +00:00
Seppo Takalo ae885ca0e9 Implement Ethernet interface for Nanostack.
* New Phy type: NanostackEthernetPhy
* New tasklet: enet_tasklet.
* New Interface: NanostackEthernetInterface,
  inherited from MeshInterfaceNanostack
2016-11-15 13:15:52 +02:00
Seppo Takalo 7732adb8a0 Rename NanostackRfPhy to NanostackPhy
This is to allow other types of PHY drivers than just RF.
Mesh-API does not actually care about driver type, it is drivers
responsibility to register right handlers with Nanostack.

* Implement a wrapper class NanostackRfPhy to ensure backward
  compatibility.
* Remove mesh_connect()/disconnect() functions from MeshInterface
  This job is already done in inherited classes.
* LoWPANNDInterface and ThreadInterface should only be used with
  NanostackRfPhy.
2016-11-15 13:12:18 +02:00
Seppo Takalo 6ba755e444 Move MeshInterfaceNanostack to own file.
+Also nanostack_lock() moved to mesh_system.h
+Added includes into NanostackInterface.h to be backward
compatible
2016-11-15 13:12:18 +02:00
Seppo Takalo 27cced74fb Get rid of Mesh6LoWPAN_ND and MeshThread classes.
* Move all the functionality to LoWPANNDInterface and
    ThreadInterface classes.
* AbstractMesh class modified to be pure virtual
* Thread/6LoWPAN specific functionality totally separated.
    Now linker will drop the unreferenced classes.
* MeshInterfaceNanostack now inherits from AbstractMesh
2016-11-15 13:12:18 +02:00
Seppo Takalo 62558e9cff Get rid of AbstractNetworkInterface class. 2016-11-15 13:12:18 +02:00
Seppo Takalo 154d66404a Get rid of MeshInterfaceFactory. 2016-11-15 13:12:18 +02:00
Seppo Takalo 53cc28f4c5 Remove some references to YOTTA_CFG. 2016-11-15 13:12:18 +02:00
Sam Grove b6cc841a54 Merge pull request #3248 from LMESTM/fix_i2c_f411re_pins
test i2c slave: use standard Arduino pins for NUCLEO_F411RE
2016-11-14 21:50:59 -06:00
Sam Grove 71d253c86d Merge pull request #3240 from ARMmbed/ns_integration
Ns integration
2016-11-14 21:50:33 -06: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
Vincent Coubard 453045ab74 [BLE - NRF5] Add support for long write requests. 2016-11-10 16:58:07 +00:00
Anna Bridge 5fd81b37c3 Merge pull request #3232 from geky/nsapi-fix-gethostbyname-unspec-literal
nsapi - Fix missing NSAPI_UNSPEC check in gethostbyname for ip literals
2016-11-10 16:54:27 +00:00
Laurent MEUNIER 458752262e test i2c slave: use standard Arduino pins for NUCLEO_F411RE 2016-11-10 15:25:46 +01:00
Bartek Szatkowski db15c1a0a3 WiFi: Minor fixes to docs and includes 2016-11-10 09:40:48 +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
Laurent MEUNIER 4c36b9cb77 test i2c asynch : test transfer return value 2016-11-09 18:03:09 +01:00
Laurent MEUNIER 3897d93b71 test i2c asynch: Remove printf usage from interrupt context
The cbmaster_done function is a callback which will be called from
the asynch I2C interrupt handler. Calling to printf from this context
sometimes lead to missing interrupts on the slave side. This was at least
encountered on STM32F3 MCUs.
2016-11-09 18:03:07 +01:00
Seppo Takalo c71abfed26 Update NanostackSocket to match API changes in v5.0.7 2016-11-09 16:07:13 +02:00
Seppo Takalo cbb300db9c Nanostack v5.0.7 2016-11-09 15:42:41 +02:00
Seppo Takalo e27c7840d7 Don't clone coap-service, it's subtree now 2016-11-09 15:34:58 +02:00
Seppo Takalo 1e791e2e76 Add 'features/nanostack/FEATURE_NANOSTACK/coap-service/' from commit 'a1982c1de752c50410d975a03f505a69972539f5'
git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/coap-service
git-subtree-mainline: c0adb069c9
git-subtree-split: a1982c1de7
2016-11-09 15:27:17 +02:00
Seppo Takalo c0adb069c9 Remove coap-service 2016-11-09 15:26:30 +02:00
Seppo Takalo 8c669c6f40 Add 'features/FEATURE_COMMON_PAL/mbed-client-randlib/' from commit '26cdd3904f3042c21155a39e940fafb266af20d2'
git-subtree-dir: features/FEATURE_COMMON_PAL/mbed-client-randlib
git-subtree-mainline: 6aedb5aeb7
git-subtree-split: 26cdd3904f
2016-11-09 15:13:57 +02:00
Seppo Takalo 6aedb5aeb7 Remove Randlib 2016-11-09 15:10:38 +02:00
Michel Jaouen 26bd467995 TARGET_STM : USB FS device support on ST HAL 2016-11-09 12:08:50 +01:00
Christopher Haster a3ad6181f4 nsapi - Fixed missing NSAPI_UNSPEC check in gethostbyname for ip literals 2016-11-08 18:05:35 -06:00
Martin Kojtal 96e1d5bd73 Merge pull request #3221 from andreaslarssonublox/ublox_odin_w2_drivers_update
u-blox odin w2 drivers update
2016-11-08 10:24:53 +00:00
Sam Grove 074555b715 Merge pull request #3113 from geky/static-assert
Add static assert macro
2016-11-07 10:25:17 -06:00
Christopher Haster 40836b11a5 nsapi - Removed assertions on same-thread send/recv
Initially these assertions were added to protected simultaneous
send/recv from the same socket when similarly purposed mutexes were
removed.

However, simultaneous send/recv can still be useful for UDP if the
payload is guaranteed to be less than the MTU across the entire
connection.
2016-11-07 09:43:09 -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
Steven Cooreman 3cfdf8f302 Make GreenTea respect STDIO baud rate 2016-11-07 11:57:02 +01:00