Commit Graph

958 Commits (3e63c20bba2a01acdb8ca674eb63e9f6ce8fa48e)

Author SHA1 Message Date
Hasnain Virk 253ceee0f2 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-20 17:13:40 +01:00
Yuguo Zou 334c0aafc6 A better approach to flip "netif_inited" 2017-06-20 17:13:40 +01:00
Yuguo Zou a9b1b1c9d4 replace tab with space 2017-06-20 17:13:40 +01:00
Yuguo Zou 8d21488b42 resolve lwip init twice issue
resolve wifi example test fail before lwip is init
2017-06-20 17:13:39 +01:00
Azim Khan 101cf5e6a3 Remove multiple definition of GREENTEA_SETUP added due to rebase 2017-06-20 17:13:38 +01:00
Azim Khan 0ffbf756d5 Merge greentea-client/test_env_c.h into greentea-client/test_env.h 2017-06-20 17:13:38 +01:00
Azim Khan 9c11240b48 Revert greentea_getc() to return 'int' 2017-06-20 17:13:38 +01:00
Azim Khan c682fb5b74 Use existing functions for Greentea client C API 2017-06-20 17:13:37 +01:00
Azim Khan b0329aea59 Add getc in C API 2017-06-20 17:13:37 +01:00
Mohammad Azim Khan 739d5ecdff C API for greentea client 2017-06-20 17:13:37 +01:00
Christopher Haster 28d2b202c8 Added reporting of reserved heap
Note: Reporting of reserved stack is already performed by the thread
layer
2017-06-20 17:13:35 +01:00
Christopher Haster 8206b4282e fatfs: Fixed initialization of block device in mount/unmount functions
At some point the "mount" parameter for "f_mount" was name "force". This
led to a bit of confusion that ended with the default mount function
never calling block device init.

This is fine, since the block device can be manually initialized, but
a better user experience is where the filesystem initializes the block
device for the user.

This is backwards compatible due to the repeatability of the block
device init functions.
2017-06-20 17:13:35 +01:00
gabker01 9b890198dd 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-20 17:13:31 +01:00
Russ Butler be54981ab4 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-13 09:42:14 +01:00
Martin Kojtal e544ee4e28 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-11 09:48:45 +01:00
Brian Daniels 3a98bde1cc Fix bad print message in test 2017-06-11 09:48:44 +01:00
Brian Daniels dad8e4e61a Fixing typos in docs 2017-06-11 09:48:44 +01:00
Brian Daniels 291dc66b3e Fixing bad asserts 2017-06-11 09:48:44 +01:00
Brian Daniels 0168802b6b Adding comments for added Greentea function 2017-06-11 09:48:44 +01:00
Brian Daniels 12658f9285 Cleaning up udp tests 2017-06-11 09:48:43 +01:00
Brian Daniels 20240c043e Adding comments describing buffer prep functions 2017-06-11 09:48:43 +01:00
Brian Daniels fdeef22f14 Simplifying assert statements 2017-06-11 09:48:43 +01:00
Brian Daniels b44e7e9921 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-11 09:48:42 +01:00
Christopher Haster dfae18ab4a 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-11 09:48:42 +01:00
Christopher Haster bb2d327095 lwip: Migrated to utest framework
per @bridadan
2017-06-11 09:48:42 +01:00
Christopher Haster be97cef9ed lwip: Fixed count of udp iterations to reflect attempts 2017-06-11 09:48:41 +01:00
Christopher Haster 5ad880c327 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-11 09:48:41 +01:00
Christopher Haster 5312219452 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-11 09:48:41 +01:00
Brian Daniels d39703bb6e Fixing some issues in the tcp/udp tests 2017-06-11 09:48:41 +01:00
Brian Daniels 50912c004e Arranging logic in test to prevent left-over behavior 2017-06-11 09:48:40 +01:00
Brian Daniels f962854054 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-11 09:48:40 +01:00
Brian Daniels 89be202424 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-11 09:48:40 +01:00
Brian Daniels 4bc6fd4da7 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-11 09:48:39 +01:00
Brian Daniels 39c898cac7 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-11 09:48:39 +01:00
Brian Daniels d853c364d2 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-11 09:48:39 +01:00
Mika Leppänen e5026ed88a Disabled lwip ethernet ipv6 multicast filter for STM boards 2017-06-11 09:48:37 +01:00
Kevin Gilbert 87cd2059dd Placed verbatim tags around a pair of brackets that Doxygen interpreted as xml tags 2017-06-11 09:48:29 +01:00
Kevin Gilbert c024f57832 Resolved Doxygen build errors 2017-06-11 09:48:29 +01:00
Deepika 78d90d8bab Fix doxygen warnings in 'features/filesystem' 2017-06-11 09:48:27 +01:00
Tony Wu 9f2d494660 lwip - fix typo and cleanup coding style
Signed-off-by: Tony Wu <tung7970@gmail.com>
2017-06-11 09:48:26 +01:00
Seppo Takalo 4dbb39c24a Fix compilation for NCS36510 RF driver.
RTX porting for this driver was done against the previous API that
have now been reverted.
2017-06-11 09:48:18 +01:00
Seppo Takalo 8d2537ba9c 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-11 09:48:15 +01:00
Russ Butler 9fef5bbef3 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-11 09:48:15 +01:00
Jimmy Brisson 633efd795d Remove doxygen warnings in nsapi 2017-06-11 09:48:15 +01:00
Vincent Coubard 747b624594 utest_case.h : Fix comment indentation 2017-06-11 09:48:08 +01:00
Vincent Coubard c11d497803 utest case: Indicate explicitely that no data member shall be declared in the Case class. 2017-06-11 09:48:07 +01:00
Vincent Coubard 9d67ce2d91 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-11 09:48:07 +01:00
Sam Grove afe80f8de6 Proper fix for 1fa30b7403
Replace #define with typedef
2017-06-11 09:48:07 +01:00
Russ Butler 91c1089b8a 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-11 09:48:06 +01:00
Russ Butler 52b767496e 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-11 09:48:06 +01:00