[BSP] TM4C129X: Modify rtconfig.py to support compile from IAR-SCONS
This commit is contained in:
parent
ab33cd3110
commit
45645be9d2
|
@ -16,8 +16,9 @@ elif rtconfig.CROSS_TOOL == 'iar':
|
||||||
src += ['startup/startup_ewarm.c']
|
src += ['startup/startup_ewarm.c']
|
||||||
|
|
||||||
CPPPATH = [cwd, cwd + '/inc', cwd + '/driverlib']
|
CPPPATH = [cwd, cwd + '/inc', cwd + '/driverlib']
|
||||||
|
CCFLAGS = ' --diag_suppress=pe177'
|
||||||
|
|
||||||
CPPDEFINES = [rtconfig.PART_TYPE]
|
CPPDEFINES = [rtconfig.PART_TYPE]
|
||||||
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, CCFLAGS = CCFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D)
|
# BSP Note: For TI EK-TM4C1294XL Tiva C Series Connected LancuhPad (REV D)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -8,26 +8,24 @@ CPU='cortex-m4'
|
||||||
CROSS_TOOL='keil'
|
CROSS_TOOL='keil'
|
||||||
|
|
||||||
if os.getenv('RTT_CC'):
|
if os.getenv('RTT_CC'):
|
||||||
CROSS_TOOL = os.getenv('RTT_CC')
|
CROSS_TOOL = os.getenv('RTT_CC')
|
||||||
|
|
||||||
#device options
|
#device options
|
||||||
PART_TYPE = 'PART_TM4C129XNCZAD'
|
PART_TYPE = 'PART_TM4C129XNCZAD'
|
||||||
# cross_tool provides the cross compiler
|
# cross_tool provides the cross compiler
|
||||||
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
|
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
|
||||||
if CROSS_TOOL == 'gcc':
|
if CROSS_TOOL == 'gcc':
|
||||||
PLATFORM = 'gcc'
|
PLATFORM = 'gcc'
|
||||||
EXEC_PATH = r'D:\ArdaArmTools\Sourcery_Lite\bin'
|
EXEC_PATH = r'D:\ArdaArmTools\Sourcery_Lite\bin'
|
||||||
elif CROSS_TOOL == 'keil':
|
elif CROSS_TOOL == 'keil':
|
||||||
PLATFORM = 'armcc'
|
PLATFORM = 'armcc'
|
||||||
EXEC_PATH = r'D:\Keil_v5'
|
EXEC_PATH = r'C:\Keil_v5'
|
||||||
elif CROSS_TOOL == 'iar':
|
elif CROSS_TOOL == 'iar':
|
||||||
print('================ERROR============================')
|
PLATFORM = 'iar'
|
||||||
print('Not support iar yet!')
|
EXEC_PATH = 'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
|
||||||
print('=================================================')
|
|
||||||
exit(0)
|
|
||||||
|
|
||||||
if os.getenv('RTT_EXEC_PATH'):
|
if os.getenv('RTT_EXEC_PATH'):
|
||||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||||
|
|
||||||
#BUILD = 'debug'
|
#BUILD = 'debug'
|
||||||
BUILD = 'release'
|
BUILD = 'release'
|
||||||
|
@ -43,7 +41,7 @@ if PLATFORM == 'gcc':
|
||||||
SIZE = PREFIX + 'size'
|
SIZE = PREFIX + 'size'
|
||||||
OBJDUMP = PREFIX + 'objdump'
|
OBJDUMP = PREFIX + 'objdump'
|
||||||
OBJCPY = PREFIX + 'objcopy'
|
OBJCPY = PREFIX + 'objcopy'
|
||||||
|
|
||||||
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections'
|
DEVICE = ' -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -ffunction-sections -fdata-sections'
|
||||||
CFLAGS = DEVICE + ' -std=c99 -Dgcc'
|
CFLAGS = DEVICE + ' -std=c99 -Dgcc'
|
||||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
|
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
|
||||||
|
@ -75,7 +73,7 @@ elif PLATFORM == 'armcc':
|
||||||
|
|
||||||
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCC/INC'
|
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCC/INC'
|
||||||
LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/ARMCC/LIB'
|
LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/ARMCC/LIB'
|
||||||
|
|
||||||
EXEC_PATH += '/arm/armcc/bin/'
|
EXEC_PATH += '/arm/armcc/bin/'
|
||||||
|
|
||||||
if BUILD == 'debug':
|
if BUILD == 'debug':
|
||||||
|
@ -85,3 +83,51 @@ elif PLATFORM == 'armcc':
|
||||||
CFLAGS += ' -O2'
|
CFLAGS += ' -O2'
|
||||||
|
|
||||||
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
|
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
|
||||||
|
|
||||||
|
elif PLATFORM == 'iar':
|
||||||
|
# toolchains
|
||||||
|
CC = 'iccarm'
|
||||||
|
AS = 'iasmarm'
|
||||||
|
AR = 'iarchive'
|
||||||
|
LINK = 'ilinkarm'
|
||||||
|
TARGET_EXT = 'out'
|
||||||
|
|
||||||
|
DEVICE = '-Dewarm' # + ' -D' + PART_TYPE
|
||||||
|
|
||||||
|
CFLAGS = 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 += ' --cpu=Cortex-M4'
|
||||||
|
CFLAGS += ' -e'
|
||||||
|
CFLAGS += ' --fpu=VFPv4_sp'
|
||||||
|
CFLAGS += ' --dlib_config "' + EXEC_PATH + '/arm/INC/c/DLib_Config_Normal.h"'
|
||||||
|
CFLAGS += ' --silent'
|
||||||
|
|
||||||
|
AFLAGS = DEVICE
|
||||||
|
AFLAGS += ' -s+'
|
||||||
|
AFLAGS += ' -w+'
|
||||||
|
AFLAGS += ' -r'
|
||||||
|
AFLAGS += ' --cpu Cortex-M4'
|
||||||
|
AFLAGS += ' --fpu VFPv4_sp'
|
||||||
|
AFLAGS += ' -S'
|
||||||
|
|
||||||
|
if BUILD == 'debug':
|
||||||
|
CFLAGS += ' --debug'
|
||||||
|
CFLAGS += ' -On'
|
||||||
|
else:
|
||||||
|
CFLAGS += ' -Oh'
|
||||||
|
|
||||||
|
LFLAGS = ' --config "tm4c_rom.icf"'
|
||||||
|
LFLAGS += ' --entry __iar_program_start'
|
||||||
|
#LFLAGS += ' --silent'
|
||||||
|
|
||||||
|
EXEC_PATH = EXEC_PATH + '/arm/bin/'
|
||||||
|
POST_ACTION = ''
|
Loading…
Reference in New Issue