Commit Graph

957 Commits (1403dfc086b406650d4b3b38b38835b415cc55c9)

Author SHA1 Message Date
Sam Grove 109269da9c Merge pull request #4414 from tkaman/master
Enable CM3DS_MPS2 target
2017-06-15 11:20:09 -05:00
Russ Butler 9620b0fc7f STM32 - fix bug were sockets stop receiving data
The function _eth_arch_low_level_input() is meant to pass data into
LWIP and to prepare the ethernet buffers to receive more data.
If the LWIP heap is empty and the call to pbuf_alloc() in
_eth_arch_low_level_input returns null, the ethernet receive buffers
are not updated to receive data. Because of this the ethernet RX
interrupt will not fire. Since the RX interrupt is the only thing that
triggers a call to _eth_arch_low_level_input(), the receive buffers
will never get cleared, and the device stops receiving data.

To prevent this from happening, this patch ensures that the function
_eth_arch_low_level_input() clears the receive buffers even if a new
pbuf for the data couldn't be allocated.

This issue can be reproduce by running the test
"features-feature_lwip-tests-mbedmicro-net-udp_echo_parallel"
and on the same machine running the below python script to flood the
device with UDP broadcast packets:

MY_IP = #ADD your local IP here
from socket import *
s = socket(AF_INET, SOCK_DGRAM)
s.bind((MY_IP, 1234))
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
for _ in range(1000):
    s.sendto("test data", ('255.255.255.255', 1234))
print("Message sent")
2017-06-12 22:18:04 -05:00
Martin Kojtal d0d7c6f4f6 lwip: fix stm32f4 eth conf file
This file is moved to targets that support eth. It can't be common for any F4, as
not all targets from this family support eth.
2017-06-10 15:20:30 +01:00
Brian Daniels 4f5a199336 Fix bad print message in test 2017-06-10 15:14:28 +01:00
Brian Daniels 00a41add12 Fixing typos in docs 2017-06-10 15:14:28 +01:00
Brian Daniels 94b4160347 Fixing bad asserts 2017-06-10 15:14:28 +01:00
Brian Daniels f616bf28f6 Adding comments for added Greentea function 2017-06-10 15:14:28 +01:00
Brian Daniels c38b709685 Cleaning up udp tests 2017-06-10 15:14:28 +01:00
Brian Daniels ccad027fa7 Adding comments describing buffer prep functions 2017-06-10 15:14:28 +01:00
Brian Daniels 388968f76b Simplifying assert statements 2017-06-10 15:14:28 +01:00
Brian Daniels 6e76fce4fc Specifying default length of UUID for Greentea
This creates a macro for the UUID length used by Greentea. This cuts
down on the use of "magic numbers" in test cases that use
the GREENTEA_SETUP_UUID function.
2017-06-10 15:14:28 +01:00
Christopher Haster d451d1795e Moved network test buffers into heap
This is a workaround for IAR's lack of flexibility with memory regions.
Otherwise these tests would use very little heap and be mostly global
allocations.
2017-06-10 15:14:28 +01:00
Christopher Haster 467eb342f0 lwip: Migrated to utest framework
per @bridadan
2017-06-10 15:14:28 +01:00
Christopher Haster 0887683a13 lwip: Fixed count of udp iterations to reflect attempts 2017-06-10 15:14:28 +01:00
Christopher Haster 036f1cdfd4 lwip: Added udp buffer flushing after dropped packets
Avoids getting stuck in loop where the device always picks
up the previous test's packets
2017-06-10 15:14:28 +01: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
Brian Daniels 70dd7cc273 Fixing some issues in the tcp/udp tests 2017-06-10 15:14:28 +01:00
Brian Daniels f313bc2988 Arranging logic in test to prevent left-over behavior 2017-06-10 15:14:28 +01:00
Brian Daniels dc87aaad1c Making udp_echo_parallel test more robust against network issues.
Making the test more forgiven for minor networking issues. Also adding
more debug prints to make it easier to see which packets are coming from
where.
2017-06-10 15:14:28 +01:00
Brian Daniels acaf435d64 Making UDP test less strict on dropped/mismatched packets.
Before, the UDP test was very strict on the number of packets it would
try to match before failing. Now it will keep trying for the whole test
to get enough passing packets. It also includes the test's UUID so you
can validate which packets are being received.
2017-06-10 15:14:28 +01:00
Brian Daniels 551ff03dc0 Adding ability to preserve Greentea UUID in test.
The Greentea UUID can be used as a source of entropy/randomness during
the test. This is useful for uniquely identifying a test run.
2017-06-10 15:14:28 +01:00
Brian Daniels 98a5262361 Adding failure logs to TCP echo test.
This adds some extra logs to the test for debugging purposes. Also
allows the test to fail immediately if it fails to obtain an IP address.
2017-06-10 15:14:28 +01:00
Brian Daniels 26eafd9958 Allowing dtls test to retry correctly.
The dtls test already has the ability to retry upon a UDP failure.
However the sockets are currently configured to be blocking and to wait
forever. I added a timeout of 1.5 seconds in order the test to correctly
timeout.
2017-06-10 15:14:28 +01:00
gabker01 fb6a2c075c Implement low-level Ethernet interface for lwIP
Based on lwip_ethernetif.c skeleton file,
use init, receive and transfer
functionality of SMSC9220 Ethernet driver
for the lightweight IP stack.

