summaryrefslogtreecommitdiff
path: root/bsp/at91sam9260/rtconfig.py
diff options
context:
space:
mode:
authorardafu <[email protected]>2015-04-15 16:08:43 +0800
committerardafu <[email protected]>2015-04-15 16:13:30 +0800
commit6aa242645fc55cc776cfb1e87414e70037ecdd43 (patch)
tree8491a95bb13e247a4d4f6e159b9a5dfc2121fdc8 /bsp/at91sam9260/rtconfig.py
parentf435a214d4617a9acc98033c571c5dc14dcf6b97 (diff)
1. [bsp][sam9260] Fix the bug that auto reset after boot 20s. Disable watchdog in rt_lovel_level_init function.
2. [bsp][sam9260] Modify SCONS scripts to support IAR tool chain. 3. [bsp][sam9260] Move link strips in to folder link_scripts. 4. [libcpu][arm926] Add copy right to source file and format code.
Diffstat (limited to 'bsp/at91sam9260/rtconfig.py')
-rwxr-xr-xbsp/at91sam9260/rtconfig.py101
1 files changed, 78 insertions, 23 deletions
diff --git a/bsp/at91sam9260/rtconfig.py b/bsp/at91sam9260/rtconfig.py
index c75d864741..f7fff9fd3e 100755
--- a/bsp/at91sam9260/rtconfig.py
+++ b/bsp/at91sam9260/rtconfig.py
@@ -1,27 +1,23 @@
import os
-
-# toolchains options
ARCH = 'arm'
CPU = 'arm926'
-TextBase = '0x20000000'
-
-CROSS_TOOL = 'gcc'
+# toolchains options
+CROSS_TOOL = 'iar'
+#------- toolchains path -------------------------------------------------------
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
- #EXEC_PATH = 'D:/ArdaArmTools/Sourcery_Lite/bin'
- EXEC_PATH = 'D:/ArdaArmTools/GNUARM_4.9_2015q1/bin'
+ #EXEC_PATH = 'D:/ArdaArmTools/Sourcery_Lite'
+ EXEC_PATH = 'D:/ArdaArmTools/GNUARM_4.9_2015q1'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PATH = 'C:/Keil_v5'
elif CROSS_TOOL == 'iar':
- print '================ERROR============================'
- print 'Not support yet!'
- print '================================================='
- exit(0)
+ PLATFORM = 'iar'
+ IAR_PATH = 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.0'
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
@@ -29,6 +25,12 @@ if os.getenv('RTT_EXEC_PATH'):
#BUILD = 'debug'
BUILD = 'release'
+CORE = 'arm926ej-s'
+MAP_FILE = 'rtthread_at91sam9260.map'
+LINK_FILE = 'link_scripts/at91sam9260_ram'
+TARGET_NAME = 'rtthread.bin'
+
+#------- GCC settings ----------------------------------------------------------
if PLATFORM == 'gcc':
# toolchains
PREFIX = 'arm-none-eabi-'
@@ -41,11 +43,15 @@ if PLATFORM == 'gcc':
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
+ EXEC_PATH += '/bin/'
DEVICE = ' -mcpu=arm926ej-s'
CFLAGS = DEVICE
- AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' + ' -Iplatform'+' -DTEXT_BASE=' + TextBase
- LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread_at91sam9260.map,-cref,-u,_start -T at91sam9260_ram.ld' + ' -Ttext ' + TextBase
+ AFLAGS = '-c'+ DEVICE + ' -x assembler-with-cpp'
+ AFLAGS += ' -Iplatform'
+ LFLAGS = DEVICE
+ LFLAGS += ' -Wl,--gc-sections,-cref,-Map=' + MAP_FILE
+ LFLAGS += ' -T ' + LINK_FILE + '.ld'
CPATH = ''
LPATH = ''
@@ -56,8 +62,9 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
- POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
-
+ POST_ACTION = OBJCPY + ' -O binary $TARGET ' + TARGET_NAME + '\n'
+ POST_ACTION += SIZE + ' $TARGET\n'
+#------- Keil settings ---------------------------------------------------------
elif PLATFORM == 'armcc':
# toolchains
CC = 'armcc'
@@ -65,16 +72,15 @@ elif PLATFORM == 'armcc':
AR = 'armar'
LINK = 'armlink'
TARGET_EXT = 'axf'
+ EXEC_PATH += '/arm/armcc/bin/'
- DEVICE = ' --cpu=ARM926EJ-S'
+ DEVICE = ' --cpu=' + CORE
CFLAGS = DEVICE + ' --apcs=interwork --diag_suppress=870'
AFLAGS = DEVICE + ' -Iplatform'
- LFLAGS = DEVICE + ' --strict --info sizes --info totals --info unused --info veneers --list rtthread-at91sam9260.map --ro-base 0x20000000 --entry Entry_Point --first Entry_Point'
-
- CFLAGS += ' -I"' + EXEC_PATH + '/ARM/RV31/INC"'
- LFLAGS += ' --libpath "' + EXEC_PATH + '/ARM/RV31/LIB"'
-
- EXEC_PATH += '/arm/bin40/'
+ LFLAGS = DEVICE + ' --strict'
+ LFLAGS += ' --info sizes --info totals --info unused --info veneers'
+ LFLAGS += ' --list ' + MAP_FILE
+ LFLAGS += ' --scatter ' + LINK_FILE + '.scat'
if BUILD == 'debug':
CFLAGS += ' -g -O0'
@@ -82,4 +88,53 @@ elif PLATFORM == 'armcc':
else:
CFLAGS += ' -O2'
- POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
+ POST_ACTION = 'fromelf --bin $TARGET --output ' + TARGET_NAME + ' \n'
+ POST_ACTION += 'fromelf -z $TARGET\n'
+#------- IAR settings ----------------------------------------------------------
+elif PLATFORM == 'iar':
+ # toolchains
+ CC = 'iccarm'
+ AS = 'iasmarm'
+ AR = 'iarchive'
+ LINK = 'ilinkarm'
+ TARGET_EXT = 'out'
+
+ DEVICE = CORE
+
+ CFLAGS = '--cpu=' + DEVICE
+ CFLAGS += ' --diag_suppress Pa050'
+ CFLAGS += ' --no_cse'
+ CFLAGS += ' --no_unroll'
+ CFLAGS += ' --no_inline'
+ CFLAGS += ' --no_code_motion'
+ CFLAGS += ' --no_tbaa'
+ CFLAGS += ' --no_clustering'
+ CFLAGS += ' --no_scheduling'
+
+ CFLAGS += ' --endian=little'
+ CFLAGS += ' -e'
+ CFLAGS += ' --fpu=none'
+ CFLAGS += ' --dlib_config "' + IAR_PATH + '/arm/INC/c/DLib_Config_Normal.h"'
+ CFLAGS += ' --silent'
+
+ AFLAGS = '--cpu '+ DEVICE
+ AFLAGS += ' -s+'
+ AFLAGS += ' -w+'
+ AFLAGS += ' -r'
+ AFLAGS += ' --fpu none'
+ AFLAGS += ' -S'
+ AFLAGS += ' -Iplatform'
+
+ if BUILD == 'debug':
+ CFLAGS += ' --debug'
+ CFLAGS += ' -On'
+ else:
+ CFLAGS += ' -Oh'
+
+ LFLAGS = '--config ' + LINK_FILE +'.icf'
+ LFLAGS += ' --entry __iar_program_start'
+ LFLAGS += ' --map ' + MAP_FILE
+ LFLAGS += ' --silent'
+
+ EXEC_PATH = IAR_PATH + '/arm/bin/'
+ POST_ACTION = 'ielftool --silent --bin $TARGET ' + TARGET_NAME