Commit Graph

73 Commits (bac84a58bdbe81f6c58f9ce9b03aa4d3c13dfc4b)

Author SHA1 Message Date
sg- 3af1e6597b [net][k64f] Add access to link status in emac driver 2014-10-10 14:29:43 -05:00
0xc0170 c4a60632a8 [NET, HAL] K64F - enet edit for new header files (address used instead of instance)
- hal enet - asserts commented out as they are not valid for new MCU headers (address, no instance)
	- net - corrections for new ksdk API
2014-09-22 13:49:12 +01:00
0xc0170 fc5c9acbec [NET] K64F - enet driver addition (latest merge removed that file)
- plus API update to reflect changes in KSDK (interrupt  manager)
2014-09-19 13:33:41 +01:00
0xc0170 c8eab47e81 Merge branch 'master' of github.com:Sissors/mbed into Sissors-master
Conflicts:
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/PeripheralPins.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/PortNames.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K22F/device/MK22F51212/fsl_bitaccess.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/PeripheralPins.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/PortNames.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/analogin_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/analogout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/device/MK64F12/regs.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/gpio_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/gpio_irq_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/gpio_object.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/i2c_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/objects.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/pinmap.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/port_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/pwmout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/rtc_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/serial_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/sleep.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/spi_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_K64F/us_ticker.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/PeripheralPins.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/PortNames.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/analogin_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/analogout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/MK64F12/regs.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/MK64F12/system_MK64F12.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/gpio_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/gpio_irq_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/gpio_object.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/i2c_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/objects.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/pinmap.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/port_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/pwmout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/rtc_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/serial_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/sleep.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/spi_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/us_ticker.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/analogin_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/analogout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/gpio_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/gpio_irq_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/gpio_object.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/i2c_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/objects.h
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/pinmap.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/port_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/pwmout_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/sleep.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c
	libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/us_ticker.c
	libraries/net/eth/lwip-eth/arch/TARGET_Freescale/fsl_enet_driver.c
	workspace_tools/tests.py
2014-09-16 13:43:02 +01:00
Sissors 60df735622 [K64F] First enet fixes
Hopefully the hardware init new functions are correct
2014-09-16 13:01:23 +02:00
sg- 24f537ea60 [MTS_GAMBIT][K64F][exporters][net] Update directory names for K64F to allow derivative platforms. Change net/eth/lwip-eth/arch directory name to allow K64F derivative EthernetInterface support. Disable Ethernet in MTS_GAMBIT device.h - seems depreciated or just not implemented. Add MTS_GAMBIT exporters for uvision and gcc_arm 2014-09-04 17:26:54 -05:00
Martin Kojtal a681b14416 Change "error.h" to "mbed_error.h" to avoid conflicts with 3rd party code 2014-08-15 16:19:18 +01:00
Alexander Valitov aa157d0195 Fixed TX buffer reclaim mechanism
This was causing problems with larger transfers.
2014-07-30 15:49:49 +01:00
Martin Kojtal 09251dd3ba Revert "error.h -> mbed_error.h" 2014-07-08 14:04:50 +02:00
0xc0170 1dcc9246bd [LWIP] error.h -> mbed_error.h 2014-07-07 06:26:54 +02:00
0xc0170 372009f461 [K64F] enet - IRQ handlers are in the emac (eth) layer 2014-06-10 16:09:08 +01:00
Andreas Rebert 6d42cdc540 [LPC4088] GCC: corrected alignment problem when setting up memory region for Ethernet driver 2014-06-09 14:55:49 +02:00
Sergio Scaglia 62605dfaaa - Added initialization for Tx Fifo values and provided value for TFWR bits in ENET_TFWR register
Signed-off-by: Sergio Scaglia <sergio.scaglia@arm.com>
2014-05-22 21:43:23 -07:00
Sergio Scaglia 3c2119fab6 These changes solve:
1) Endianess of TX_DESC_UPDATED_MASK so Tx buffers can be released after tranmission.
   2) Avoid assert( ) failure due uninitialized variable in enet_hal)config_tx_fifo( ) function.