Receive mechanism is interrupt driven.

HW buffer sizes:
Tx = 4608 bytes (MTU)
Rx = 10560 bytes

lwIP fine tuning:
mbed-os/features/FEATURE_LWIP/lwip-interface/lwip/src/include/lwip/opt.h

Change-Id: I0ea95650c65fb32cafb5c2d3dde11420c61dba66
Signed-off-by: Gabor Kertesz <gabor.kertesz@arm.com>
2017-06-09 14:58:31 +01:00
Mika Leppänen ee30df993a Disabled lwip ethernet ipv6 multicast filter for STM boards 2017-06-09 11:57:24 +03:00
Sam Grove 8e76bf6da6 Merge pull request #4508 from kegilbert/kg-doxygen-framework-hal-rtos
Doxygen combined HAL, RTOS, and features/Framework updates to not produce warnings and errors [DOC Changes Only]
2017-06-08 23:52:33 -05:00
Sam Grove 52fde55b6f Merge pull request #4450 from deepikabhavnani/doxygen-template
Doxygen template
2017-06-08 22:42:06 -05:00
Kevin Gilbert 090e63f36a Placed verbatim tags around a pair of brackets that Doxygen interpreted as xml tags 2017-06-08 17:12:03 -05:00
Sam Grove 1afb23bdd8 Merge pull request #4441 from tung7970/fix-mbedos
lwip - fix typo and cleanup coding style
2017-06-08 16:30:16 -05:00
Kevin Gilbert 57a70d93f9 Resolved Doxygen build errors 2017-06-08 15:53:27 -05:00
Deepika 6ee4c7e219 Fix doxygen warnings in 'features/filesystem' 2017-06-08 15:48:21 -05:00
Seppo Takalo a36c9abca0 Fix compilation for NCS36510 RF driver.
RTX porting for this driver was done against the previous API that
have now been reverted.
2017-06-08 13:54:33 +03:00
Sam Grove 9f4b72d401 Merge pull request #4493 from ARMmbed/fix_timer_stack
Fix typo that used 16kB for stack.
2017-06-07 21:50:09 -05:00
Sam Grove 28eaac360a Merge pull request #4449 from c1728p9/lpc1768_fix
Fix semaphore usage on lpc1768 emac
2017-06-07 21:49:25 -05:00
Sam Grove 744b95cc9f Merge pull request #4425 from sg-/doxygen-template
Doxygen template and CI to not produce warnings and errors
2017-06-07 11:18:47 -05:00
Seppo Takalo 2f5b03e876 Fix typo that used 16kB for stack.
Intend is to use 2kB for stack, not 16kB, but the divide operand
has been forgotten here.
2017-06-07 15:36:09 +03:00
Sam Grove 28f590fc4c Merge pull request #4430 from pan-/utest_cases_romable
utest optimization: Allow case data structure to be put in ROM.
2017-06-06 19:58:53 -05:00
Sam Grove 6002bdd533 Merge pull request #4439 from sg-/proper-realtek-fix
Proper fix for 1fa30b7403
2017-06-06 16:00:55 -05:00
Sam Grove e9e937df04 Merge pull request #4454 from c1728p9/warning_fixes
Warning fixes
2017-06-06 16:00:02 -05:00
Antti Yli-Tokola d399395eab Revert Initialize remove_from_list flag to true.
* Cause regression in cloud registration
2017-06-06 13:48:42 +03:00
Antti Yli-Tokola fe808e0db5 mbed-coap fixes.
This commit includes:
 * Add support for sending response to duplicate messages
 * Add randomness for retransmission time
 * Fix usage sn coap blockwise max time data stored
 * CoAP parser option handler does not seem to handle "Option Length" completely according to spec
 * Handle '0' value if duplication buffer size is set through the sn_coap_protocol_set_duplicate_buffer_size()
