- added uIP to LM3S demo programs to test bootloader reactivation. still needs some improvements.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@92 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2014-07-17 07:11:41 +00:00
parent 677ebf8a15
commit da0194b0ac
60 changed files with 7720 additions and 2725 deletions

View File

@ -283,25 +283,60 @@ begin
end;
end;
//---------------- start the programming session --------------------------------------
// we now have a socket connected to the target. next attempt to connect to the target
// via XCP.
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
// note that a running user program might have received the connect command and
// performed a software reset to activate the bootloader. this causes a reconfigu-
// ration of the ethernet controller so we need to disconnect the socket here and
// wait for it to reconnect.
MbiCallbackOnInfo('No response from target. Disconnecting TCP/IP socket.');
MbiCallbackOnLog('No response from target. Disconnecting TCP/IP socket. t='+TimeToStr(Time));
loader.Disconnect;
// connect the transport layer
MbiCallbackOnInfo('Connecting to target via TCP/IP.');
MbiCallbackOnLog('Connecting to target via TCP/IP. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
if not loader.Connect then
begin
// update the user info
MbiCallbackOnInfo('Could not connect via TCP/IP. Retrying. Reset your target if this takes a long time.');
MbiCallbackOnLog('Transport layer connection failed. Check the configured IP address and port. t='+TimeToStr(Time));
MbiCallbackOnLog('Retrying transport layer connection. Reset your target if this takes a long time. t='+TimeToStr(Time));
Application.ProcessMessages;
Sleep(5);
if stopRequest then
// continuously try to connect the transport layer
while not loader.Connect do
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Transport layer connection cancelled by user.');
Exit;
end;
end;
end;
//---------------- start the programming session --------------------------------------
MbiCallbackOnLog('Starting the programming session. t='+TimeToStr(Time));
// try initial connect via XCP
if not loader.StartProgrammingSession then
begin
// update the user info
MbiCallbackOnInfo('Could not connect. Please reset your target...');
MbiCallbackOnLog('Connect failed. Switching to backdoor entry mode. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to connect via XCP true the backdoor
while not loader.StartProgrammingSession do
begin
Application.ProcessMessages;
Sleep(5);
if stopRequest then
begin
MbiCallbackOnError('Programming session cancelled by user.');
Exit;
end;
end;
end;
end;

View File

@ -260,16 +260,17 @@ begin
timer.Enabled := False;
// connect the transport layer
MbiCallbackOnInfo('Connecting the transport layer.');
MbiCallbackOnLog('Connecting the transport layer. t='+TimeToStr(Time));
MbiCallbackOnInfo('Connecting to target via TCP/IP.');
MbiCallbackOnLog('Connecting to target via TCP/IP. t='+TimeToStr(Time));
Application.ProcessMessages;
if not loader.Connect then
begin
// update the user info
MbiCallbackOnInfo('Could not connect to transport layer. Automatically retrying...');
MbiCallbackOnLog('Transport layer connection failed. Automatically retrying. t='+TimeToStr(Time));
MbiCallbackOnInfo('Could not connect via TCP/IP. Retrying. Reset your target if this takes a long time.');
MbiCallbackOnLog('Transport layer connection failed. Check the configured IP address and port. t='+TimeToStr(Time));
MbiCallbackOnLog('Retrying transport layer connection. Reset your target if this takes a long time. t='+TimeToStr(Time));
Application.ProcessMessages;
// continuously try to coonect the transport layer
// continuously try to connect the transport layer
while not loader.Connect do
begin
Application.ProcessMessages;

Binary file not shown.

View File

@ -42,7 +42,7 @@
** \return none.
**
****************************************************************************************/
static void BootActivate(void)
void BootActivate(void)
{
/* perform software reset to activate the bootoader again */
SysCtlReset();

View File

@ -38,6 +38,7 @@
****************************************************************************************/
void BootComInit(void);
void BootComCheckActivationRequest(void);
void BootActivate(void);
#endif /* BOOT_H */

View File

@ -41,6 +41,7 @@
#include "irq.h" /* IRQ driver */
#include "led.h" /* LED driver */
#include "time.h" /* Timer driver */
#include "net.h" /* TCP/IP server application */
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"

View File

@ -1,12 +1,12 @@
<!DOCTYPE CrossStudio_Project_File>
<solution Name="lm3s6965_crossworks" target="8" version="2">
<project Name="demoprog_ek_lm3s6965">
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_gcc_target="arm-unknown-eabi" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_long_calls="Yes" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/driverlib" gcc_entry_point="reset_handler" gcc_optimization_level="None" linker_additional_files="" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_width_precision_supported="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Common" Placement="Flash" Target="LM3S6965" arm_architecture="v7M" arm_core_type="Cortex-M3" arm_gcc_target="arm-unknown-eabi" arm_linker_heap_size="128" arm_linker_process_stack_size="0" arm_linker_stack_size="128" arm_long_calls="Yes" arm_simulator_memory_simulation_filename="$(TargetsDir)/LM3S/LM3SSimulatorMemory.dll" arm_simulator_memory_simulation_parameter="0x40000;0x10000" arm_target_debug_interface_type="ADIv5" arm_target_loader_applicable_loaders="Flash" arm_target_loader_default_loader="Flash" arm_use_gcc_libraries="Yes" build_intermediate_directory="$(Configuration)/../../obj" build_output_directory="$(ProjectDir)/../bin" c_preprocessor_definitions="gcc" c_user_include_directories="$(ProjectDir)/..;$(ProjectDir)/../lib;$(ProjectDir)/../lib/inc;$(ProjectDir)/../lib/uip;$(ProjectDir)/../lib/driverlib;$(ProjectDir)/../../../../Source/third_party/uip/uip" gcc_entry_point="reset_handler" gcc_optimization_level="None" linker_additional_files="" linker_memory_map_file="$(TargetsDir)/LM3S/LM3S6965_MemoryMap.xml" linker_output_format="srec" linker_printf_width_precision_supported="No" linker_scanf_fmt_level="int" linker_section_placement_file="$(StudioDir)/targets/Cortex_M/flash_placement.xml" project_directory="" project_type="Executable" property_groups_file_path="$(TargetsDir)/LM3S/propertyGroups.xml" target_get_partname_script="GetPartName()" target_reset_script="Reset()"/>
<configuration Name="Flash" arm_target_flash_loader_file_path="$(TargetsDir)/LM3S/Release/Loader.elf" arm_target_flash_loader_type="LIBMEM RPC Loader" target_reset_script="FLASHReset()"/>
<folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>
<folder Name="Demo">
<folder Name="Prog">
<folder Name="Prog" file_name="">
<file file_name="../boot.c"/>
<file file_name="../boot.h"/>
<file file_name="../cstart.s"/>
@ -19,6 +19,29 @@
<file file_name="../vectors.c"/>
<file file_name="../time.c"/>
<file file_name="../time.h"/>
<file file_name="../net.c"/>
<file file_name="../net.h"/>
</folder>
<folder Name="third_party" file_name="">
<file file_name="../../../../Source/third_party/uip/uip/clock.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc-addrlabels.h"/>
<file file_name="../../../../Source/third_party/uip/uip/lc-switch.h"/>
<file file_name="../../../../Source/third_party/uip/uip/pt.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arch.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arp.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_arp.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_timer.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip_timer.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-fw.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-fw.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uiplib.c"/>
<file file_name="../../../../Source/third_party/uip/uip/uiplib.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-neighbor.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uipopt.h"/>
<file file_name="../../../../Source/third_party/uip/uip/uip-split.h"/>
</folder>
</folder>
</folder>
@ -107,6 +130,13 @@
<file file_name="../lib/driverlib/watchdog.c"/>
<file file_name="../lib/driverlib/watchdog.h"/>
</folder>
<folder Name="uip" file_name="">
<file file_name="../lib/uip/clock-arch.c"/>
<file file_name="../lib/uip/clock-arch.h"/>
<file file_name="../lib/uip/netdev.c"/>
<file file_name="../lib/uip/netdev.h"/>
<file file_name="../lib/uip/uip-conf.h"/>
</folder>
</folder>
</project>
<configuration Name="THUMB Debug" inherited_configurations="THUMB;Debug"/>

View File

@ -51,8 +51,10 @@
<Watches active="0" update="Never" />
</Watch4>
<Files>
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" y="0" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" left="18" selected="0" name="unnamed" top="0" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" y="44" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" left="0" selected="1" name="unnamed" top="37" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" y="0" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\main.c" left="0" selected="0" name="unnamed" top="0" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="55" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" y="1" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\led.c" left="0" selected="0" name="unnamed" top="0" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="17" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.c" y="8" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.c" left="0" selected="1" name="unnamed" top="55" />
<SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="24" debugPath="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.h" y="8" path="C:\Work\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.h" left="0" selected="0" name="unnamed" top="0" />
</Files>
<ARMCrossStudioWindow activeProject="demoprog_ek_lm3s6965" autoConnectTarget="Texas Instruments ICDI" debugSearchFileMap="" fileDialogInitialDirectory="D:\usr\feaser\software\OpenBLT\Target\Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Debug" />
<ARMCrossStudioWindow activeProject="demoprog_ek_lm3s6965" autoConnectTarget="Texas Instruments ICDI" debugSearchFileMap="" fileDialogInitialDirectory="C:\Work\software\OpenBLT\Target\Source\third_party\uip\uip" fileDialogDefaultFilter="" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Debug" />
</session>

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* Implementation of architecture-specific clock functionality
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "header.h" /* generic header */
#include "clock-arch.h"
/*---------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
return (clock_time_t)TimeGet();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
#ifndef __CLOCK_ARCH_H__
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
#define CLOCK_CONF_SECOND 1000
#endif /* __CLOCK_ARCH_H__ */

View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: netdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $
*/
/*---------------------------------------------------------------------------*/
#include "header.h" /* generic header */
#include "uip.h"
#include "uip_arp.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ethernet.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/ethernet.h"
#include "driverlib/flash.h"
/*---------------------------------------------------------------------------*/
#define NETDEV_LINKUP_TIMEOUT_MS (5000)
#define NETDEV_DEFAULT_MACADDR0 (0x08)
#define NETDEV_DEFAULT_MACADDR1 (0x00)
#define NETDEV_DEFAULT_MACADDR2 (0x27)
#define NETDEV_DEFAULT_MACADDR3 (0x69)
#define NETDEV_DEFAULT_MACADDR4 (0x5B)
#define NETDEV_DEFAULT_MACADDR5 (0x45)
/*---------------------------------------------------------------------------*/
void netdev_init(void)
{
unsigned long ulTemp;
unsigned long ulLinkTimeOut;
/* enable and reset the ethernet controller. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
/* enable port F for ethernet LEDs.
* LED0 Bit 3 Output
* LED1 Bit 2 Output
*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
/* intialize the ethernet controller and disable all ethernet controller
* interrupt sources.
*/
EthernetIntDisable(ETH_BASE, (ETH_INT_PHY | ETH_INT_MDIO | ETH_INT_RXER |
ETH_INT_RXOF | ETH_INT_TX | ETH_INT_TXER | ETH_INT_RX));
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* initialize the ethernet controller for operation. */
EthernetInitExpClk(ETH_BASE, SysCtlClockGet());
/* configure the ethernet controller for normal operation.
* - Full Duplex
* - TX CRC Auto Generation
* - TX Padding Enabled
*/
EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
/* wait for the link to become active. */
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
ulLinkTimeOut = TimeGet() + NETDEV_LINKUP_TIMEOUT_MS;
while ((ulTemp & 0x0004) == 0)
{
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
/* check for timeout so that the software program can still start if the
* ethernet cable is not connected.
*/
if (TimeGet() >= ulLinkTimeOut)
{
break;
}
}
/* enable the ethernet controller. */
EthernetEnable(ETH_BASE);
}
/*---------------------------------------------------------------------------*/
void netdev_setmacaddr(void)
{
struct uip_eth_addr macAddress;
unsigned long ulUser0, ulUser1;
/* set the default MAC address */
macAddress.addr[0] = NETDEV_DEFAULT_MACADDR0;
macAddress.addr[1] = NETDEV_DEFAULT_MACADDR1;
macAddress.addr[2] = NETDEV_DEFAULT_MACADDR2;
macAddress.addr[3] = NETDEV_DEFAULT_MACADDR3;
macAddress.addr[4] = NETDEV_DEFAULT_MACADDR4;
macAddress.addr[5] = NETDEV_DEFAULT_MACADDR5;
/* the LM3S eval kit should have a MAC address pre-propgrammed in flash by the
* manufacturer. try to use this one, otherwise use the default values.
*/
FlashUserGet(&ulUser0, &ulUser1);
if ( (ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff) )
{
macAddress.addr[0] = ((ulUser0 >> 0) & 0xff);
macAddress.addr[1] = ((ulUser0 >> 8) & 0xff);
macAddress.addr[2] = ((ulUser0 >> 16) & 0xff);
macAddress.addr[3] = ((ulUser1 >> 0) & 0xff);
macAddress.addr[4] = ((ulUser1 >> 8) & 0xff);
macAddress.addr[5] = ((ulUser1 >> 16) & 0xff);
}
EthernetMACAddrSet(ETH_BASE, &macAddress.addr[0]);
uip_setethaddr(macAddress);
}
/*---------------------------------------------------------------------------*/
unsigned int netdev_read(void)
{
unsigned long ulTemp;
/* read and Clear the interrupt flag. */
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* check to see if an RX Interrupt has occured. */
if(ulTemp & ETH_INT_RX)
{
return EthernetPacketGetNonBlocking(ETH_BASE, uip_buf, sizeof(uip_buf));
}
return 0;
}
/*---------------------------------------------------------------------------*/
void netdev_send(void)
{
EthernetPacketPut(ETH_BASE, uip_buf, uip_len);
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: netdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $
*
*/
#ifndef __NETDEV_H__
#define __NETDEV_H__
void netdev_init(void);
unsigned int netdev_read(void);
void netdev_send(void);
void netdev_setmacaddr(void);
#endif /* __NETDEV_H__ */

View File

@ -0,0 +1,151 @@
/**
* \addtogroup uipopt
* @{
*/
/**
* \name Project-specific configuration options
* @{
*
* uIP has a number of configuration options that can be overridden
* for each project. These are kept in a project-specific uip-conf.h
* file and all configuration names have the prefix UIP_CONF.
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* An example uIP configuration file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __UIP_CONF_H__
#define __UIP_CONF_H__
/**
* 8 bit datatype
*
* This typedef defines the 8-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned char u8_t;
/**
* 16 bit datatype
*
* This typedef defines the 16-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned short u16_t;
/**
* Statistics datatype
*
* This typedef defines the dataype used for keeping statistics in
* uIP.
*
* \hideinitializer
*/
typedef unsigned short uip_stats_t;
/**
* Maximum number of TCP connections.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_CONNECTIONS 1
/**
* Maximum number of listening TCP ports.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_LISTENPORTS 1
/**
* uIP buffer size.
*
* \hideinitializer
*/
#define UIP_CONF_BUFFER_SIZE 1600
/**
* CPU byte order.
*
* \hideinitializer
*/
#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
/**
* Logging on or off
*
* \hideinitializer
*/
#define UIP_CONF_LOGGING 0
/**
* UDP support on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP 0
/**
* UDP checksums on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP_CHECKSUMS 1
/**
* uIP statistics on or off
*
* \hideinitializer
*/
#define UIP_CONF_STATISTICS 0
/* Here we include the header file for the application(s) we use in
our project. */
#include "boot.h"
#include "net.h"
#endif /* __UIP_CONF_H__ */
/** @} */
/** @} */

View File

@ -53,6 +53,8 @@ int main(void)
{
/* initialize the microcontroller */
Init();
/* initialize the network application */
NetInit();
/* initialize the bootloader interface */
BootComInit();
@ -61,6 +63,8 @@ int main(void)
{
/* toggle LED with a fixed frequency */
LedToggle();
/* run the network task */
NetTask();
/* check for bootloader activation request */
BootComCheckActivationRequest();
}

View File

@ -0,0 +1,207 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.c
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_Crossworks
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
/****************************************************************************************
* Include files
****************************************************************************************/
#include "header.h" /* generic header */
#include "netdev.h"
#include "uip.h"
#include "uip_arp.h"
/****************************************************************************************
* Macro definitions
****************************************************************************************/
/** \brief Delta time for the uIP periodic timer. */
#define NET_UIP_PERIODIC_TIMER_MS (500)
/** \brief Delta time for the uIP ARP timer. */
#define NET_UIP_ARP_TIMER_MS (10000)
/** \brief Macro for accessing the Ethernet header information in the buffer */
#define NET_UIP_HEADER_BUF ((struct uip_eth_hdr *)&uip_buf[0])
/****************************************************************************************
* Local data declarations
****************************************************************************************/
/** \brief Holds the time out value of the uIP periodic timer. */
static unsigned long periodicTimerTimeOut;
/** \brief Holds the time out value of the uIP ARP timer. */
static unsigned long ARPTimerTimeOut;
/************************************************************************************//**
** \brief Initializes the TCP/IP network communication interface.
** \return none.
**
****************************************************************************************/
void NetInit(void)
{
uip_ipaddr_t ipaddr;
/* initialize the network device */
netdev_init();
/* initialize the uIP TCP/IP stack. */
uip_init();
/* set the IP address */
uip_ipaddr(ipaddr, BOOT_COM_NET_IPADDR0, BOOT_COM_NET_IPADDR1, BOOT_COM_NET_IPADDR2,
BOOT_COM_NET_IPADDR3);
uip_sethostaddr(ipaddr);
/* set the network mask */
uip_ipaddr(ipaddr, BOOT_COM_NET_NETMASK0, BOOT_COM_NET_NETMASK1, BOOT_COM_NET_NETMASK2,
BOOT_COM_NET_NETMASK3);
uip_setnetmask(ipaddr);
/* set the MAC address */
netdev_setmacaddr();
/* initialize the timer variables */
periodicTimerTimeOut = TimeGet() + NET_UIP_PERIODIC_TIMER_MS;
ARPTimerTimeOut = TimeGet() + NET_UIP_ARP_TIMER_MS;
/* start listening on the configured port for XCP transfers on TCP/IP */
uip_listen(HTONS(BOOT_COM_NET_PORT));
} /*** end of NetInit ***/
/************************************************************************************//**
** \brief The uIP network application that detects the XCP connect command on the
** port used by the bootloader. This indicates that the bootloader should
** be activated.
** \return none.
**
****************************************************************************************/
void NetApp(void)
{
unsigned char *newDataPtr;
if (uip_connected())
{
return;
}
if (uip_newdata())
{
/* a new XCP command was received. check if this is the connect command and in this
* case activate the bootloader. with XCP on TCP/IP the first 4 bytes contain a
* counter value in which we are not really interested.
*/
newDataPtr = uip_appdata;
newDataPtr += 4;
/* check if this was an XCP CONNECT command */
if ((newDataPtr[0] == 0xff) && (newDataPtr[1] == 0x00))
{
/* connection request received so start the bootloader */
BootActivate();
}
}
} /*** end of NetApp ***/
/************************************************************************************//**
** \brief Runs the TCP/IP server task.
** \return none.
**
****************************************************************************************/
void NetTask(void)
{
unsigned long connection;
unsigned long packetLen;
/* check for an RX packet and read it. */
packetLen = netdev_read();
if(packetLen > 0)
{
/* set uip_len for uIP stack usage */
uip_len = (unsigned short)packetLen;
/* process incoming IP packets here. */
if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_IP))
{
uip_arp_ipin();
uip_input();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
/* process incoming ARP packets here. */
else if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_ARP))
{
uip_arp_arpin();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
netdev_send();
uip_len = 0;
}
}
}
/* process TCP/IP Periodic Timer here. */
if (TimeGet() >= periodicTimerTimeOut)
{
periodicTimerTimeOut += NET_UIP_PERIODIC_TIMER_MS;
for (connection = 0; connection < UIP_CONNS; connection++)
{
uip_periodic(connection);
/* If the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
}
/* process ARP Timer here. */
if (TimeGet() >= ARPTimerTimeOut)
{
ARPTimerTimeOut += NET_UIP_ARP_TIMER_MS;
uip_arp_timer();
}
} /*** end of NetServerTask ***/
/*********************************** end of net.c **************************************/

View File

@ -0,0 +1,66 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_Crossworks\Prog\net.h
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_Crossworks
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
#ifndef NET_H
#define NET_H
/****************************************************************************************
* Macro definitions
****************************************************************************************/
#ifndef UIP_APPCALL
#define UIP_APPCALL NetApp
#endif /* UIP_APPCALL */
/****************************************************************************************
* Type definitions
****************************************************************************************/
/** \brief Define the uip_tcp_appstate_t datatype. This is the state of our tcp/ip
* application, and the memory required for this state is allocated together
* with each TCP connection. One application state for each TCP connection.
*/
typedef struct net_state
{
unsigned char unused;
} uip_tcp_appstate_t;
/****************************************************************************************
* Function prototypes
****************************************************************************************/
void NetInit(void);
void NetApp(void);
void NetTask(void);
#endif /* NET_H */
/*********************************** end of net.h **************************************/

View File

@ -1,61 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Project Name="DemoBoot" InternalType="">
<Plugins>
<Plugin Name="qmake">
<![CDATA[00010001N0005Debug000000000000]]>
</Plugin>
</Plugins>
<VirtualDirectory Name="Source">
<VirtualDirectory Name="third_party">
<VirtualDirectory Name="fatfs">
<VirtualDirectory Name="src">
<File Name="../../../../Source/third_party/fatfs/src/diskio.h"/>
<File Name="../../../../Source/third_party/fatfs/src/ff.c"/>
<File Name="../../../../Source/third_party/fatfs/src/ff.h"/>
<File Name="../../../../Source/third_party/fatfs/src/integer.h"/>
<VirtualDirectory Name="option">
<File Name="../../../../Source/third_party/fatfs/src/option/cc932.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc936.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc949.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc950.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/ccsbcs.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/syscall.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/unicode.c"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="ARMCM3_LM3S">
<VirtualDirectory Name="GCC">
<File Name="../../../../Source/ARMCM3_LM3S/GCC/cstart.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/GCC/vectors.c"/>
</VirtualDirectory>
<File Name="../../../../Source/ARMCM3_LM3S/cpu.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/cpu.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/flash.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/flash.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/nvm.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/nvm.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/timer.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/timer.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/types.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/uart.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/uart.h"/>
</VirtualDirectory>
<File Name="../../../../Source/assert.c"/>
<File Name="../../../../Source/assert.h"/>
<File Name="../../../../Source/backdoor.c"/>
<File Name="../../../../Source/backdoor.h"/>
<File Name="../../../../Source/boot.c"/>
<File Name="../../../../Source/boot.h"/>
<File Name="../../../../Source/com.c"/>
<File Name="../../../../Source/com.h"/>
<File Name="../../../../Source/cop.c"/>
<File Name="../../../../Source/cop.h"/>
<File Name="../../../../Source/plausibility.h"/>
<File Name="../../../../Source/xcp.c"/>
<File Name="../../../../Source/xcp.h"/>
</VirtualDirectory>
<VirtualDirectory Name="Demo">
<VirtualDirectory Name="ARMCM3_LM3S_EK_LM3S6965_GCC">
<VirtualDirectory Name="Boot">
@ -64,34 +8,57 @@
<File Name="../lib/driverlib/cpulib.c"/>
<File Name="../lib/driverlib/cpulib.h"/>
<File Name="../lib/driverlib/debug.h"/>
<File Name="../lib/driverlib/ethernet.c"/>
<File Name="../lib/driverlib/ethernet.h"/>
<File Name="../lib/driverlib/flashlib.c"/>
<File Name="../lib/driverlib/flashlib.h"/>
<File Name="../lib/driverlib/gpio.c"/>
<File Name="../lib/driverlib/gpio.h"/>
<File Name="../lib/driverlib/interrupt.c"/>
<File Name="../lib/driverlib/interrupt.h"/>
<File Name="../lib/driverlib/pin_map.h"/>
<File Name="../lib/driverlib/ssi.c"/>
<File Name="../lib/driverlib/ssi.h"/>
<File Name="../lib/driverlib/sysctl.c"/>
<File Name="../lib/driverlib/sysctl.h"/>
<File Name="../lib/driverlib/uartlib.c"/>
<File Name="../lib/driverlib/uartlib.h"/>
</VirtualDirectory>
<VirtualDirectory Name="fatfs">
<File Name="../lib/fatfs/ffconf.h"/>
<File Name="../lib/fatfs/mmc.c"/>
</VirtualDirectory>
<VirtualDirectory Name="inc">
<File Name="../lib/inc/hw_ethernet.h"/>
<File Name="../lib/inc/hw_flash.h"/>
<File Name="../lib/inc/hw_gpio.h"/>
<File Name="../lib/inc/hw_ints.h"/>
<File Name="../lib/inc/hw_memmap.h"/>
<File Name="../lib/inc/hw_nvic.h"/>
<File Name="../lib/inc/hw_ssi.h"/>
<File Name="../lib/inc/hw_sysctl.h"/>
<File Name="../lib/inc/hw_types.h"/>
<File Name="../lib/inc/hw_uart.h"/>
</VirtualDirectory>
<VirtualDirectory Name="uip">
<File Name="../lib/uip/clock-arch.c"/>
<File Name="../lib/uip/clock-arch.h"/>
<File Name="../lib/uip/netdev.c"/>
<File Name="../lib/uip/netdev.h"/>
<File Name="../lib/uip/uip-conf.h"/>
</VirtualDirectory>
</VirtualDirectory>
<File Name="../blt_conf.h"/>
<File Name="../hooks.c"/>
<File Name="../main.c"/>
<File Name="../blt_conf.h"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
<Plugins>
<Plugin Name="qmake">
<![CDATA[00010001N0005Debug000000000000]]>
</Plugin>
</Plugins>
<Description/>
<Dependencies/>
<Settings Type="Dynamic Library">
@ -165,4 +132,95 @@ continue
</AdditionalRules>
</Configuration>
</Settings>
<VirtualDirectory Name="Source">
<VirtualDirectory Name="third_party">
<VirtualDirectory Name="uip">
<VirtualDirectory Name="uip">
<File Name="../../../../Source/third_party/uip/uip/clock.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc-addrlabels.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc-switch.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc.h"/>
<File Name="../../../../Source/third_party/uip/uip/psock.c"/>
<File Name="../../../../Source/third_party/uip/uip/psock.h"/>
<File Name="../../../../Source/third_party/uip/uip/pt.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-fw.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-fw.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-neighbor.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-neighbor.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-split.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-split.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip.h"/>
<File Name="../../../../Source/third_party/uip/uip/uiplib.c"/>
<File Name="../../../../Source/third_party/uip/uip/uiplib.h"/>
<File Name="../../../../Source/third_party/uip/uip/uipopt.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arch.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arp.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arp.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_timer.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip_timer.h"/>
</VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="fatfs">
<VirtualDirectory Name="src">
<VirtualDirectory Name="option">
<File Name="../../../../Source/third_party/fatfs/src/option/cc932.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc936.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc949.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/cc950.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/ccsbcs.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/syscall.c"/>
<File Name="../../../../Source/third_party/fatfs/src/option/unicode.c"/>
</VirtualDirectory>
<File Name="../../../../Source/third_party/fatfs/src/diskio.h"/>
<File Name="../../../../Source/third_party/fatfs/src/ff.c"/>
<File Name="../../../../Source/third_party/fatfs/src/ff.h"/>
<File Name="../../../../Source/third_party/fatfs/src/integer.h"/>
</VirtualDirectory>
<VirtualDirectory Name="doc">
<VirtualDirectory Name="img">
<File Name="../../../../Source/third_party/fatfs/doc/img/app1.c"/>
<File Name="../../../../Source/third_party/fatfs/doc/img/app2.c"/>
<File Name="../../../../Source/third_party/fatfs/doc/img/app3.c"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
<File Name="../../../../Source/assert.c"/>
<File Name="../../../../Source/assert.h"/>
<File Name="../../../../Source/backdoor.c"/>
<File Name="../../../../Source/backdoor.h"/>
<File Name="../../../../Source/boot.c"/>
<File Name="../../../../Source/boot.h"/>
<File Name="../../../../Source/com.c"/>
<File Name="../../../../Source/com.h"/>
<File Name="../../../../Source/cop.c"/>
<File Name="../../../../Source/cop.h"/>
<File Name="../../../../Source/file.c"/>
<File Name="../../../../Source/file.h"/>
<File Name="../../../../Source/net.c"/>
<File Name="../../../../Source/net.h"/>
<File Name="../../../../Source/plausibility.h"/>
<File Name="../../../../Source/xcp.c"/>
<File Name="../../../../Source/xcp.h"/>
<VirtualDirectory Name="ARMCM3_LM3S">
<File Name="../../../../Source/ARMCM3_LM3S/can.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/can.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/cpu.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/cpu.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/flash.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/flash.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/nvm.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/nvm.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/timer.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/timer.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/types.h"/>
<File Name="../../../../Source/ARMCM3_LM3S/uart.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/uart.h"/>
<VirtualDirectory Name="GCC">
<File Name="../../../../Source/ARMCM3_LM3S/GCC/cstart.c"/>
<File Name="../../../../Source/ARMCM3_LM3S/GCC/vectors.c"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
</CodeLite_Project>

View File

@ -7,36 +7,36 @@ start address 0x00008000
Program Header:
LOAD off 0x00008000 vaddr 0x00008000 paddr 0x00008000 align 2**15
filesz 0x00001078 memsz 0x00001078 flags r-x
filesz 0x000031dc memsz 0x000031dc flags r-x
LOAD off 0x00010000 vaddr 0x20000000 paddr 0x20000000 align 2**15
filesz 0x00000000 memsz 0x0000015c flags rw-
filesz 0x00000000 memsz 0x0000086c flags rw-
private flags = 5000202: [Version5 EABI] [soft-float ABI] [has entry point]
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00001078 00008000 00008000 00008000 2**2
0 .text 000031dc 00008000 00008000 00008000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .bss 0000015c 20000000 20000000 00010000 2**2
1 .bss 0000086c 20000000 20000000 00010000 2**2
ALLOC
2 .debug_info 00003cc0 00000000 00000000 00009078 2**0
2 .debug_info 000063a5 00000000 00000000 0000b1dc 2**0
CONTENTS, READONLY, DEBUGGING
3 .debug_abbrev 00000b94 00000000 00000000 0000cd38 2**0
3 .debug_abbrev 000015ac 00000000 00000000 00011581 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_loc 00001fb9 00000000 00000000 0000d8cc 2**0
4 .debug_loc 000033f7 00000000 00000000 00012b2d 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_aranges 00000660 00000000 00000000 0000f885 2**0
5 .debug_aranges 00000920 00000000 00000000 00015f24 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_ranges 00000590 00000000 00000000 0000fee5 2**0
6 .debug_ranges 000007f0 00000000 00000000 00016844 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 00001611 00000000 00000000 00010475 2**0
7 .debug_line 00002481 00000000 00000000 00017034 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_str 00001079 00000000 00000000 00011a86 2**0
8 .debug_str 00001a76 00000000 00000000 000194b5 2**0
CONTENTS, READONLY, DEBUGGING
9 .comment 00000030 00000000 00000000 00012aff 2**0
9 .comment 00000030 00000000 00000000 0001af2b 2**0
CONTENTS, READONLY
10 .ARM.attributes 00000033 00000000 00000000 00012b2f 2**0
10 .ARM.attributes 00000033 00000000 00000000 0001af5b 2**0
CONTENTS, READONLY
11 .debug_frame 00001000 00000000 00000000 00012b64 2**2
11 .debug_frame 00001738 00000000 00000000 0001af90 2**2
CONTENTS, READONLY, DEBUGGING
SYMBOL TABLE:
00008000 l d .text 00000000 .text
@ -53,70 +53,145 @@ SYMBOL TABLE:
00000000 l d .debug_frame 00000000 .debug_frame
00000000 l df *ABS* 00000000 vectors.c
00000000 l df *ABS* 00000000 boot.c
20000000 l O .bss 00000001 xcpCtoRxLength.4440
20000004 l O .bss 00000041 xcpCtoReqPacket.4439
20000048 l O .bss 00000001 xcpCtoRxInProgress.4441
20000000 l O .bss 00000041 xcpCtoReqPacket.4450
20000044 l O .bss 00000001 xcpCtoRxLength.4451
20000045 l O .bss 00000001 xcpCtoRxInProgress.4452
00000000 l df *ABS* 00000000 cstart.c
00008248 l F .text 00000000 zero_loop
00008258 l F .text 00000000 zero_loop
00000000 l df *ABS* 00000000 irq.c
00000000 l df *ABS* 00000000 led.c
2000004c l O .bss 00000004 timer_counter_last.4435
20000050 l O .bss 00000001 led_toggle_state.4434
20000048 l O .bss 00000004 timer_counter_last.4446
2000004c l O .bss 00000001 led_toggle_state.4445
00000000 l df *ABS* 00000000 net.c
20000050 l O .bss 00000004 ARPTimerTimeOut
20000054 l O .bss 00000004 periodicTimerTimeOut
00000000 l df *ABS* 00000000 main.c
20000054 l O .bss 00000004 assert_failure_line.4442
20000058 l O .bss 00000004 assert_failure_line.4453
00000000 l df *ABS* 00000000 time.c
20000058 l O .bss 00000004 millisecond_counter
2000005c l O .bss 00000004 millisecond_counter
00000000 l df *ABS* 00000000 netdev.c
00000000 l df *ABS* 00000000 cpu.c
00000000 l df *ABS* 00000000 ethernet.c
00008868 l F .text 00000096 EthernetPacketGetInternal
00008900 l F .text 00000086 EthernetPacketPutInternal
00000000 l df *ABS* 00000000 flash.c
00000000 l df *ABS* 00000000 gpio.c
00008408 l F .text 0000008a GPIOBaseValid
00008d88 l F .text 0000008a GPIOBaseValid
00000000 l df *ABS* 00000000 interrupt.c
00000000 l df *ABS* 00000000 sysctl.c
00008708 l F .text 00000154 SysCtlPeripheralValid
00008fc8 l O .text 0000005c g_pulXtals
0000903c l O .text 0000000c g_pulRCGCRegs
000090d4 l F .text 00000154 SysCtlPeripheralValid
0000b118 l O .text 0000005c g_pulXtals
0000b18c l O .text 0000000c g_pulRCGCRegs
0000b198 l O .text 0000000c g_pulSRCRRegs
00000000 l df *ABS* 00000000 systick.c
00000000 l df *ABS* 00000000 uart.c
00008d8c l F .text 00000026 UARTBaseValid
000097c0 l F .text 00000026 UARTBaseValid
00000000 l df *ABS* 00000000 uip.c
000099e4 l F .text 0000004c chksum
00009a30 l F .text 00000046 upper_layer_chksum
00009af8 l F .text 00000036 uip_add_rcv_nxt
20000060 l O .bss 00000002 tmp16
20000062 l O .bss 00000002 ipid
20000064 l O .bss 00000004 iss
20000068 l O .bss 00000002 lastport
20000074 l O .bss 00000001 c
20000075 l O .bss 00000001 opt
00000000 l df *ABS* 00000000 uip_arp.c
0000aba4 l F .text 00000116 uip_arp_update
20000076 l O .bss 00000001 i
20000077 l O .bss 00000001 tmpage
20000078 l O .bss 00000060 arp_table
0000b1d4 l O .text 00000006 broadcast_ethaddr
200000d8 l O .bss 00000001 c
200000d9 l O .bss 00000001 arptime
200000dc l O .bss 00000004 ipaddr
00000000 l df *ABS* 00000000 memset.c
00000000 l df *ABS* 00000000
00000100 l *ABS* 00000000 __STACKSIZE__
0000838c g F .text 0000000c __error__
00008204 g F .text 00000060 reset_handler
000088b8 g F .text 00000008 SysCtlDelay
00008270 g F .text 0000000e IrqInterruptEnable
00009078 g .text 00000000 _etext
00008630 g F .text 00000030 GPIOPinWrite
0000885c g F .text 00000046 SysCtlPeripheralEnable
000088a4 g F .text 00000012 SysCtlReset
2000005c g .bss 00000000 _ebss
000083fc g F .text 00000002 UnusedISR
00008280 g F .text 0000003a LedInit
000083ec g F .text 00000010 TimeISRHandler
00008f78 g F .text 00000036 UARTCharGetNonBlocking
000085c4 g F .text 0000000c __error__
00008214 g F .text 00000060 reset_handler
000092ec g F .text 00000008 SysCtlDelay
00008280 g F .text 0000000e IrqInterruptEnable
200000e0 g O .bss 00000002 uip_len
2000006c g O .bss 00000006 uip_ethaddr
00009a78 g F .text 0000007e uip_add32
0000b1dc g .text 00000000 _etext
00009228 g F .text 00000068 SysCtlPeripheralReset
00008fb0 g F .text 00000030 GPIOPinWrite
000087e4 g F .text 00000052 netdev_read
00009bd4 g F .text 00000fc4 uip_process
200000e4 g O .bss 00000004 uip_sappdata
00008638 g F .text 00000100 netdev_init
200000e8 g O .bss 00000004 uip_acc32
00009b30 g F .text 0000002c uip_ipchksum
00008988 g F .text 0000003a EthernetInitExpClk
00009ba0 g F .text 00000032 uip_listen
00008838 g F .text 00000028 netdev_send
00008b70 g F .text 00000076 EthernetPacketPut
00009290 g F .text 00000046 SysCtlPeripheralEnable
200000ec g O .bss 00000001 uip_flags
000080f4 g F .text 0000000e BootActivate
000092d8 g F .text 00000012 SysCtlReset
2000076c g .bss 00000000 _ebss
00008634 g F .text 00000002 UnusedISR
00008af4 g F .text 0000007a EthernetPacketGetNonBlocking
00008290 g F .text 0000003a LedInit
00008624 g F .text 00000010 TimeISRHandler
00009078 g F .text 0000004c GPIOPinTypeEthernetLED
00008400 g F .text 0000015c NetTask
00008738 g F .text 000000ac netdev_setmacaddr
000099ac g F .text 00000036 UARTCharGetNonBlocking
20000000 g .bss 00000000 _bss
00008d60 g F .text 0000002a SysTickPeriodSet
00008338 g F .text 00000052 main
00008a7c g F .text 000002ba SysCtlClockGet
00008df0 g F .text 00000044 UARTDisable
000080f4 g F .text 00000050 BootComInit
000086f8 g F .text 00000010 IntMasterEnable
00008398 g F .text 00000046 TimeInit
00009b5c g F .text 00000010 uip_tcpchksum
200000f0 g O .bss 00000004 uip_appdata
00009794 g F .text 0000002a SysTickPeriodSet
200000f4 g O .bss 00000004 uip_conn
200000f8 g O .bss 0000001e uip_conns
00008c38 g F .text 00000032 EthernetIntStatus
0000ae54 g F .text 000001d6 uip_arp_out
0000b02c g F .text 0000009e memset
0000855c g F .text 00000066 main
000094b0 g F .text 000002ba SysCtlClockGet
00009824 g F .text 00000044 UARTDisable
00008aac g F .text 00000048 EthernetEnable
00008104 g F .text 00000050 BootComInit
0000ad14 g F .text 00000140 uip_arp_arpin
000090c4 g F .text 00000010 IntMasterEnable
000085d0 g F .text 00000046 TimeInit
00008a34 g F .text 00000076 EthernetMACAddrSet
0000acbc g F .text 00000058 uip_arp_timer
20000118 g O .bss 00000002 uip_listenports
2000011c g O .bss 00000004 uip_draddr
20000000 g .text 00000000 _data
000082bc g F .text 0000007a LedToggle
2000015c g .bss 00000000 _estack
00008cb4 g F .text 0000004c EthernetPHYRead
000082cc g F .text 0000007a LedToggle
2000086c g .bss 00000000 _estack
000089c4 g F .text 0000006e EthernetConfigSet
20000000 g .text 00000000 _edata
0000ab98 g F .text 0000000a htons
00008000 g O .text 000000f4 _vectab
000086ac g F .text 0000004c GPIOPinTypeUART
00008660 g F .text 0000004c GPIOPinTypeGPIOOutput
00008144 g F .text 000000c0 BootComCheckActivationRequest
000083e0 g F .text 0000000c TimeGet
00008400 g F .text 00000008 CPUcpsie
00008494 g F .text 0000006c GPIODirModeSet
2000005c g .bss 00000000 _stack
00008d38 g F .text 00000012 SysTickEnable
00008d4c g F .text 00000012 SysTickIntEnable
00008e34 g F .text 00000142 UARTConfigSetExpClk
000088c0 g F .text 000001ba SysCtlClockSet
00008500 g F .text 0000012e GPIOPadConfigSet
00008db4 g F .text 0000003c UARTEnable
00008d00 g F .text 00000086 FlashUserGet
0000902c g F .text 0000004c GPIOPinTypeUART
00008fe0 g F .text 0000004c GPIOPinTypeGPIOOutput
00008be8 g F .text 0000004e EthernetIntDisable
00008154 g F .text 000000c0 BootComCheckActivationRequest
00008c6c g F .text 00000048 EthernetIntClear
00008618 g F .text 0000000c TimeGet
00009b6c g F .text 00000032 uip_init
00008860 g F .text 00000008 CPUcpsie
00008e14 g F .text 0000006c GPIODirModeSet
2000076c g .bss 00000000 _stack
20000120 g O .bss 00000004 uip_netmask
0000976c g F .text 00000012 SysTickEnable
20000124 g O .bss 00000004 uip_hostaddr
000083c8 g F .text 00000038 NetApp
00009780 g F .text 00000012 SysTickIntEnable
00009868 g F .text 00000142 UARTConfigSetExpClk
00008348 g F .text 00000080 NetInit
000092f4 g F .text 000001ba SysCtlClockSet
00008e80 g F .text 0000012e GPIOPadConfigSet
20000128 g O .bss 00000642 uip_buf
2000076a g O .bss 00000002 uip_slen
000097e8 g F .text 0000003c UARTEnable

View File

@ -42,7 +42,7 @@
** \return none.
**
****************************************************************************************/
static void BootActivate(void)
void BootActivate(void)
{
/* perform software reset to activate the bootoader again */
SysCtlReset();

View File

@ -38,6 +38,7 @@
****************************************************************************************/
void BootComInit(void);
void BootComCheckActivationRequest(void);
void BootActivate(void);
#endif /* BOOT_H */

View File

@ -41,6 +41,7 @@
#include "irq.h" /* IRQ driver */
#include "led.h" /* LED driver */
#include "time.h" /* Timer driver */
#include "net.h" /* TCP/IP server application */
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"

View File

@ -1,5 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Project Name="DemoProg" InternalType="">
<VirtualDirectory Name="Source">
<VirtualDirectory Name="third_party">
<VirtualDirectory Name="uip">
<VirtualDirectory Name="uip">
<File Name="../../../../Source/third_party/uip/uip/clock.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc-addrlabels.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc-switch.h"/>
<File Name="../../../../Source/third_party/uip/uip/lc.h"/>
<File Name="../../../../Source/third_party/uip/uip/psock.c"/>
<File Name="../../../../Source/third_party/uip/uip/psock.h"/>
<File Name="../../../../Source/third_party/uip/uip/pt.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-fw.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-fw.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-neighbor.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-neighbor.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip-split.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip-split.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip.h"/>
<File Name="../../../../Source/third_party/uip/uip/uiplib.c"/>
<File Name="../../../../Source/third_party/uip/uip/uiplib.h"/>
<File Name="../../../../Source/third_party/uip/uip/uipopt.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arch.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arp.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip_arp.h"/>
<File Name="../../../../Source/third_party/uip/uip/uip_timer.c"/>
<File Name="../../../../Source/third_party/uip/uip/uip_timer.h"/>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="Demo">
<VirtualDirectory Name="ARMCM3_LM3S_EK_LM3S6965_GCC">
<VirtualDirectory Name="Prog">
@ -80,6 +111,13 @@
<File Name="../lib/inc/hw_watchdog.h"/>
<File Name="../lib/inc/lm3s6965.h"/>
</VirtualDirectory>
<VirtualDirectory Name="uip">
<File Name="../lib/uip/clock-arch.c"/>
<File Name="../lib/uip/clock-arch.h"/>
<File Name="../lib/uip/netdev.c"/>
<File Name="../lib/uip/netdev.h"/>
<File Name="../lib/uip/uip-conf.h"/>
</VirtualDirectory>
</VirtualDirectory>
<File Name="../boot.c"/>
<File Name="../boot.h"/>
@ -90,6 +128,8 @@
<File Name="../led.c"/>
<File Name="../led.h"/>
<File Name="../main.c"/>
<File Name="../net.c"/>
<File Name="../net.h"/>
<File Name="../time.c"/>
<File Name="../time.h"/>
<File Name="../vectors.c"/>

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* Implementation of architecture-specific clock functionality
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "header.h" /* generic header */
#include "clock-arch.h"
/*---------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
return (clock_time_t)TimeGet();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
#ifndef __CLOCK_ARCH_H__
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
#define CLOCK_CONF_SECOND 1000
#endif /* __CLOCK_ARCH_H__ */

View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: netdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $
*/
/*---------------------------------------------------------------------------*/
#include "header.h" /* generic header */
#include "uip.h"
#include "uip_arp.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ethernet.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/ethernet.h"
#include "driverlib/flash.h"
/*---------------------------------------------------------------------------*/
#define NETDEV_LINKUP_TIMEOUT_MS (5000)
#define NETDEV_DEFAULT_MACADDR0 (0x08)
#define NETDEV_DEFAULT_MACADDR1 (0x00)
#define NETDEV_DEFAULT_MACADDR2 (0x27)
#define NETDEV_DEFAULT_MACADDR3 (0x69)
#define NETDEV_DEFAULT_MACADDR4 (0x5B)
#define NETDEV_DEFAULT_MACADDR5 (0x45)
/*---------------------------------------------------------------------------*/
void netdev_init(void)
{
unsigned long ulTemp;
unsigned long ulLinkTimeOut;
/* enable and reset the ethernet controller. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
/* enable port F for ethernet LEDs.
* LED0 Bit 3 Output
* LED1 Bit 2 Output
*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
/* intialize the ethernet controller and disable all ethernet controller
* interrupt sources.
*/
EthernetIntDisable(ETH_BASE, (ETH_INT_PHY | ETH_INT_MDIO | ETH_INT_RXER |
ETH_INT_RXOF | ETH_INT_TX | ETH_INT_TXER | ETH_INT_RX));
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* initialize the ethernet controller for operation. */
EthernetInitExpClk(ETH_BASE, SysCtlClockGet());
/* configure the ethernet controller for normal operation.
* - Full Duplex
* - TX CRC Auto Generation
* - TX Padding Enabled
*/
EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
/* wait for the link to become active. */
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
ulLinkTimeOut = TimeGet() + NETDEV_LINKUP_TIMEOUT_MS;
while ((ulTemp & 0x0004) == 0)
{
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
/* check for timeout so that the software program can still start if the
* ethernet cable is not connected.
*/
if (TimeGet() >= ulLinkTimeOut)
{
break;
}
}
/* enable the ethernet controller. */
EthernetEnable(ETH_BASE);
}
/*---------------------------------------------------------------------------*/
void netdev_setmacaddr(void)
{
struct uip_eth_addr macAddress;
unsigned long ulUser0, ulUser1;
/* set the default MAC address */
macAddress.addr[0] = NETDEV_DEFAULT_MACADDR0;
macAddress.addr[1] = NETDEV_DEFAULT_MACADDR1;
macAddress.addr[2] = NETDEV_DEFAULT_MACADDR2;
macAddress.addr[3] = NETDEV_DEFAULT_MACADDR3;
macAddress.addr[4] = NETDEV_DEFAULT_MACADDR4;
macAddress.addr[5] = NETDEV_DEFAULT_MACADDR5;
/* the LM3S eval kit should have a MAC address pre-propgrammed in flash by the
* manufacturer. try to use this one, otherwise use the default values.
*/
FlashUserGet(&ulUser0, &ulUser1);
if ( (ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff) )
{
macAddress.addr[0] = ((ulUser0 >> 0) & 0xff);
macAddress.addr[1] = ((ulUser0 >> 8) & 0xff);
macAddress.addr[2] = ((ulUser0 >> 16) & 0xff);
macAddress.addr[3] = ((ulUser1 >> 0) & 0xff);
macAddress.addr[4] = ((ulUser1 >> 8) & 0xff);
macAddress.addr[5] = ((ulUser1 >> 16) & 0xff);
}
EthernetMACAddrSet(ETH_BASE, &macAddress.addr[0]);
uip_setethaddr(macAddress);
}
/*---------------------------------------------------------------------------*/
unsigned int netdev_read(void)
{
unsigned long ulTemp;
/* read and Clear the interrupt flag. */
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* check to see if an RX Interrupt has occured. */
if(ulTemp & ETH_INT_RX)
{
return EthernetPacketGetNonBlocking(ETH_BASE, uip_buf, sizeof(uip_buf));
}
return 0;
}
/*---------------------------------------------------------------------------*/
void netdev_send(void)
{
EthernetPacketPut(ETH_BASE, uip_buf, uip_len);
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: netdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $
*
*/
#ifndef __NETDEV_H__
#define __NETDEV_H__
void netdev_init(void);
unsigned int netdev_read(void);
void netdev_send(void);
void netdev_setmacaddr(void);
#endif /* __NETDEV_H__ */

View File

@ -0,0 +1,151 @@
/**
* \addtogroup uipopt
* @{
*/
/**
* \name Project-specific configuration options
* @{
*
* uIP has a number of configuration options that can be overridden
* for each project. These are kept in a project-specific uip-conf.h
* file and all configuration names have the prefix UIP_CONF.
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* An example uIP configuration file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __UIP_CONF_H__
#define __UIP_CONF_H__
/**
* 8 bit datatype
*
* This typedef defines the 8-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned char u8_t;
/**
* 16 bit datatype
*
* This typedef defines the 16-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned short u16_t;
/**
* Statistics datatype
*
* This typedef defines the dataype used for keeping statistics in
* uIP.
*
* \hideinitializer
*/
typedef unsigned short uip_stats_t;
/**
* Maximum number of TCP connections.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_CONNECTIONS 1
/**
* Maximum number of listening TCP ports.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_LISTENPORTS 1
/**
* uIP buffer size.
*
* \hideinitializer
*/
#define UIP_CONF_BUFFER_SIZE 1600
/**
* CPU byte order.
*
* \hideinitializer
*/
#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
/**
* Logging on or off
*
* \hideinitializer
*/
#define UIP_CONF_LOGGING 0
/**
* UDP support on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP 0
/**
* UDP checksums on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP_CHECKSUMS 1
/**
* uIP statistics on or off
*
* \hideinitializer
*/
#define UIP_CONF_STATISTICS 0
/* Here we include the header file for the application(s) we use in
our project. */
#include "boot.h"
#include "net.h"
#endif /* __UIP_CONF_H__ */
/** @} */
/** @} */

View File

@ -53,6 +53,8 @@ int main(void)
{
/* initialize the microcontroller */
Init();
/* initialize the network application */
NetInit();
/* initialize the bootloader interface */
BootComInit();
@ -61,6 +63,8 @@ int main(void)
{
/* toggle LED with a fixed frequency */
LedToggle();
/* run the network task */
NetTask();
/* check for bootloader activation request */
BootComCheckActivationRequest();
}

View File

@ -43,10 +43,17 @@ irq.c \
irq.h \
led.c \
led.h \
net.c \
net.h \
main.c \
time.c \
time.h \
vectors.c \
lib/uip/clock-arch.c \
lib/uip/clock-arch.h \
lib/uip/netdev.c \
lib/uip/netdev.h \
lib/uip/uip-conf.h \
lib/inc/asmdefs.h \
lib/inc/hw_adc.h \
lib/inc/hw_comp.h \
@ -118,7 +125,26 @@ lib/driverlib/udma.h \
lib/driverlib/usb.c \
lib/driverlib/usb.h \
lib/driverlib/watchdog.c \
lib/driverlib/watchdog.h
lib/driverlib/watchdog.h \
../../../Source/third_party/uip/uip/clock.h \
../../../Source/third_party/uip/uip/lc-addrlabels.h \
../../../Source/third_party/uip/uip/lc-switch.h \
../../../Source/third_party/uip/uip/lc.h \
../../../Source/third_party/uip/uip/pt.h \
../../../Source/third_party/uip/uip/uip-fw.c \
../../../Source/third_party/uip/uip/uip-fw.h \
../../../Source/third_party/uip/uip/uip-neighbor.h \
../../../Source/third_party/uip/uip/uip-split.h \
../../../Source/third_party/uip/uip/uip.c \
../../../Source/third_party/uip/uip/uip.h \
../../../Source/third_party/uip/uip/uiplib.c \
../../../Source/third_party/uip/uip/uiplib.h \
../../../Source/third_party/uip/uip/uipopt.h \
../../../Source/third_party/uip/uip/uip_arch.h \
../../../Source/third_party/uip/uip/uip_arp.c \
../../../Source/third_party/uip/uip/uip_arp.h \
../../../Source/third_party/uip/uip/uip_timer.c \
../../../Source/third_party/uip/uip/uip_timer.h
#|---------------------------------------------------------------------------------------|

View File

@ -0,0 +1,207 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_GCC\Prog\net.c
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_GCC
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
/****************************************************************************************
* Include files
****************************************************************************************/
#include "header.h" /* generic header */
#include "netdev.h"
#include "uip.h"
#include "uip_arp.h"
/****************************************************************************************
* Macro definitions
****************************************************************************************/
/** \brief Delta time for the uIP periodic timer. */
#define NET_UIP_PERIODIC_TIMER_MS (500)
/** \brief Delta time for the uIP ARP timer. */
#define NET_UIP_ARP_TIMER_MS (10000)
/** \brief Macro for accessing the Ethernet header information in the buffer */
#define NET_UIP_HEADER_BUF ((struct uip_eth_hdr *)&uip_buf[0])
/****************************************************************************************
* Local data declarations
****************************************************************************************/
/** \brief Holds the time out value of the uIP periodic timer. */
static unsigned long periodicTimerTimeOut;
/** \brief Holds the time out value of the uIP ARP timer. */
static unsigned long ARPTimerTimeOut;
/************************************************************************************//**
** \brief Initializes the TCP/IP network communication interface.
** \return none.
**
****************************************************************************************/
void NetInit(void)
{
uip_ipaddr_t ipaddr;
/* initialize the network device */
netdev_init();
/* initialize the uIP TCP/IP stack. */
uip_init();
/* set the IP address */
uip_ipaddr(ipaddr, BOOT_COM_NET_IPADDR0, BOOT_COM_NET_IPADDR1, BOOT_COM_NET_IPADDR2,
BOOT_COM_NET_IPADDR3);
uip_sethostaddr(ipaddr);
/* set the network mask */
uip_ipaddr(ipaddr, BOOT_COM_NET_NETMASK0, BOOT_COM_NET_NETMASK1, BOOT_COM_NET_NETMASK2,
BOOT_COM_NET_NETMASK3);
uip_setnetmask(ipaddr);
/* set the MAC address */
netdev_setmacaddr();
/* initialize the timer variables */
periodicTimerTimeOut = TimeGet() + NET_UIP_PERIODIC_TIMER_MS;
ARPTimerTimeOut = TimeGet() + NET_UIP_ARP_TIMER_MS;
/* start listening on the configured port for XCP transfers on TCP/IP */
uip_listen(HTONS(BOOT_COM_NET_PORT));
} /*** end of NetInit ***/
/************************************************************************************//**
** \brief The uIP network application that detects the XCP connect command on the
** port used by the bootloader. This indicates that the bootloader should
** be activated.
** \return none.
**
****************************************************************************************/
void NetApp(void)
{
unsigned char *newDataPtr;
if (uip_connected())
{
return;
}
if (uip_newdata())
{
/* a new XCP command was received. check if this is the connect command and in this
* case activate the bootloader. with XCP on TCP/IP the first 4 bytes contain a
* counter value in which we are not really interested.
*/
newDataPtr = uip_appdata;
newDataPtr += 4;
/* check if this was an XCP CONNECT command */
if ((newDataPtr[0] == 0xff) && (newDataPtr[1] == 0x00))
{
/* connection request received so start the bootloader */
BootActivate();
}
}
} /*** end of NetApp ***/
/************************************************************************************//**
** \brief Runs the TCP/IP server task.
** \return none.
**
****************************************************************************************/
void NetTask(void)
{
unsigned long connection;
unsigned long packetLen;
/* check for an RX packet and read it. */
packetLen = netdev_read();
if(packetLen > 0)
{
/* set uip_len for uIP stack usage */
uip_len = (unsigned short)packetLen;
/* process incoming IP packets here. */
if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_IP))
{
uip_arp_ipin();
uip_input();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
/* process incoming ARP packets here. */
else if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_ARP))
{
uip_arp_arpin();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
netdev_send();
uip_len = 0;
}
}
}
/* process TCP/IP Periodic Timer here. */
if (TimeGet() >= periodicTimerTimeOut)
{
periodicTimerTimeOut += NET_UIP_PERIODIC_TIMER_MS;
for (connection = 0; connection < UIP_CONNS; connection++)
{
uip_periodic(connection);
/* If the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
}
/* process ARP Timer here. */
if (TimeGet() >= ARPTimerTimeOut)
{
ARPTimerTimeOut += NET_UIP_ARP_TIMER_MS;
uip_arp_timer();
}
} /*** end of NetServerTask ***/
/*********************************** end of net.c **************************************/

View File

@ -0,0 +1,66 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_GCC\Prog\net.h
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_GCC
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
#ifndef NET_H
#define NET_H
/****************************************************************************************
* Macro definitions
****************************************************************************************/
#ifndef UIP_APPCALL
#define UIP_APPCALL NetApp
#endif /* UIP_APPCALL */
/****************************************************************************************
* Type definitions
****************************************************************************************/
/** \brief Define the uip_tcp_appstate_t datatype. This is the state of our tcp/ip
* application, and the memory required for this state is allocated together
* with each TCP connection. One application state for each TCP connection.
*/
typedef struct net_state
{
unsigned char unused;
} uip_tcp_appstate_t;
/****************************************************************************************
* Function prototypes
****************************************************************************************/
void NetInit(void);
void NetApp(void);
void NetTask(void);
#endif /* NET_H */
/*********************************** end of net.h **************************************/

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
<Column0>211</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
<Column0>146</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Disassembly>
<col-names>
@ -39,7 +39,7 @@
<Wnd2>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-4214-26312</Identity>
@ -51,20 +51,20 @@
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd2><Wnd3><Tabs><Tab><Identity>TabID-14429-10902</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3><Wnd5><Tabs><Tab><Identity>TabID-29443-18340</Identity><TabName>Disassembly</TabName><Factory>Disassembly</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd5></Windows>
<SelectedTab>0</SelectedTab></Wnd0><Wnd1><Tabs><Tab><Identity>TabID-14429-10902</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1><Wnd4><Tabs><Tab><Identity>TabID-29443-18340</Identity><TabName>Disassembly</TabName><Factory>Disassembly</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd4></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>109</YPos2><SelStart2>7195</SelStart2><SelEnd2>7195</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>13</YPos2><SelStart2>3088</SelStart2><SelEnd2>3088</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>86</YPos2><SelStart2>6203</SelStart2><SelEnd2>6203</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\cpu.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2556</SelStart2><SelEnd2>2556</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>2346</SelStart2><SelEnd2>2373</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\types.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>7</YPos2><SelStart2>2676</SelStart2><SelEnd2>2684</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>73</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2978</SelStart2><SelEnd2>3026</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\lib\uip\netdev.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>58</YPos2><SelStart2>3802</SelStart2><SelEnd2>3802</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\net.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>92</YPos2><SelStart2>4500</SelStart2><SelEnd2>4500</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-02a0ba70><key>iaridepm.enu1</key></Toolbar-02a0ba70></Sizes></Row0><Row1><Sizes><Toolbar-036a10f8><key>debuggergui.enu1</key></Toolbar-036a10f8></Sizes></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>285</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>243</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>241071</sizeHorzCY><sizeVertCX>149479</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes><Wnd5><Rect><Top>-2</Top><Left>-2</Left><Bottom>741</Bottom><Right>198</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>104167</sizeHorzCX><sizeHorzCY>198413</sizeHorzCY><sizeVertCX>104167</sizeVertCX><sizeVertCY>737103</sizeVertCY></Rect></Wnd5></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1922</Right><x>-2</x><y>-2</y><xscreen>1924</xscreen><yscreen>200</yscreen><sizeHorzCX>1002083</sizeHorzCX><sizeHorzCY>198413</sizeHorzCY><sizeVertCX>104167</sizeVertCX><sizeVertCY>198413</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-02beba70><key>iaridepm.enu1</key></Toolbar-02beba70></Sizes></Row0><Row1><Sizes><Toolbar-0b064bc8><key>debuggergui.enu1</key></Toolbar-0b064bc8></Sizes></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>597</Bottom><Right>237</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>125000</sizeHorzCX><sizeHorzCY>241546</sizeHorzCY><sizeVertCX>149375</sizeVertCX><sizeVertCY>723430</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>597</Bottom><Right>165</Right><x>-2</x><y>-2</y><xscreen>167</xscreen><yscreen>164</yscreen><sizeHorzCX>104375</sizeHorzCX><sizeHorzCY>198068</sizeHorzCY><sizeVertCX>104375</sizeVertCX><sizeVertCY>723430</sizeVertCY></Rect></Wnd4></Sizes></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>162</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>164</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>198068</sizeHorzCY><sizeVertCX>104375</sizeVertCX><sizeVertCY>198068</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Project>

View File

@ -9,7 +9,7 @@ TriggerName=main
LimitSize=0
ByteLimit=50
[DebugChecksum]
Checksum=1777559187
Checksum=219067476
[Exceptions]
StopOnUncaught=_ 0
StopOnThrow=_ 0

View File

@ -12,12 +12,12 @@
<Column0>410</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
<Column0>326</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Find-All-References</Factory></Window></Windows></PreferedWindows><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1155</ColumnWidth1><ColumnWidth2>308</ColumnWidth2><ColumnWidth3>77</ColumnWidth3></Build><Find-in-Files><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><ColumnWidth0>552</ColumnWidth0><ColumnWidth1>78</ColumnWidth1><ColumnWidth2>946</ColumnWidth2></Find-in-Files><TerminalIO/><PROJECT_GUI_CALL_GRAPH><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><col-names><item>File</item><item>Function</item><item>Line</item></col-names><col-widths><item>200</item><item>700</item><item>100</item></col-widths></PROJECT_GUI_CALL_GRAPH><Select-Ambiguous-Definitions><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window><Window><Factory>Find-in-Files</Factory></Window><Window><Factory>Find-All-References</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Select-Ambiguous-Definitions><Find-All-References><PreferedWindows><Position>1</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows><Window><Factory>Build</Factory></Window></Windows></PreferedWindows><ColumnWidth0>664</ColumnWidth0><ColumnWidth1>94</ColumnWidth1><ColumnWidth2>1138</ColumnWidth2></Find-All-References></Static>
<Windows>
<Wnd1>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-31649-22318</Identity>
@ -25,24 +25,24 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Boot</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode><ExpandedNode>lm3s6965/Source/fatfs</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Boot</ExpandedNode><ExpandedNode>lm3s6965/Boot/lib</ExpandedNode><ExpandedNode>lm3s6965/Boot/lib/uip</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Source</ExpandedNode><ExpandedNode>lm3s6965/Source/ARMCM3_LM3S</ExpandedNode><ExpandedNode>lm3s6965/Source/fatfs</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd1><Wnd2><Tabs><Tab><Identity>TabID-23631-11730</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-25094-12726</Identity><TabName>Ambiguous Definitions</TabName><Factory>Select-Ambiguous-Definitions</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd2></Windows>
<SelectedTab>0</SelectedTab></Wnd0><Wnd3><Tabs><Tab><Identity>TabID-23631-11730</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-25094-12726</Identity><TabName>Ambiguous Definitions</TabName><Factory>Select-Ambiguous-Definitions</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>109</YPos2><SelStart2>7195</SelStart2><SelEnd2>7195</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>13</YPos2><SelStart2>3088</SelStart2><SelEnd2>3088</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>86</YPos2><SelStart2>6203</SelStart2><SelEnd2>6203</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\cpu.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2556</SelStart2><SelEnd2>2556</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\flash.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>2346</SelStart2><SelEnd2>2373</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\ARMCM3_LM3S\types.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>7</YPos2><SelStart2>2676</SelStart2><SelEnd2>2684</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\blt_conf.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>73</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>40</YPos2><SelStart2>3038</SelStart2><SelEnd2>3038</SelEnd2></Tab><ActiveTab>1</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\backdoor.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>24</YPos2><SelStart2>2978</SelStart2><SelEnd2>3026</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\lib\uip\netdev.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>58</YPos2><SelStart2>3802</SelStart2><SelEnd2>3802</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\..\..\Source\net.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>92</YPos2><SelStart2>4500</SelStart2><SelEnd2>4500</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-02a0ba70><key>iaridepm.enu1</key></Toolbar-02a0ba70></Sizes></Row0><Row1><Sizes/></Row1><Row2><Sizes/></Row2></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>548</Bottom><Right>501</Right><x>-2</x><y>-2</y><xscreen>372</xscreen><yscreen>353</yscreen><sizeHorzCX>193750</sizeHorzCX><sizeHorzCY>350198</sizeHorzCY><sizeVertCX>261979</sizeVertCX><sizeVertCY>545635</sizeVertCY></Rect></Wnd1><Wnd2><Rect><Top>0</Top><Left>0</Left><Bottom>0</Bottom><Right>49443096</Right><x>-2</x><y>546</y><xscreen>258</xscreen><yscreen>238</yscreen><sizeHorzCX>134375</sizeHorzCX><sizeHorzCY>236111</sizeHorzCY><sizeVertCX>261979</sizeVertCX><sizeVertCY>413690</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes/></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-02beba70><key>iaridepm.enu1</key></Toolbar-02beba70></Sizes></Row0><Row1><Sizes/></Row1><Row2><Sizes/></Row2></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>446</Bottom><Right>417</Right><x>-2</x><y>-2</y><xscreen>310</xscreen><yscreen>290</yscreen><sizeHorzCX>193750</sizeHorzCX><sizeHorzCY>350242</sizeHorzCY><sizeVertCX>261875</sizeVertCX><sizeVertCY>541063</sizeVertCY></Rect></Wnd0><Wnd3><Rect><Top>0</Top><Left>0</Left><Bottom>0</Bottom><Right>7</Right><x>-2</x><y>444</y><xscreen>215</xscreen><yscreen>195</yscreen><sizeHorzCX>134375</sizeHorzCX><sizeHorzCY>235507</sizeHorzCY><sizeVertCX>261875</sizeVertCX><sizeVertCY>409420</sizeVertCY></Rect></Wnd3></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes/></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@ -42,7 +42,7 @@
** \return none.
**
****************************************************************************************/
static void BootActivate(void)
void BootActivate(void)
{
/* perform software reset to activate the bootoader again */
SysCtlReset();

View File

@ -38,6 +38,7 @@
****************************************************************************************/
void BootComInit(void);
void BootComCheckActivationRequest(void);
void BootActivate(void);
#endif /* BOOT_H */

View File

@ -41,6 +41,7 @@
#include "irq.h" /* IRQ driver */
#include "led.h" /* LED driver */
#include "time.h" /* Timer driver */
#include "net.h" /* TCP/IP server application */
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"

File diff suppressed because it is too large Load Diff

View File

@ -302,6 +302,8 @@
<state>$PROJ_DIR$\..\lib</state>
<state>$PROJ_DIR$\..\lib\inc</state>
<state>$PROJ_DIR$\..\lib\driverlib</state>
<state>$PROJ_DIR$\..\lib\uip</state>
<state>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip</state>
</option>
<option>
<name>CCStdIncCheck</name>
@ -2064,6 +2066,87 @@
<name>$PROJ_DIR$\..\lib\inc\lm3s6965.h</name>
</file>
</group>
<group>
<name>uip</name>
<file>
<name>$PROJ_DIR$\..\lib\uip\clock-arch.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\clock-arch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\netdev.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\netdev.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\lib\uip\uip-conf.h</name>
</file>
</group>
</group>
<group>
<name>third_party</name>
<group>
<name>uip</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\clock.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc-addrlabels.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc-switch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\lc.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\pt.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-fw.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-fw.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-neighbor.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip-split.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arch.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_arp.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_timer.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uip_timer.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uiplib.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uiplib.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\Source\third_party\uip\uip\uipopt.h</name>
</file>
</group>
</group>
<file>
<name>$PROJ_DIR$\..\boot.c</name>
@ -2092,6 +2175,12 @@
<file>
<name>$PROJ_DIR$\..\main.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\net.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\net.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\time.c</name>
</file>

View File

@ -11,7 +11,7 @@ ByteLimit=50
[Breakpoints]
Count=0
[DebugChecksum]
Checksum=21002497
Checksum=-1260324233
[Exceptions]
StopOnUncaught=_ 0
StopOnThrow=_ 0

View File

@ -12,7 +12,7 @@
<Column0>283</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
<Column0>223</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build>
<PreferedWindows>
@ -43,24 +43,24 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Prog</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>lm3s6965</ExpandedNode><ExpandedNode>lm3s6965/Output</ExpandedNode><ExpandedNode>lm3s6965/Prog</ExpandedNode><ExpandedNode>lm3s6965/Prog/lib</ExpandedNode><ExpandedNode>lm3s6965/Prog/lib/uip</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<SelectedTab>0</SelectedTab></Wnd0><Wnd1><Tabs><Tab><Identity>TabID-14407-15370</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1></Windows>
<SelectedTab>0</SelectedTab></Wnd0><Wnd2><Tabs><Tab><Identity>TabID-32469-16784</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd2></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>71</YPos2><SelStart2>4426</SelStart2><SelEnd2>4426</SelEnd2></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\led.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>58</YPos2><SelStart2>3595</SelStart2><SelEnd2>3595</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\boot.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>116</YPos2><SelStart2>5573</SelStart2><SelEnd2>5573</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\cstart.s</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>15</YPos2><SelStart2>2608</SelStart2><SelEnd2>2608</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\vectors.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>63</YPos2><SelStart2>1290</SelStart2><SelEnd2>1290</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\time.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>4346</SelStart2><SelEnd2>4346</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\led.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>45</YPos2><SelStart2>3072</SelStart2><SelEnd2>3072</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\boot.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>45</YPos2><SelStart2>1098</SelStart2><SelEnd2>1098</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>49</YPos2><SelStart2>3128</SelStart2><SelEnd2>3128</SelEnd2></Tab><ActiveTab>2</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\lib\uip\netdev.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>60</YPos2><SelStart2>2696</SelStart2><SelEnd2>2696</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<Positions>
<Top><Row0><Sizes><Toolbar-02a4ba70><key>iaridepm.enu1</key></Toolbar-02a4ba70></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>760</Bottom><Right>357</Right><x>-2</x><y>-2</y><xscreen>186</xscreen><yscreen>205</yscreen><sizeHorzCX>96875</sizeHorzCX><sizeHorzCY>203373</sizeHorzCY><sizeVertCX>186979</sizeVertCX><sizeVertCY>755952</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>203</Bottom><Right>1922</Right><x>-2</x><y>-2</y><xscreen>1924</xscreen><yscreen>205</yscreen><sizeHorzCX>1002083</sizeHorzCX><sizeHorzCY>203373</sizeHorzCY><sizeVertCX>96875</sizeVertCX><sizeVertCY>203373</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
<Top><Row0><Sizes><Toolbar-02acba70><key>iaridepm.enu1</key></Toolbar-02acba70></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>621</Bottom><Right>297</Right><x>-2</x><y>-2</y><xscreen>155</xscreen><yscreen>168</yscreen><sizeHorzCX>96875</sizeHorzCX><sizeHorzCY>202899</sizeHorzCY><sizeVertCX>186875</sizeVertCX><sizeVertCY>752415</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>162</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>164</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>198068</sizeHorzCY><sizeVertCX>104375</sizeVertCX><sizeVertCY>198068</sizeVertCY></Rect></Wnd2></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.c,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* Implementation of architecture-specific clock functionality
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "header.h" /* generic header */
#include "clock-arch.h"
/*---------------------------------------------------------------------------*/
clock_time_t
clock_time(void)
{
return (clock_time_t)TimeGet();
}
/*---------------------------------------------------------------------------*/

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: clock-arch.h,v 1.2 2006/06/12 08:00:31 adam Exp $
*/
#ifndef __CLOCK_ARCH_H__
#define __CLOCK_ARCH_H__
typedef int clock_time_t;
#define CLOCK_CONF_SECOND 1000
#endif /* __CLOCK_ARCH_H__ */

View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: netdev.c,v 1.8 2006/06/07 08:39:58 adam Exp $
*/
/*---------------------------------------------------------------------------*/
#include "header.h" /* generic header */
#include "uip.h"
#include "uip_arp.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ethernet.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/ethernet.h"
#include "driverlib/flash.h"
/*---------------------------------------------------------------------------*/
#define NETDEV_LINKUP_TIMEOUT_MS (5000)
#define NETDEV_DEFAULT_MACADDR0 (0x08)
#define NETDEV_DEFAULT_MACADDR1 (0x00)
#define NETDEV_DEFAULT_MACADDR2 (0x27)
#define NETDEV_DEFAULT_MACADDR3 (0x69)
#define NETDEV_DEFAULT_MACADDR4 (0x5B)
#define NETDEV_DEFAULT_MACADDR5 (0x45)
/*---------------------------------------------------------------------------*/
void netdev_init(void)
{
unsigned long ulTemp;
unsigned long ulLinkTimeOut;
/* enable and reset the ethernet controller. */
SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
/* enable port F for ethernet LEDs.
* LED0 Bit 3 Output
* LED1 Bit 2 Output
*/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeEthernetLED(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3);
/* intialize the ethernet controller and disable all ethernet controller
* interrupt sources.
*/
EthernetIntDisable(ETH_BASE, (ETH_INT_PHY | ETH_INT_MDIO | ETH_INT_RXER |
ETH_INT_RXOF | ETH_INT_TX | ETH_INT_TXER | ETH_INT_RX));
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* initialize the ethernet controller for operation. */
EthernetInitExpClk(ETH_BASE, SysCtlClockGet());
/* configure the ethernet controller for normal operation.
* - Full Duplex
* - TX CRC Auto Generation
* - TX Padding Enabled
*/
EthernetConfigSet(ETH_BASE, (ETH_CFG_TX_DPLXEN | ETH_CFG_TX_CRCEN |
ETH_CFG_TX_PADEN));
/* wait for the link to become active. */
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
ulLinkTimeOut = TimeGet() + NETDEV_LINKUP_TIMEOUT_MS;
while ((ulTemp & 0x0004) == 0)
{
ulTemp = EthernetPHYRead(ETH_BASE, PHY_MR1);
/* check for timeout so that the software program can still start if the
* ethernet cable is not connected.
*/
if (TimeGet() >= ulLinkTimeOut)
{
break;
}
}
/* enable the ethernet controller. */
EthernetEnable(ETH_BASE);
}
/*---------------------------------------------------------------------------*/
void netdev_setmacaddr(void)
{
struct uip_eth_addr macAddress;
unsigned long ulUser0, ulUser1;
/* set the default MAC address */
macAddress.addr[0] = NETDEV_DEFAULT_MACADDR0;
macAddress.addr[1] = NETDEV_DEFAULT_MACADDR1;
macAddress.addr[2] = NETDEV_DEFAULT_MACADDR2;
macAddress.addr[3] = NETDEV_DEFAULT_MACADDR3;
macAddress.addr[4] = NETDEV_DEFAULT_MACADDR4;
macAddress.addr[5] = NETDEV_DEFAULT_MACADDR5;
/* the LM3S eval kit should have a MAC address pre-propgrammed in flash by the
* manufacturer. try to use this one, otherwise use the default values.
*/
FlashUserGet(&ulUser0, &ulUser1);
if ( (ulUser0 != 0xffffffff) && (ulUser1 != 0xffffffff) )
{
macAddress.addr[0] = ((ulUser0 >> 0) & 0xff);
macAddress.addr[1] = ((ulUser0 >> 8) & 0xff);
macAddress.addr[2] = ((ulUser0 >> 16) & 0xff);
macAddress.addr[3] = ((ulUser1 >> 0) & 0xff);
macAddress.addr[4] = ((ulUser1 >> 8) & 0xff);
macAddress.addr[5] = ((ulUser1 >> 16) & 0xff);
}
EthernetMACAddrSet(ETH_BASE, &macAddress.addr[0]);
uip_setethaddr(macAddress);
}
/*---------------------------------------------------------------------------*/
unsigned int netdev_read(void)
{
unsigned long ulTemp;
/* read and Clear the interrupt flag. */
ulTemp = EthernetIntStatus(ETH_BASE, false);
EthernetIntClear(ETH_BASE, ulTemp);
/* check to see if an RX Interrupt has occured. */
if(ulTemp & ETH_INT_RX)
{
return EthernetPacketGetNonBlocking(ETH_BASE, uip_buf, sizeof(uip_buf));
}
return 0;
}
/*---------------------------------------------------------------------------*/
void netdev_send(void)
{
EthernetPacketPut(ETH_BASE, uip_buf, uip_len);
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2001, Adam Dunkels.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Adam Dunkels.
* 4. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack.
*
* $Id: netdev.h,v 1.1 2002/01/10 06:22:56 adam Exp $
*
*/
#ifndef __NETDEV_H__
#define __NETDEV_H__
void netdev_init(void);
unsigned int netdev_read(void);
void netdev_send(void);
void netdev_setmacaddr(void);
#endif /* __NETDEV_H__ */

View File

@ -0,0 +1,151 @@
/**
* \addtogroup uipopt
* @{
*/
/**
* \name Project-specific configuration options
* @{
*
* uIP has a number of configuration options that can be overridden
* for each project. These are kept in a project-specific uip-conf.h
* file and all configuration names have the prefix UIP_CONF.
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the uIP TCP/IP stack
*
* $Id: uip-conf.h,v 1.6 2006/06/12 08:00:31 adam Exp $
*/
/**
* \file
* An example uIP configuration file
* \author
* Adam Dunkels <adam@sics.se>
*/
#ifndef __UIP_CONF_H__
#define __UIP_CONF_H__
/**
* 8 bit datatype
*
* This typedef defines the 8-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned char u8_t;
/**
* 16 bit datatype
*
* This typedef defines the 16-bit type used throughout uIP.
*
* \hideinitializer
*/
typedef unsigned short u16_t;
/**
* Statistics datatype
*
* This typedef defines the dataype used for keeping statistics in
* uIP.
*
* \hideinitializer
*/
typedef unsigned short uip_stats_t;
/**
* Maximum number of TCP connections.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_CONNECTIONS 1
/**
* Maximum number of listening TCP ports.
*
* \hideinitializer
*/
#define UIP_CONF_MAX_LISTENPORTS 1
/**
* uIP buffer size.
*
* \hideinitializer
*/
#define UIP_CONF_BUFFER_SIZE 1600
/**
* CPU byte order.
*
* \hideinitializer
*/
#define UIP_CONF_BYTE_ORDER LITTLE_ENDIAN
/**
* Logging on or off
*
* \hideinitializer
*/
#define UIP_CONF_LOGGING 0
/**
* UDP support on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP 0
/**
* UDP checksums on or off
*
* \hideinitializer
*/
#define UIP_CONF_UDP_CHECKSUMS 1
/**
* uIP statistics on or off
*
* \hideinitializer
*/
#define UIP_CONF_STATISTICS 0
/* Here we include the header file for the application(s) we use in
our project. */
#include "boot.h"
#include "net.h"
#endif /* __UIP_CONF_H__ */
/** @} */
/** @} */

View File

@ -53,6 +53,8 @@ void main(void)
{
/* initialize the microcontroller */
Init();
/* initialize the network application */
NetInit();
/* initialize the bootloader interface */
BootComInit();
@ -61,6 +63,8 @@ void main(void)
{
/* toggle LED with a fixed frequency */
LedToggle();
/* run the network task */
NetTask();
/* check for bootloader activation request */
BootComCheckActivationRequest();
}

View File

@ -0,0 +1,207 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_IAR\Prog\net.c
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_IAR
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
/****************************************************************************************
* Include files
****************************************************************************************/
#include "header.h" /* generic header */
#include "netdev.h"
#include "uip.h"
#include "uip_arp.h"
/****************************************************************************************
* Macro definitions
****************************************************************************************/
/** \brief Delta time for the uIP periodic timer. */
#define NET_UIP_PERIODIC_TIMER_MS (500)
/** \brief Delta time for the uIP ARP timer. */
#define NET_UIP_ARP_TIMER_MS (10000)
/** \brief Macro for accessing the Ethernet header information in the buffer */
#define NET_UIP_HEADER_BUF ((struct uip_eth_hdr *)&uip_buf[0])
/****************************************************************************************
* Local data declarations
****************************************************************************************/
/** \brief Holds the time out value of the uIP periodic timer. */
static unsigned long periodicTimerTimeOut;
/** \brief Holds the time out value of the uIP ARP timer. */
static unsigned long ARPTimerTimeOut;
/************************************************************************************//**
** \brief Initializes the TCP/IP network communication interface.
** \return none.
**
****************************************************************************************/
void NetInit(void)
{
uip_ipaddr_t ipaddr;
/* initialize the network device */
netdev_init();
/* initialize the uIP TCP/IP stack. */
uip_init();
/* set the IP address */
uip_ipaddr(ipaddr, BOOT_COM_NET_IPADDR0, BOOT_COM_NET_IPADDR1, BOOT_COM_NET_IPADDR2,
BOOT_COM_NET_IPADDR3);
uip_sethostaddr(ipaddr);
/* set the network mask */
uip_ipaddr(ipaddr, BOOT_COM_NET_NETMASK0, BOOT_COM_NET_NETMASK1, BOOT_COM_NET_NETMASK2,
BOOT_COM_NET_NETMASK3);
uip_setnetmask(ipaddr);
/* set the MAC address */
netdev_setmacaddr();
/* initialize the timer variables */
periodicTimerTimeOut = TimeGet() + NET_UIP_PERIODIC_TIMER_MS;
ARPTimerTimeOut = TimeGet() + NET_UIP_ARP_TIMER_MS;
/* start listening on the configured port for XCP transfers on TCP/IP */
uip_listen(HTONS(BOOT_COM_NET_PORT));
} /*** end of NetInit ***/
/************************************************************************************//**
** \brief The uIP network application that detects the XCP connect command on the
** port used by the bootloader. This indicates that the bootloader should
** be activated.
** \return none.
**
****************************************************************************************/
void NetApp(void)
{
unsigned char *newDataPtr;
if (uip_connected())
{
return;
}
if (uip_newdata())
{
/* a new XCP command was received. check if this is the connect command and in this
* case activate the bootloader. with XCP on TCP/IP the first 4 bytes contain a
* counter value in which we are not really interested.
*/
newDataPtr = uip_appdata;
newDataPtr += 4;
/* check if this was an XCP CONNECT command */
if ((newDataPtr[0] == 0xff) && (newDataPtr[1] == 0x00))
{
/* connection request received so start the bootloader */
BootActivate();
}
}
} /*** end of NetApp ***/
/************************************************************************************//**
** \brief Runs the TCP/IP server task.
** \return none.
**
****************************************************************************************/
void NetTask(void)
{
unsigned long connection;
unsigned long packetLen;
/* check for an RX packet and read it. */
packetLen = netdev_read();
if(packetLen > 0)
{
/* set uip_len for uIP stack usage */
uip_len = (unsigned short)packetLen;
/* process incoming IP packets here. */
if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_IP))
{
uip_arp_ipin();
uip_input();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
/* process incoming ARP packets here. */
else if(NET_UIP_HEADER_BUF->type == htons(UIP_ETHTYPE_ARP))
{
uip_arp_arpin();
/* if the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
netdev_send();
uip_len = 0;
}
}
}
/* process TCP/IP Periodic Timer here. */
if (TimeGet() >= periodicTimerTimeOut)
{
periodicTimerTimeOut += NET_UIP_PERIODIC_TIMER_MS;
for (connection = 0; connection < UIP_CONNS; connection++)
{
uip_periodic(connection);
/* If the above function invocation resulted in data that
* should be sent out on the network, the global variable
* uip_len is set to a value > 0.
*/
if(uip_len > 0)
{
uip_arp_out();
netdev_send();
uip_len = 0;
}
}
}
/* process ARP Timer here. */
if (TimeGet() >= ARPTimerTimeOut)
{
ARPTimerTimeOut += NET_UIP_ARP_TIMER_MS;
uip_arp_timer();
}
} /*** end of NetServerTask ***/
/*********************************** end of net.c **************************************/

View File

@ -0,0 +1,66 @@
/************************************************************************************//**
* \file Demo\ARMCM3_LM3S_EK_LM3S6965_IAR\Prog\net.h
* \brief Network application for the uIP TCP/IP stack.
* \ingroup Prog_ARMCM3_LM3S_EK_LM3S6965_IAR
* \internal
*----------------------------------------------------------------------------------------
* C O P Y R I G H T
*----------------------------------------------------------------------------------------
* Copyright (c) 2014 by Feaser http://www.feaser.com All rights reserved
*
*----------------------------------------------------------------------------------------
* L I C E N S E
*----------------------------------------------------------------------------------------
* This file is part of OpenBLT. OpenBLT is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* OpenBLT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenBLT.
* If not, see <http://www.gnu.org/licenses/>.
*
* A special exception to the GPL is included to allow you to distribute a combined work
* that includes OpenBLT without being obliged to provide the source code for any
* proprietary components. The exception text is included at the bottom of the license
* file <license.html>.
*
* \endinternal
****************************************************************************************/
#ifndef NET_H
#define NET_H
/****************************************************************************************
* Macro definitions
****************************************************************************************/
#ifndef UIP_APPCALL
#define UIP_APPCALL NetApp
#endif /* UIP_APPCALL */
/****************************************************************************************
* Type definitions
****************************************************************************************/
/** \brief Define the uip_tcp_appstate_t datatype. This is the state of our tcp/ip
* application, and the memory required for this state is allocated together
* with each TCP connection. One application state for each TCP connection.
*/
typedef struct net_state
{
unsigned char unused;
} uip_tcp_appstate_t;
/****************************************************************************************
* Function prototypes
****************************************************************************************/
void NetInit(void);
void NetApp(void);
void NetTask(void);
#endif /* NET_H */
/*********************************** end of net.h **************************************/