Signed-off-by: Sergio Scaglia <sergio.scaglia@arm.com>
2014-05-21 15:05:29 -07:00
unknown 87eb44e68d This change fixes the problem with K64F Ethernet support where after transmitting frames, the buffers were not released so system would eventually running out of memory.
Signed-off-by: unknown <sersca01@SERSCA01-002137.usa.Arm.com>
2014-05-13 10:29:34 -07:00
Bogdan Marinescu 518967a1d8 Fixed a couple of compilation errors in CellularModem 2014-05-08 10:58:57 +01:00
Bogdan Marinescu 94fd2228fb Added K64F TCP/IP support
Currently NET_7 (HttpClient test) and NET_8 (NTP test) fail for
unknown reasons.
2014-04-23 16:16:38 +01:00
mazgch bdd80ab5f3 add errors in case some target defines were not set properly 2014-03-20 16:06:24 +01:00
mazgch db13fa3402 init enum 2014-03-03 15:04:55 +01:00
mazgch 63f20534ca fix merge conflict 2014-03-03 12:14:44 +01:00
mazgch 0acbc6440e at command if: improve warning reporting
link monitor: added api to get local phone number to link monitor
ubx modem: added network indication led
ubx modem: better handle different modems
2014-03-03 10:36:23 +01:00
mazgch 6b9f2079f1 Add detection of LISA-C to select CDMA protocol when using serial port.
Make link monitor compatible with CDMA (no AT+COPS).
2013-12-17 11:35:23 +01:00
mazgch 6a9083527e CDMA currently only uses one CDC 2013-12-10 15:25:08 +01:00
mazgch 20776dbaa5 fixed the comparison 2013-12-09 23:43:51 +01:00
mazgch ad65dfff5a Merge branch 'master' of https://github.com/mbedmicro/mbed 2013-12-09 21:55:00 +01:00
mazgch d5da332367 only use one port with CDMA at the moment. 2013-12-09 21:48:01 +01:00
mazgch ea42c3b726 typo 2013-12-09 21:28:56 +01:00
mazgch d0d4476659 adding support for serial port 2013-12-09 21:22:02 +01:00
Andreas Rebert f5511ff82a [LPC4088]: elif should have been else 2013-12-07 12:29:06 +01:00
Andreas Rebert 4109fb7d07 [LPC4088]: Networking was broking when splitting peripheral RAM into two sections 2013-12-06 15:36:37 +01:00
Adam Green 64620e2e78 lwip: Stop dropping long TCP segments
If lwIP placed more than 2 pbufs in a TCP segment, the ethernet driver
would fail to send it as it didn't have enough Tx descriptors.  The
maximum number of pbufs outstanding for transmit that lwIP keeps is
defined by the TCP_SND_QUEUELEN macro.  I modifed the value of
LPC_NUM_BUFF_TXDESCS to take advantage of this lwIP value.  The +1
takes into account that LPC_EMAC->TxProduceIndex ==
LPC->TxConsumeIndex is reserved for indicating that the queue is empty
so a full queue uses one less than the maximum count.
2013-10-29 23:41:21 -07:00
Adam Green 692cbd11f6 lwip: Fix invalid checksum bug
tcp_write() would incorrectly byte swap the checksum 1 too many times
when concatenating a pbuf to an existing TCP segment if the number of
bytes in the concatenated data was odd.  I hit this issue when I tried
to reproduce a lost segment issue reported by a mbed user in this forum
thread: http://mbed.org/forum/mbed/topic/4354/?page=2#comment-22657
2013-10-29 23:41:21 -07:00
Bogdan Marinescu a34945661d Added CellularModem as an abstract base class for modem implementations
Now both UbloxUSBGSMModem and UbloxUSBCDMAModem inherit from
CellularModem.
2013-10-17 15:40:46 +03:00
Bogdan Marinescu 87fbaa5507 Added missing constructor for CDMA modem initializer 2013-10-17 13:52:34 +03:00
Bogdan Marinescu 7585a23e6c Added CellularModem library, removed old VodafoneUSBModem library 2013-10-17 12:01:55 +03:00
Dave Van Wagner d3963de05d Added methods to retrieve gateway and netmask from DHCP assignment 2013-10-09 13:47:41 +03:00
Adam Green 7dddd9e578 Asm versions of netstack memcpy() and lwip_standard_chksum()
For tests such as TCPEchoServer
(http://mbed.org/users/emilmont/notebook/networking-libraries-benchmark/)
this change showed a 28% improvement (14Mbps to 18Mbps) when the echo
test was modified to instead use 1K data buffers.

I targetted these two functions based on manual profiling samples which
showed that a great deal of time was being spent in these two functions
when the network stack was being slammed with UDP packets.
2013-08-30 06:09:16 -07:00
Adam Green b0c0f47c7d Changed leading whitespace back to tab.
The leading whitespace preceeding the fields in the lpc_enetdata
structure definition were originally a tab and I used 4 spaces when
I added RxThread.
2013-08-27 23:57:24 -07:00
Adam Green 8cf3e658d1 Don't use semaphore from ENET_IRQHandler to packet_rx
I now use a signal to communicate when a packet has been received by
the ethernet hardware and should be processed by the packet_rx thread.
Previously the change to make the lwIP stack thread safe introduced
enough delay in packet_rx that the semaphore count could lag behind
the processed packets and overflow its maximum token count.  Now the
ISR uses the signal to indicate that >= 1 packet has been received
since the last time packet_rx() was awaken.

Previously the ethernet driver used generic sys_arch* APIs exposed from
lwIP to manipulate the semaphores.  I now call CMSIS RTOS APIs
directly when using the signals.  I think this is acceptable since that
same driver source file already contains similar os* calls that talk
directly to the RTOS.
2013-08-27 23:38:42 -07:00
Adam Green 2bed996462 Revert "net: Only process 1 packet per ethernet RX interrupt"
This reverts commit acb35785c9.

It turns out that this commit actually causes problems if an ethernet
interrupt is dropped because a higher privilege task is running, such
as LocalFileSystem accesses.  If this happens, the semaphore count isn't
incremented enough times and the packet_rx() thread will fall behind and
end up running as though it had only one ethernet receive buffer.  This
causes even more lost packets.

I plan to fix this by switching the semaphore to be a signal so that
the syncronization object is more boolean.  It simply indicates if an
interrupt has arrived since the last time packet_rx() was awaken to
process inbound packets.
2013-08-27 22:24:47 -07:00
Adam Green de8161fde1 net: Reset pbuf length when re-queueing on error.
I recently pulled a NXP crash fix for their ethernet driver which will
requeue a pbuf to the ethernet driver rather than sending it to the
lwip stack if it can't allocate a new pbuf to keep the ethernet
hardware primed with available packet buffers.  While recently
reviewing this code I noticed that the full size of the pbuf wasn't
used on this re-queueing operation but the size of the last received
packet.  I now reset the pbuf size back to its originally allocated
size before doing this requeue operation.
2013-08-27 22:24:03 -07:00
Adam Green acb35785c9 net: Only process 1 packet per ethernet RX interrupt
Previously the packet_rx() function would wait on the RxSem and when
signalled it would process all available inbound packets.  This used to
cause no problem but once the thread synchronization was turned
on via SYS_LIGHTWEIGHT_PROT, the semaphore actually started to overflow
its maximum token count of 65535.  This caused the mbed_die() flashing
LEDs of death.  The old code was really breaking the producer/consumer
pattern that I typically see with a semaphore since the consumer was
written to consume more than 1 produced object per semaphore wait.
Before the thread synchronization was enabled, the packet_rx() thread
could use a single time slice to process all of these packets and then
loop back around a few more times to decrement the semaphore count
while skipping the packet processing since it had all been done.
Now the packet processing code would cause the thread to give up its
time slice as it hit newly enabled critical sections.  In the end it
was possible for the code to leak 2 semaphore signals for every 1 by
which the thread was awaken.  After about 10 seconds of load, this
would cause a leak of 65535 signals.

NOTE: Two potential issues with this change:
1) The LPC_EMAC->RxConsumeIndex != LPC_EMAC->RxProduceIndex check was
   removed from packet_rx().  I believe that this is Ok since the same
   condition is later checked in lpc_low_level_input() anyway so it
   won't now try to process more packets than what exist.