2017-06-06 09:43:21 +03:00
Russ Butler 0de35e2a21 Fix config store deprecation warnings
Silence deprecation warnings in the config store C and C++ files. This
removes warnings that not relevant to applications. Note - using
these deprecated functions still gives an error outside of these files.
2017-06-05 18:06:10 -05:00
Russ Butler 2d7cf60278 Fix warning about unused mutex
Move the metrics mutex into the ifdef MBED_STACK_STATS_ENABLED since
it is not used ouside of it. This fixes the warning:
[Warning] greentea_metrics.cpp@37,28: 'mutex' defined but not used [-Wunused-variable]
2017-06-05 18:06:08 -05:00
Jimmy Brisson aabecf633b Remove doxygen warnings in nsapi 2017-06-05 17:32:46 -05:00
Russ Butler e57869039e Fix semaphore usage on lpc1768 emac
The semaphore xTXDCountSem had the count to match the number of
resources available, but was being used as a binary semaphore in a
loop to listen for events. This patch updates the logic to make use of
the resource count.

With RTX5 the OS traps with an error if the a semaphore is released
more times than its count with an error similar to
"Semaphore 10000e6c error -17". Because xTXDCountSem is being used
as a binary semaphore it triggered this trap. With this patch the
semaphore is no longer used as a binary semaphore and no longer traps.
2017-06-05 11:37:06 -05:00
Vincent Coubard f36619b859 utest_case.h : Fix comment indentation 2017-06-05 16:06:17 +01:00
Vincent Coubard 165d76ae25 utest case: Indicate explicitely that no data member shall be declared in
the Case class.
2017-06-05 16:06:17 +01:00
Vincent Coubard 5b27d65755 utest optimization: Allow case data structure to be put in ROM.
This patch split the Case class in two entities: Case and case_t. case_t contains the test case data structure while Case provide the interface to the test case. Unlike the class Case, case _t is a POD and can be instantiated at compile time and put in the constant data section (in ROM).

The Specification class has also been modified to accept arrays of case_t.
2017-06-05 16:06:17 +01:00
Anna Bridge 9d6a255a49 Merge pull request #4436 from NXPmicro/Fix_USB_Driver
Issue#4250: Fix USB driver for Kinetis devices
2017-06-05 14:36:38 +01:00
Tony Wu af3d6a52d1 lwip - fix typo and cleanup coding style
Signed-off-by: Tony Wu <tung7970@gmail.com>
2017-06-05 16:26:30 +08:00