Commit Graph

47 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
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 1afb23bdd8 Merge pull request #4441 from tung7970/fix-mbedos
lwip - fix typo and cleanup coding style
2017-06-08 16:30:16 -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
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
Yuguo Zou f000eb3401 Restore TCPIP_THREAD_STACKSIZE and thread_stack_main
move some TCPIP stack data to heap;
switch off GDMA for SPI (only for SPI);
TCPIP_THREAD_STACKSIZE and thread_stack_main are identical to ARMmbed
2017-06-03 20:15:01 +01:00
Yuguo Zou 15d58690e9 fold static variables in RTWInterface.cpp to .h, modify lwipopts.h TCPIP_THREAD_STACKSIZE 2017-06-03 20:14:59 +01:00
Archcady 6a47d01c4a Rename Lwipopts_conf.h to lwipopts_conf.h 2017-06-03 20:14:51 +01:00
Archcady d0488c1076 Rename features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/target_realtek/Lwipopts_conf.h to features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_Realtek/Lwipopts_conf.h 2017-06-03 20:14:50 +01:00
Archcady 3d59643061 Add lwipopts_conf.h 2017-06-03 20:14:45 +01:00
Sam Grove 5f138810a9 Merge pull request #4294 from ARMmbed/feature_cmsis5
Update CMSIS-Core and RTX to version 5
2017-06-02 23:44:32 -05:00
Hasnain Virk 658ddf7c30 ARMCC link errors fixed, nsapi_ppp glue layer changed
GCC have not been capable enough to catch some linker errors which arose when
ethernet support for LWIP was disabled. Checks have been added to make sure that
unrefrenced code is not linked in.

nsapi_ppp glue layer is made more transparent to public cellular API. Storage of IP
addresses is removed. PPP layer already stores the addresses, so we pass the pointer back
to the upper layers.

If PPP is not used, we provide dummy functions.
2017-05-31 15:02:11 +03:00
Hasnain Virk 01088647b9 Finalizing the public API for Cellular
* state machine corrections
* adding various standard API methods
* Addition/revision/enhancement of the nsapi_ppp glue layer
* Turning off debug by default
2017-05-31 15:02:11 +03:00
Kevin Bracey d0820d1ed3 Cope with different LWIP configurations 2017-05-31 15:02:11 +03: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
0x6d61726b acf18ac9c7 removed warning: unused variable 'ethhdr' [-Wunused-variable] 2017-04-30 16:29:47 +02: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
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
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
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 93f02e4fed Renamed filter constant 2017-02-21 14:30:45 +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
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
cyliangtw 0053b70d1e [NUC472] Fix LWIP implementation contains printf issue #3441 2016-12-14 15:12:58 +08: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
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
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 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
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
cyliangtw 1c1257dcb1 EMAC buffer address word alignment 2016-10-11 10:55:08 +08:00
cyliangtw 82ef4ef047 remove warnings 2016-10-11 10:55:08 +08:00
andreas.larsson 1d3c63d9bb Changed name for the target UBLOX_C029 to UBLOX_EVK_ODIN_W2 2016-10-03 12:10:50 +02:00
Christopher Haster ba99a1f31d restructure - Restructured features/net directory
features/net/network-socket -> features/netsocket
features/net/FEATURE_IPV4 -> features/FEATURE_LWIP
features/net/nanostack-binaries -> features/nanostack
features/net/FEATURE_NANOSTACK -> features/nanostack/FEATURE_NANOSTACK
2016-09-30 19:18:09 -05:00