2) What if ENET_IRQHandler(void) ends up not signalling the RxSem for
   every packet received?  When would that happen?  I could see it
   happening if the ethernet hardware would try to pend more than 1
   interrupt when the priority was too elevated to process the
   pending requests.  Putting the consumer loop back in packet_rx()
   and using a Signal instead of a Semaphore might be a better
   solution?
2013-08-27 22:24:03 -07:00
Adam Green f5ec5d3ab2 net: Enable SYS_LIGHTWEIGHT_PROT
This option actually enables the use of the lwip_sys_mutex for
protecting concurrent access to such important lwIP resources as:
  select_cb_list (this is the one which orig flagged problem)
  sockets array
  mem stats (if enabled)
  heap (if LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT was non-zero)
  memp pool allocs/frees
  netif->loop_last pbuf linked list
  pbuf reference counts
  ...

I first noticed this issue when I hit a crash while slamming the net
stack with a large number of TCP packets (I was actually sending 1k
data buffers from the TCPEchoServer mbed sample.)  It crashed in the
last line of this code snippet from event_callback:
  for (scb = select_cb_list; scb != NULL; scb = scb->next) {
    if (scb->sem_signalled == 0) {

It was crashing because scb had an invalid address so it generated a
bus fault.  I figured that memory was either corrupted or there was
some kind of concurrency issue.  In trying to determine which, I wanted
to walk through the select_cb_list linked list and see where it was
corrupted:
    (gdb) p scb
    $1 = (struct lwip_select_cb *) 0x85100080
    (gdb) p select_cb_list
    $2 = (struct lwip_select_cb *) 0x0

That was interesting, the head of the linked list was now NULL but it
must have had a non-NULL value when this loop started running or we
would have never gotten to the point where we hit this crash.

This was starting to look like a concurrency issue since the linked
list was modified out from underneath this thread.  Looking through the
source code for this function, I saw use of macros like
SYS_ARCH_PROTECT and SYS_ARCH_UNPROTECT which looked like they should
be providing the thead synchronization.  I disassembled the
event_callback() function in the debugger and saw no signs of the
usage of synchronizition APIs that I expected.  A search
through the code for the definition of these SYS_ARCH_UN/PROTECT
macros led me to discovering that they were actually ignored unless an
implementation defined them itself (the mbed version doesn't do so) or
the SYS_LIGHTWEIGHT_PROT macro is set to non-zero (the mbed version
didn't do this either).  Flipping the SYS_LIGHTWEIGHT_PROT macro on in
lwipopts.h fixed the crash I kept hitting, increased the size of the
code a bit, and unfortunately slows things down a bit since it now
actually serializes access to these data structures by making calls
to the RTOS sync APIs.
2013-08-27 22:24:03 -07:00
Adam Green fa392423c8 Silence GCC unused variable warning.
After making my previous commit to completely disable LWIP_ASSERT
macro invocations, I ended up with a warning in pbuf.c where an
err variable was set but only checked for success in an assert.  I
added a "(void)err;" reference to silence this warning.
2013-08-27 22:24:03 -07:00
Adam Green 4603d729f9 net: Fully disable LWIP_ASSERTs
I was doing some debugging that had me looking at the disassembly of
lpc_rx_queue() from within the debugger.  I was looking for the call to
pbuf_alloc() that we see in the following code snippet:
		p = pbuf_alloc(PBUF_RAW, (u16_t) EMAC_ETH_MAX_FLEN, PBUF_RAM);
		if (p == NULL) {
			LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
				("lpc_rx_queue: could not allocate RX pbuf (free desc=%d)\n",
				lpc_enetif->rx_free_descs));
			return queued;
		}

		/* pbufs allocated from the RAM pool should be non-chained. */
		LWIP_ASSERT("lpc_rx_queue: pbuf is not contiguous (chained)",
			pbuf_clen(p) <= 1);

When I was looking through the disassembly for this code I noticed a
call to pbuf_clen() in the actual machine code.
=> 0x0000bab0 <+24>:	bl	0x44c0 <pbuf_clen>
   0x0000bab4 <+28>:	ldr	r3, [r4, #112]	; 0x70
   0x0000bab6 <+30>:	ldrh.w	r12, [r5, #10]
   0x0000baba <+34>:	add.w	r2, r3, #9
   0x0000babe <+38>:	add.w	r0, r12, #4294967295	; 0xffffffff

The only call to pbuf_clean made from this function is made from
within the LWIP_ASSERT.  When I looked more closely at how this macro
was defined, I saw that the mbed version of the stack had disabled the
LWIP_PLATFORM_ASSERT macro when LWIP_DEBUG was false which means that
no action will be taken if the assert is false but it still allows the
LWIP_ASSERT macro to potentially evaluate the assert expression.
Defining the LWIP_NOASSERT macro will fully disable the LWIP_ASSERT
macro.

I saw one of my TCP/IP samples shrink about 0.5K when I made this
change.
2013-08-27 22:24:03 -07:00
Adam Green e0fb0a8f9b Don't dereference NULL ipaddr in netif_set_ipaddr()
The code in netif_set_ipaddr would read the memory pointed to by its
ipaddr parameter, even if it was NULL on this line:
  if ((ip_addr_cmp(ipaddr, &(netif->ip_addr))) == 0) {
On the Cortex-M3, it is typically OK to read from address 0 so this
code will actually compare the reset stack pointer value to the
current value in netif->ip_addr.

Later in the code, this same pointer will be used for a second read:
  ip_addr_set(&(netif->ip_addr), ipaddr);

The ip_addr_set call will first check to see if the ipaddr is NULL and
if so, treats it like IP_ADDR_ANY (4 bytes of 0).
    /** Safely copy one IP address to another (src may be NULL) */
    #define ip_addr_set(dest, src) ((dest)->addr = \
                                        ((src) == NULL ? 0 : \
                                        (src)->addr))

The issue here is that when GCC optimizes this code, it assumes that
the first dereference of ipaddr would have thrown an invalid memory
access exception and execution would never make it to this second
dereference.  Therefore it optimizes out the NULL check in ip_addr_set.

The -fno-delete-null-pointer-checks will disable this optimization and
is a good thing to use with GCC in general on Cortex-M parts.  I will
let the mbed guys make that change to their build system.

I have however corrected the code so that the intent of how to handle a
NULL ipaddr is more obvious and gets rid of the potential NULL
dereference.

By the way, this bug caused connect() to fail in obtaining an
address from DHCP.  If I recall correctly from when I first debugged
this issue (late last year), I actually saw the initial value of the
stack pointer being used in the DHCP request as an IP address which
caused it to be rejected.
2013-08-15 19:02:51 -07:00
Bogdan Marinescu 6744f47359 Changed definition structure of ETHMEM_SECTION
This structure makes it easier to add more targets/toolchains in the
future and it's (arguably) a bit easier to read.
2013-08-15 15:56:24 +03:00
Bogdan Marinescu 1e4c9bed66 Merge remote-tracking branch 'github/master' 2013-08-15 15:18:52 +03:00
Adam Green 28a3466d11 Fixups to network code after recent merges.
Peter's and my changes to LPC1768.ld ended up adding the same AHBSRAM0
and AHBSRAM1 section clauses to the script twice.  I removed one copy.

I also pulled Peter's define of the ETHMEM_SECTION macro up into the
previous nested #if so that the preprocessor wouldn't spit out a
redefined macro warning.

I verified that building the code clean before and after these changes
still results in the same .bin file but now without warnings and/or
duplicate code.
2013-08-15 04:40:53 -07:00
Bogdan Marinescu 44c43e6e38 Restore C++98 compilation mode
Also, remove the line that required C++11 from UDPSocket.h
2013-08-15 14:09:20 +03:00