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")
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.
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.
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.
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.
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.
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>
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()
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.
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]
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.
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.