From 7beb4cd4cfca91a4d3f5c3e47fb92253d4a9340e Mon Sep 17 00:00:00 2001 From: "qiuyiuestc@gmail.com" Date: Sun, 26 Jun 2011 10:38:41 +0000 Subject: [PATCH] support Lwip git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1538 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/lm3s9b9x/Libraries/SConscript | 2 +- bsp/lm3s9b9x/SConscript | 2 +- bsp/lm3s9b9x/SConstruct | 2 +- bsp/lm3s9b9x/project.Uv2 | 114 +++++++++++++++++++++++------- bsp/lm3s9b9x/rtconfig.h | 3 +- bsp/lm3s9b9x/startup.c | 4 +- bsp/lm3s9b9x/template.Uv2 | 4 +- 7 files changed, 96 insertions(+), 35 deletions(-) diff --git a/bsp/lm3s9b9x/Libraries/SConscript b/bsp/lm3s9b9x/Libraries/SConscript index 96ed07572..ac6ad7011 100644 --- a/bsp/lm3s9b9x/Libraries/SConscript +++ b/bsp/lm3s9b9x/Libraries/SConscript @@ -29,7 +29,7 @@ src = Split(""" driverlib/watchdog.c """) -CPPPATH = [RTT_ROOT + '/bsp/lm3s/Libraries/inc', RTT_ROOT + '/bsp/lm3s/Libraries', RTT_ROOT + '/bsp/lm3s/Libraries/driverlib'] +CPPPATH = [RTT_ROOT + '/bsp/lm3s9b9x/Libraries/inc', RTT_ROOT + '/bsp/lm3s9b9x/Libraries', RTT_ROOT + '/bsp/lm3s9b9x/Libraries/driverlib'] group = DefineGroup('library', src, depend = [''], CPPPATH = CPPPATH) diff --git a/bsp/lm3s9b9x/SConscript b/bsp/lm3s9b9x/SConscript index 6422828c2..5710c9bdd 100644 --- a/bsp/lm3s9b9x/SConscript +++ b/bsp/lm3s9b9x/SConscript @@ -13,7 +13,7 @@ if GetDepend('RT_USING_LWIP'): src_drv += ['luminaryif.c'] src = File(src_bsp + src_drv) -CPPPATH = [RTT_ROOT + '/bsp/lm3s_9b9x'] +CPPPATH = [RTT_ROOT + '/bsp/lm3s9b9x'] group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/bsp/lm3s9b9x/SConstruct b/bsp/lm3s9b9x/SConstruct index e8b767275..19c806f8e 100644 --- a/bsp/lm3s9b9x/SConstruct +++ b/bsp/lm3s9b9x/SConstruct @@ -21,7 +21,7 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) -objs = objs + SConscript(('bsp/lm3s/Libraries/SConscript'), variant_dir='build/bsp/Libraries', duplicate=0) +objs = objs + SConscript(('bsp/lm3s9b9x/Libraries/SConscript'), variant_dir='build/bsp/Libraries', duplicate=0) env.Program(TARGET, objs) diff --git a/bsp/lm3s9b9x/project.Uv2 b/bsp/lm3s9b9x/project.Uv2 index f023d0e3e..994d8bf76 100644 --- a/bsp/lm3s9b9x/project.Uv2 +++ b/bsp/lm3s9b9x/project.Uv2 @@ -7,11 +7,13 @@ Group (Startup) Group (Kernel) Group (LM3S) Group (finsh) +Group (LwIP) Group (library) File 1,1,<.\application.c> File 1,1,<.\startup.c> File 1,1,<.\board.c> +File 1,1,<.\luminaryif.c> File 2,1,<..\..\src\clock.c> File 2,1,<..\..\src\device.c> File 2,1,<..\..\src\idle.c> @@ -51,29 +53,70 @@ File 4,1,<..\..\components\finsh\finsh_var.c> File 4,1,<..\..\components\finsh\finsh_vm.c> File 4,1,<..\..\components\finsh\shell.c> File 4,1,<..\..\components\finsh\symbol.c> -File 5,1,<..\lm3s\Libraries\driverlib\adc.c> -File 5,1,<..\lm3s\Libraries\driverlib\can.c> -File 5,1,<..\lm3s\Libraries\driverlib\comp.c> -File 5,1,<..\lm3s\Libraries\driverlib\cpu.c> -File 5,1,<..\lm3s\Libraries\driverlib\epi.c> -File 5,1,<..\lm3s\Libraries\driverlib\ethernet.c> -File 5,1,<..\lm3s\Libraries\driverlib\flash.c> -File 5,1,<..\lm3s\Libraries\driverlib\gpio.c> -File 5,1,<..\lm3s\Libraries\driverlib\hibernate.c> -File 5,1,<..\lm3s\Libraries\driverlib\i2c.c> -File 5,1,<..\lm3s\Libraries\driverlib\i2s.c> -File 5,1,<..\lm3s\Libraries\driverlib\interrupt.c> -File 5,1,<..\lm3s\Libraries\driverlib\mpu.c> -File 5,1,<..\lm3s\Libraries\driverlib\pwm.c> -File 5,1,<..\lm3s\Libraries\driverlib\qei.c> -File 5,1,<..\lm3s\Libraries\driverlib\ssi.c> -File 5,1,<..\lm3s\Libraries\driverlib\sysctl.c> -File 5,1,<..\lm3s\Libraries\driverlib\systick.c> -File 5,1,<..\lm3s\Libraries\driverlib\timer.c> -File 5,1,<..\lm3s\Libraries\driverlib\uart.c> -File 5,1,<..\lm3s\Libraries\driverlib\udma.c> -File 5,1,<..\lm3s\Libraries\driverlib\usb.c> -File 5,1,<..\lm3s\Libraries\driverlib\watchdog.c> +File 5,1,<..\..\components\net\lwip\src\api\api_lib.c> +File 5,1,<..\..\components\net\lwip\src\api\api_msg.c> +File 5,1,<..\..\components\net\lwip\src\api\err.c> +File 5,1,<..\..\components\net\lwip\src\api\netbuf.c> +File 5,1,<..\..\components\net\lwip\src\api\netdb.c> +File 5,1,<..\..\components\net\lwip\src\api\netifapi.c> +File 5,1,<..\..\components\net\lwip\src\api\sockets.c> +File 5,1,<..\..\components\net\lwip\src\api\tcpip.c> +File 5,1,<..\..\components\net\lwip\src\arch\sys_arch.c> +File 5,1,<..\..\components\net\lwip\src\arch\sys_arch_init.c> +File 5,1,<..\..\components\net\lwip\src\core\dhcp.c> +File 5,1,<..\..\components\net\lwip\src\core\dns.c> +File 5,1,<..\..\components\net\lwip\src\core\init.c> +File 5,1,<..\..\components\net\lwip\src\core\memp.c> +File 5,1,<..\..\components\net\lwip\src\core\netif.c> +File 5,1,<..\..\components\net\lwip\src\core\pbuf.c> +File 5,1,<..\..\components\net\lwip\src\core\raw.c> +File 5,1,<..\..\components\net\lwip\src\core\stats.c> +File 5,1,<..\..\components\net\lwip\src\core\sys.c> +File 5,1,<..\..\components\net\lwip\src\core\tcp.c> +File 5,1,<..\..\components\net\lwip\src\core\tcp_in.c> +File 5,1,<..\..\components\net\lwip\src\core\tcp_out.c> +File 5,1,<..\..\components\net\lwip\src\core\udp.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\autoip.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\icmp.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\igmp.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\inet.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\inet_chksum.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip_addr.c> +File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip_frag.c> +File 5,1,<..\..\components\net\lwip\src\netif\etharp.c> +File 5,1,<..\..\components\net\lwip\src\netif\ethernetif.c> +File 5,1,<..\..\components\net\lwip\src\netif\loopif.c> +File 5,1,<..\..\components\net\lwip\src\netif\slipif.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\asn1_dec.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\asn1_enc.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\mib2.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\mib_structs.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\msg_in.c> +File 5,1,<..\..\components\net\lwip\src\core\snmp\msg_out.c> +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, +File 6,1, Options 1,0,0 // Target 'RT-Thread-lm3s' @@ -123,18 +166,18 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' ADSFLGA { 243,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ACPUTYP ("Cortex-M3") RVDEV () - ADSTFLGA { 0,12,0,0,163,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0 } + ADSTFLGA { 0,12,0,2,163,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0 } OCMADSOCM { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } OCMADSIRAM { 0,0,0,0,32,0,128,1,0 } OCMADSIROM { 1,0,0,0,0,0,0,4,0 } OCMADSXRAM { 0,0,0,0,0,0,0,0,0 } OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,128,1,0,0,0,0,0,0,0,0,0,0 } RV_STAVEC () - ADSCCFLG { 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + ADSCCFLG { 13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSCMISC () ADSCDEFN () ADSCUDEF () - ADSCINCD (..\lm3s\Libraries\driverlib;..\..\libcpu\arm\lm3s;..\lm3s\Libraries\inc;.;..\..\include;..\..\libcpu\arm\common;..\lm3s\Libraries;..\..\components\finsh) + ADSCINCD (Libraries\inc;..\..\libcpu\arm\lm3s;..\..\components\net\lwip\src\include;Libraries\driverlib;.;..\..\components\net\lwip\src\include\ipv4;..\..\include;Libraries;..\..\components\net\lwip\src\arch\include;..\..\components\net\lwip\src;..\..\libcpu\arm\common;..\..\components\finsh;..\..\components\net\lwip\src\include\netif) ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSAMISC () ADSADEFN () @@ -160,9 +203,26 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' ADSLDDW () OPTDL (SARMCM3.DLL)()(DLM.DLL)(-pLM3S9B96)(SARMCM3.DLL)()(TLM.DLL)(-pLM3S9B96) OPTDBG 48118,4,()()()()()()()()()() (BIN\lmidk-agdi.dll)()()() - FLASH1 { 1,0,0,0,1,0,0,0,3,16,0,0,0,0,0,0,0,0,0,0 } + FLASH1 { 1,0,0,0,1,0,0,0,1,16,0,0,0,0,0,0,0,0,0,0 } FLASH2 (BIN\lmidk-agdi.dll) FLASH3 ("" ()) FLASH4 () EndOpt +Options 1,1,1 // File 'application.c' + PropFld { 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + IncBld=2 + AlwaysBuild=2 + GenAsm=2 + AsmAsm=2 + PublicsOnly=2 + StopCode=11 + CustArgs () + LibMods () + ADSCCFLG { 6,84,85,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + ADSCMISC () + ADSCDEFN () + ADSCUDEF () + ADSCINCD () +EndOpt + diff --git a/bsp/lm3s9b9x/rtconfig.h b/bsp/lm3s9b9x/rtconfig.h index 55f70606a..e14fba483 100644 --- a/bsp/lm3s9b9x/rtconfig.h +++ b/bsp/lm3s9b9x/rtconfig.h @@ -88,7 +88,7 @@ /* SECTION: lwip, a lighwight TCP/IP protocol stack */ /* Using lighweight TCP/IP protocol stack*/ -//#define RT_USING_LWIP +#define RT_USING_LWIP /* Trace LwIP protocol*/ /* #define RT_LWIP_DEBUG */ @@ -115,6 +115,7 @@ /* TCP sender buffer space*/ #define RT_LWIP_TCP_SND_BUF 1024*8 + /* Enable SNMP protocol*/ #define RT_LWIP_SNMP diff --git a/bsp/lm3s9b9x/startup.c b/bsp/lm3s9b9x/startup.c index 5f74e3e42..95a1d2fc4 100644 --- a/bsp/lm3s9b9x/startup.c +++ b/bsp/lm3s9b9x/startup.c @@ -15,8 +15,8 @@ #include #include -#include "board.h" - +#include "board.h" + #ifdef RT_USING_LWIP #include #include diff --git a/bsp/lm3s9b9x/template.Uv2 b/bsp/lm3s9b9x/template.Uv2 index 65b3dc124..f7b775b0b 100644 --- a/bsp/lm3s9b9x/template.Uv2 +++ b/bsp/lm3s9b9x/template.Uv2 @@ -60,7 +60,7 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' OCMADSXRAM { 0,0,0,0,0,0,0,0,0 } OCR_RVCT { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,128,1,0,0,0,0,0,0,0,0,0,0 } RV_STAVEC () - ADSCCFLG { 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + ADSCCFLG { 9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSCMISC () ADSCDEFN () ADSCUDEF () @@ -90,7 +90,7 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' ADSLDDW () OPTDL (SARMCM3.DLL)()(DLM.DLL)(-pLM3S9B96)(SARMCM3.DLL)()(TLM.DLL)(-pLM3S9B96) OPTDBG 48118,4,()()()()()()()()()() (BIN\lmidk-agdi.dll)()()() - FLASH1 { 1,0,0,0,1,0,0,0,3,16,0,0,0,0,0,0,0,0,0,0 } + FLASH1 { 1,0,0,0,1,0,0,0,1,16,0,0,0,0,0,0,0,0,0,0 } FLASH2 (BIN\lmidk-agdi.dll) FLASH3 ("" ()) FLASH4 ()