From 9791a36d214803a5a0aa8c02bff3dd2b07b41628 Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Thu, 23 Jun 2011 01:20:27 +0000 Subject: [PATCH] update bsp lm3s_9b9x git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1528 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/lm3s_9b9x/SConscript | 2 +- bsp/lm3s_9b9x/board.c | 19 +++-- bsp/lm3s_9b9x/project.Uv2 | 140 +++++++++++++------------------------ bsp/lm3s_9b9x/rtconfig.h | 4 +- bsp/lm3s_9b9x/rtconfig.py | 2 +- bsp/lm3s_9b9x/template.Uv2 | 18 ++--- 6 files changed, 70 insertions(+), 115 deletions(-) diff --git a/bsp/lm3s_9b9x/SConscript b/bsp/lm3s_9b9x/SConscript index c48296330c..6422828c23 100644 --- a/bsp/lm3s_9b9x/SConscript +++ b/bsp/lm3s_9b9x/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'] +CPPPATH = [RTT_ROOT + '/bsp/lm3s_9b9x'] group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/bsp/lm3s_9b9x/board.c b/bsp/lm3s_9b9x/board.c index 56fa83f89b..7f9dbe95ce 100644 --- a/bsp/lm3s_9b9x/board.c +++ b/bsp/lm3s_9b9x/board.c @@ -37,7 +37,7 @@ static void rt_hw_console_init(void); extern void rt_hw_interrupt_thread_switch(void); /** * This is the timer interrupt service routine. - * + * */ void rt_hw_timer_handler(void) { @@ -45,7 +45,7 @@ void rt_hw_timer_handler(void) rt_interrupt_enter(); rt_tick_increase(); - + /* leave interrupt */ rt_interrupt_leave(); rt_hw_interrupt_thread_switch(); @@ -53,7 +53,7 @@ void rt_hw_timer_handler(void) /** * This is the ethernet interrupt service routine. - * + * */ void rt_hw_eth_handler(void) { @@ -61,7 +61,7 @@ void rt_hw_eth_handler(void) /* luminary ethernet interface */ extern void luminaryif_isr(void); luminaryif_isr(); -#endif +#endif } /** @@ -69,11 +69,8 @@ void rt_hw_eth_handler(void) */ void rt_hw_board_init() { - /* set ldo */ - SysCtlLDOSet(SYSCTL_LDO_2_50V); - /* set clock */ - SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | - LM3S_XTAL_TYPE); + // set sysclock to 80M + SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); /* init systick */ SysTickDisable(); @@ -82,8 +79,8 @@ void rt_hw_board_init() SysTickEnable(); /* enable ssio */ - SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); - + //SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); + /* init console */ rt_hw_console_init(); diff --git a/bsp/lm3s_9b9x/project.Uv2 b/bsp/lm3s_9b9x/project.Uv2 index 746a4a1fff..f023d0e3ec 100644 --- a/bsp/lm3s_9b9x/project.Uv2 +++ b/bsp/lm3s_9b9x/project.Uv2 @@ -6,16 +6,12 @@ Target (RT-Thread-lm3s), 0x0004 // Tools: 'ARM-ADS' Group (Startup) Group (Kernel) Group (LM3S) -Group (Filesystem) Group (finsh) -Group (LwIP) Group (library) File 1,1,<.\application.c> File 1,1,<.\startup.c> File 1,1,<.\board.c> -File 1,1,<.\sdcard.c> -File 1,1,<.\luminaryif.c> File 2,1,<..\..\src\clock.c> File 2,1,<..\..\src\device.c> File 2,1,<..\..\src\idle.c> @@ -42,90 +38,52 @@ File 3,2,<..\..\libcpu\arm\lm3s\start_rvds.S> File 3,1,<..\..\libcpu\arm\common\backtrace.c> File 3,1,<..\..\libcpu\arm\common\div0.c> File 3,1,<..\..\libcpu\arm\common\showmem.c> -File 4,1,<..\..\components\dfs\src\dfs.c> -File 4,1,<..\..\components\dfs\src\dfs_fs.c> -File 4,1,<..\..\components\dfs\src\dfs_file.c> -File 4,1,<..\..\components\dfs\src\dfs_posix.c> -File 4,1,<..\..\components\dfs\filesystems\elmfat\dfs_elm.c> -File 4,1,<..\..\components\dfs\filesystems\elmfat\ff.c> -File 5,1,<..\..\components\finsh\cmd.c> -File 5,1,<..\..\components\finsh\finsh_compiler.c> -File 5,1,<..\..\components\finsh\finsh_error.c> -File 5,1,<..\..\components\finsh\finsh_heap.c> -File 5,1,<..\..\components\finsh\finsh_init.c> -File 5,1,<..\..\components\finsh\finsh_node.c> -File 5,1,<..\..\components\finsh\finsh_ops.c> -File 5,1,<..\..\components\finsh\finsh_parser.c> -File 5,1,<..\..\components\finsh\finsh_token.c> -File 5,1,<..\..\components\finsh\finsh_var.c> -File 5,1,<..\..\components\finsh\finsh_vm.c> -File 5,1,<..\..\components\finsh\shell.c> -File 5,1,<..\..\components\finsh\symbol.c> -File 6,1,<..\..\components\net\lwip\src\api\api_lib.c> -File 6,1,<..\..\components\net\lwip\src\api\api_msg.c> -File 6,1,<..\..\components\net\lwip\src\api\err.c> -File 6,1,<..\..\components\net\lwip\src\api\netbuf.c> -File 6,1,<..\..\components\net\lwip\src\api\netdb.c> -File 6,1,<..\..\components\net\lwip\src\api\netifapi.c> -File 6,1,<..\..\components\net\lwip\src\api\sockets.c> -File 6,1,<..\..\components\net\lwip\src\api\tcpip.c> -File 6,1,<..\..\components\net\lwip\src\arch\sys_arch.c> -File 6,1,<..\..\components\net\lwip\src\arch\sys_arch_init.c> -File 6,1,<..\..\components\net\lwip\src\core\dhcp.c> -File 6,1,<..\..\components\net\lwip\src\core\dns.c> -File 6,1,<..\..\components\net\lwip\src\core\init.c> -File 6,1,<..\..\components\net\lwip\src\core\memp.c> -File 6,1,<..\..\components\net\lwip\src\core\netif.c> -File 6,1,<..\..\components\net\lwip\src\core\pbuf.c> -File 6,1,<..\..\components\net\lwip\src\core\raw.c> -File 6,1,<..\..\components\net\lwip\src\core\stats.c> -File 6,1,<..\..\components\net\lwip\src\core\sys.c> -File 6,1,<..\..\components\net\lwip\src\core\tcp.c> -File 6,1,<..\..\components\net\lwip\src\core\tcp_in.c> -File 6,1,<..\..\components\net\lwip\src\core\tcp_out.c> -File 6,1,<..\..\components\net\lwip\src\core\udp.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\autoip.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\icmp.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\igmp.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\inet.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\inet_chksum.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip_addr.c> -File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip_frag.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\asn1_dec.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\asn1_enc.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\mib2.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\mib_structs.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\msg_in.c> -File 6,1,<..\..\components\net\lwip\src\core\snmp\msg_out.c> -File 6,1,<..\..\components\net\lwip\src\netif\etharp.c> -File 6,1,<..\..\components\net\lwip\src\netif\ethernetif.c> -File 6,1,<..\..\components\net\lwip\src\netif\loopif.c> -File 6,1,<..\..\components\net\lwip\src\netif\slipif.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\auth.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\chap.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\chpms.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\fsm.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\ipcp.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\lcp.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\magic.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\md5.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\pap.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp_oe.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\randm.c> -File 6,1,<..\..\components\net\lwip\src\netif\ppp\vj.c> -File 7,4,<.\Libraries\driverlib\rvmdk\driverlib.lib> +File 4,1,<..\..\components\finsh\cmd.c> +File 4,1,<..\..\components\finsh\finsh_compiler.c> +File 4,1,<..\..\components\finsh\finsh_error.c> +File 4,1,<..\..\components\finsh\finsh_heap.c> +File 4,1,<..\..\components\finsh\finsh_init.c> +File 4,1,<..\..\components\finsh\finsh_node.c> +File 4,1,<..\..\components\finsh\finsh_ops.c> +File 4,1,<..\..\components\finsh\finsh_parser.c> +File 4,1,<..\..\components\finsh\finsh_token.c> +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> Options 1,0,0 // Target 'RT-Thread-lm3s' - Device (LM3S8962) + Device (LM3S9B96) Vendor (Luminary Micro) - Cpu (IRAM(0x20000000-0x2000FFFF) IROM(0-0x3FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3")) + Cpu (IRAM(0x20000000-0x20017FFF) IROM(0-0x3FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3")) FlashUt () StupF ("STARTUP\Luminary\Startup.s" ("Luminary Startup Code")) - FlashDR (UL2CM3(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_256 -FS00 -FL040000)) - DevID (4722) + FlashDR (UL2CM3(-UV2077N9E -O14 -S1 -C0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP7 -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_256 -FS00 -FL040000)) + DevID (4850) Rgf (LM3Sxxxx.H) Mem () C () @@ -140,17 +98,17 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' EnvBin () EnvInc () EnvLib () - EnvReg (˙Luminary\) - OrgReg (˙Luminary\) + EnvReg (Luminary\) + OrgReg (Luminary\) TgStat=16 - OutDir (.\) + OutDir (.\objs\) OutName (rtthread-lm3s) GenApp=1 GenLib=0 GenHex=0 Debug=1 Browse=1 - LstDir (.\) + LstDir (.\objs\) HexSel=1 MG32K=0 TGMORE=0 @@ -167,16 +125,16 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' RVDEV () ADSTFLGA { 0,12,0,0,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,0,1,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,0,1,0,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 } ADSCMISC () ADSCDEFN () ADSCUDEF () - ADSCINCD (Libraries\inc;..\..\include;..\..\libcpu\arm\lm3s;..\..\components\net\lwip\src\include;Libraries\driverlib;.;..\..\components\net\lwip\src\include\ipv4;..\..\components\dfs;Libraries;..\..\components\net\lwip\src\arch\include;..\..\components\dfs\include;..\..\components\net\lwip\src;..\..\libcpu\arm\common;..\..\components\net\lwip\src\netif\ppp;..\..\components\finsh;..\..\components\net\lwip\src\include\netif) + ADSCINCD (..\lm3s\Libraries\driverlib;..\..\libcpu\arm\lm3s;..\lm3s\Libraries\inc;.;..\..\include;..\..\libcpu\arm\common;..\lm3s\Libraries;..\..\components\finsh) ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } ADSAMISC () ADSADEFN () @@ -197,10 +155,10 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' ADSLDSC () ADSLDIB () ADSLDIC () - ADSLDMC ( --keep __fsym_* --keep __vsym_*) + ADSLDMC ( --keep __fsym_* --keep __vsym_* ) ADSLDIF () ADSLDDW () - OPTDL (SARMCM3.DLL)()(DLM.DLL)(-pLM3S8962)(SARMCM3.DLL)()(TLM.DLL)(-pLM3S8962) + 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 } FLASH2 (BIN\lmidk-agdi.dll) diff --git a/bsp/lm3s_9b9x/rtconfig.h b/bsp/lm3s_9b9x/rtconfig.h index c4158624d4..55f70606a4 100644 --- a/bsp/lm3s_9b9x/rtconfig.h +++ b/bsp/lm3s_9b9x/rtconfig.h @@ -74,7 +74,7 @@ #define FINSH_USING_SYMTAB #define FINSH_USING_DESCRIPTION -#define RT_USING_DFS +//#define RT_USING_DFS /* SECTION: DFS options */ #define RT_USING_DFS_ELMFAT #define RT_DFS_ELM_WORD_ACCESS @@ -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 */ diff --git a/bsp/lm3s_9b9x/rtconfig.py b/bsp/lm3s_9b9x/rtconfig.py index 52d3b71b4e..1fdb67c4bb 100644 --- a/bsp/lm3s_9b9x/rtconfig.py +++ b/bsp/lm3s_9b9x/rtconfig.py @@ -1,7 +1,7 @@ # toolchains options ARCH='arm' CPU='lm3s' -CROSS_TOOL = 'gcc' +CROSS_TOOL = 'keil' if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' diff --git a/bsp/lm3s_9b9x/template.Uv2 b/bsp/lm3s_9b9x/template.Uv2 index a46bbe6f4c..65b3dc1245 100644 --- a/bsp/lm3s_9b9x/template.Uv2 +++ b/bsp/lm3s_9b9x/template.Uv2 @@ -7,14 +7,14 @@ Target (RT-Thread-lm3s), 0x0004 // Tools: 'ARM-ADS' Options 1,0,0 // Target 'RT-Thread-lm3s' - Device (LM3S8962) + Device (LM3S9B96) Vendor (Luminary Micro) - Cpu (IRAM(0x20000000-0x2000FFFF) IROM(0-0x3FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3")) + Cpu (IRAM(0x20000000-0x20017FFF) IROM(0-0x3FFFF) CLOCK(8000000) CPUTYPE("Cortex-M3")) FlashUt () StupF ("STARTUP\Luminary\Startup.s" ("Luminary Startup Code")) - FlashDR (UL2CM3(-UU0101L5E -O14 -S0 -C0 -N00("ARM Cortex-M3") -D00(1BA00477) -L00(4) -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_256 -FS00 -FL040000)) - DevID (4285) - Rgf (LM3Sxxx.H) + FlashDR (UL2CM3(-UV2077N9E -O14 -S1 -C0 -N00("ARM CoreSight JTAG-DP") -D00(3BA00477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP7 -FO7 -FD20000000 -FC800 -FN1 -FF0LM3S_256 -FS00 -FL040000)) + DevID (4850) + Rgf (LM3Sxxxx.H) Mem () C () A () @@ -55,10 +55,10 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' RVDEV () ADSTFLGA { 0,12,0,0,160,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,0,1,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,0,1,0,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 } ADSCMISC () @@ -88,11 +88,11 @@ Options 1,0,0 // Target 'RT-Thread-lm3s' ADSLDMC () ADSLDIF () ADSLDDW () - OPTDL (SARMCM3.DLL)()(DLM.DLL)(-pLM3S8962)(SARMCM3.DLL)()(TLM.DLL)(-pLM3S8962) + 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 } FLASH2 (BIN\lmidk-agdi.dll) - FLASH3 () + FLASH3 ("" ()) FLASH4 () EndOpt