summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-11-22 07:21:28 +0000
committer[email protected] <[email protected]>2010-11-22 07:21:28 +0000
commit913a4edfb38380be12390714be54992d0e36f0b2 (patch)
treee4ed6f209a0fde3835b3198bb8449a4b4b6bfe54
parent8abbd3996233ded995ddc2c28f7878239083347a (diff)
add scons script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1089 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--bsp/lpc2478/SConscript18
-rw-r--r--bsp/lpc2478/SConstruct51
-rw-r--r--bsp/lpc2478/rtconfig.py68
-rw-r--r--bsp/lpc2478/template.Uv298
4 files changed, 160 insertions, 75 deletions
diff --git a/bsp/lpc2478/SConscript b/bsp/lpc2478/SConscript
new file mode 100644
index 0000000000..5d3d95124c
--- /dev/null
+++ b/bsp/lpc2478/SConscript
@@ -0,0 +1,18 @@
+import rtconfig
+Import('RTT_ROOT')
+from building import *
+
+src_bsp = ['application.c', 'startup.c', 'board.c']
+src_drv = []
+
+if GetDepend('RT_USING_DFS'):
+ src_drv += ['sd.c', 'spi.c']
+
+if GetDepend('RT_USING_LWIP'):
+ src_drv += ['emac.c']
+
+src = File(src_bsp + src_drv)
+CPPPATH = [RTT_ROOT + '/bsp/lpc2478']
+group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/bsp/lpc2478/SConstruct b/bsp/lpc2478/SConstruct
index 31320af88d..760c3bbdac 100644
--- a/bsp/lpc2478/SConstruct
+++ b/bsp/lpc2478/SConstruct
@@ -1,11 +1,12 @@
import os
+import sys
import rtconfig
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
-target = 'rtthread-lpc2478'
+sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
+from building import *
-# search path for C compiler
-bsp_path = RTT_ROOT + '/bsp/lpc2478'
+TARGET = 'rtthread-lpc2478.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
@@ -13,44 +14,24 @@ env = Environment(tools = ['mingw'],
AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
-env.AppendUnique(CPPPATH = bsp_path)
-env.AppendUnique(CCFLAGS = ' -DUSE_STDPERIPH_DRIVER -DSTM32F10X_HD')
-Export('env')
Export('RTT_ROOT')
Export('rtconfig')
-objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
-objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
+# prepare building environment
+objs = PrepareBuilding(env, RTT_ROOT)
-if rtconfig.RT_USING_MINILIBC:
- objs = objs + SConscript(RTT_ROOT + '/libc/minilibc/SConscript', variant_dir='build/minilibc', duplicate=0)
+if GetDepend('RT_USING_WEBSERVER'):
+ objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
-if rtconfig.RT_USING_FINSH:
- objs = objs + SConscript(RTT_ROOT + '/finsh/SConscript', variant_dir='build/finsh', duplicate=0)
+if GetDepend('RT_USING_RTGUI'):
+ objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
-if rtconfig.RT_USING_DFS:
- objs = objs + SConscript(RTT_ROOT + '/filesystem/dfs/SConscript', variant_dir='build/filesystem', duplicate=0)
+# libc testsuite
+# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
-if rtconfig.RT_USING_LWIP:
- objs = objs + SConscript(RTT_ROOT + '/net/lwip/SConscript', variant_dir='build/net/lwip', duplicate=0)
-
-if rtconfig.RT_USING_RTGUI:
- objs = objs + SConscript(RTT_ROOT + '/rtgui/SConscript', variant_dir='build/rtgui', duplicate=0)
-
-src_bsp = ['application.c', 'startup.c', 'board.c' ]
-
-if rtconfig.RT_USING_DFS:
- src_drv += ['sdcard.c']
-
-if rtconfig.RT_USING_LWIP:
- src_drv += ['dm9000.c']
-
-if rtconfig.RT_USING_RTGUI:
- src_drv += ['touch.c']
-
-objs = objs + env.Object(src_bsp )
-
-TARGET = target + '.' + rtconfig.TARGET_EXT
+# build program
env.Program(TARGET, objs)
-env.AddPostAction(TARGET, rtconfig.POST_ACTION)
+
+# end building
+EndBuilding(TARGET)
diff --git a/bsp/lpc2478/rtconfig.py b/bsp/lpc2478/rtconfig.py
index 2436877433..0212b401a4 100644
--- a/bsp/lpc2478/rtconfig.py
+++ b/bsp/lpc2478/rtconfig.py
@@ -1,29 +1,15 @@
-# component options
-
-# finsh shell option
-RT_USING_FINSH = True
-
-# device file system options
-RT_USING_DFS = False
-RT_USING_DFS_EFSL = False
-RT_USING_DFS_ELMFAT = False
-RT_USING_DFS_YAFFS2 = False
-
-# lwip options
-RT_USING_LWIP = False
-
-# rtgui options
-RT_USING_RTGUI = False
-
# toolchains options
ARCH='arm'
-CPU='lpc24xx'
-TextBase='0x30000000'
+CPU='lpc2478'
+CROSS_TOOL='keil'
+
+if CROSS_TOOL == 'gcc':
+ PLATFORM = 'gcc'
+ EXEC_PATH = 'D:/SourceryGCC/bin'
+elif CROSS_TOOL == 'keil':
+ PLATFORM = 'armcc'
+ EXEC_PATH = 'd:/Keil'
-#PLATFORM = 'gcc'
-#EXEC_PATH = 'd:/SourceryGCC/bin'
-PLATFORM = 'armcc'
-EXEC_PATH = 'd:/Keil'
BUILD = 'debug'
if PLATFORM == 'gcc':
@@ -33,15 +19,15 @@ if PLATFORM == 'gcc':
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc'
- TARGET_EXT = 'elf'
+ TARGET_EXT = 'axf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
- DEVICE = ' -mcpu=arm920t'
+ DEVICE = ' -mcpu=ARM7TDMI'
CFLAGS = DEVICE + ' -DRT_USING_MINILIBC'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
- LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=main.elf.map,-cref,-u,Reset_Handler -T mini2440_rom.ld'
+ LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-lpc2478.map,-cref,-u,Reset_Handler -T lpc2478_rom.ld'
CPATH = ''
LPATH = ''
@@ -52,7 +38,6 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
- RT_USING_MINILIBC = True
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc':
@@ -63,14 +48,13 @@ elif PLATFORM == 'armcc':
LINK = 'armlink'
TARGET_EXT = 'axf'
- DEVICE = ' --device DARMP'
+ DEVICE = ' --device DARMSTM'
CFLAGS = DEVICE + ' --apcs=interwork'
AFLAGS = DEVICE
- LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtt-lpc2478.map --strict --scatter ".\objs\lpc2478.sct"t'
+ LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread-lpc2478.map --scatter lpc2478_rom.sct'
- CFLAGS += ' -I"' + EXEC_PATH + '/ARM/RV31/INC"'
- CFLAGS += ' -I"' + EXEC_PATH + '/ARM/INC/Philips"'
- LFLAGS += ' --libpath "' + EXEC_PATH + '/ARM/RV31/LIB"'
+ CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
+ LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB'
EXEC_PATH += '/arm/bin40/'
@@ -80,18 +64,22 @@ elif PLATFORM == 'armcc':
else:
CFLAGS += ' -O2'
- RT_USING_MINILIBC = False
- if RT_USING_FINSH:
- LFLAGS += ' --keep __fsym_* --keep __vsym_*'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar':
# toolchains
- CC = 'armcc'
- AS = 'armasm'
- AR = 'armar'
- LINK = 'armlink'
+ CC = 'iccarm'
+ AS = 'iasmarm'
+ AR = 'iarchive'
+ LINK = 'ilinkarm'
+ TARGET_EXT = 'out'
+
+ DEVICE = ' --cpu DARMSTM --thumb'
CFLAGS = ''
AFLAGS = ''
- LFLAGS = ''
+ LFLAGS = ' --config lpc24xx_flash.icf'
+
+ EXEC_PATH += '/arm/bin/'
+ RT_USING_MINILIBC = False
+ POST_ACTION = ''
diff --git a/bsp/lpc2478/template.Uv2 b/bsp/lpc2478/template.Uv2
new file mode 100644
index 0000000000..6333bdeb3b
--- /dev/null
+++ b/bsp/lpc2478/template.Uv2
@@ -0,0 +1,98 @@
+### uVision2 Project, (C) Keil Software
+### Do not modify !
+
+Target (RT-Thread LPC2478), 0x0004 // Tools: 'ARM-ADS'
+
+
+
+
+Options 1,0,0 // Target 'RT-Thread LPC2478'
+ Device (LPC2478)
+ Vendor (NXP (founded by Philips))
+ Cpu (IRAM(0x40000000-0x4000FFFF) IRAM2(0x7FE00000-0x7FE03FFF) IROM(0-0x7FFFF) CLOCK(12000000) CPUTYPE(ARM7TDMI))
+ FlashUt (LPC210x_ISP.EXE ("#H" ^X $D COM1: 38400 1))
+ StupF ("STARTUP\Philips\LPC2400.s" ("Philips LPC2400 Startup Code"))
+ FlashDR (UL2ARM(-U268761108 -O7 -S0 -C0 -FO15 -FD40000000 -FC800 -FN1 -FF0LPC_IAP2_512 -FS00 -FL07E000))
+ DevID (4307)
+ Rgf (LPC23xx.H)
+ Mem ()
+ C ()
+ A ()
+ RL ()
+ OH ()
+ DBC_IFX ()
+ DBC_CMS ()
+ DBC_AMS ()
+ DBC_LMS ()
+ UseEnv=0
+ EnvBin ()
+ EnvInc ()
+ EnvLib ()
+ EnvReg (Philips\)
+ OrgReg (Philips\)
+ TgStat=16
+ OutDir (.\obj\)
+ OutName (rtthread-lpc)
+ GenApp=1
+ GenLib=0
+ GenHex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Asm=0
+ AsmAsm=0
+ PublicsOnly=0
+ StopCode=3
+ CustArgs ()
+ LibMods ()
+ ADSLDFG { 17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
+ ADSLDTA (0x00000000)
+ ADSLDDA (0x10000000)
+ ADSLDSC ()
+ ADSLDIB ()
+ ADSLDIC ()
+ ADSLDMC ()
+ ADSLDIF ()
+ ADSLDDW ()
+ OPTDL (SARM.DLL)(-cLPC24xx)(DARMP.DLL)(-pLPC2478)(SARM.DLL)()(TARMP.DLL)(-pLPC2478)
+ OPTDBG 48126,7,()()()()()()()()()() (Segger\JL2CM3.dll)()()()
+ FLASH1 { 9,0,0,0,1,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0 }
+ FLASH2 (BIN\UL2ARM.DLL)
+ FLASH3 ("LPC210x_ISP.EXE" ("#H" ^X $D COM1: 38400 1))
+ FLASH4 ()
+EndOpt
+