diff --git a/bsp/lpc54608-LPCXpresso/SConstruct b/bsp/lpc54608-LPCXpresso/SConstruct index fb728723b..a2d74ca04 100644 --- a/bsp/lpc54608-LPCXpresso/SConstruct +++ b/bsp/lpc54608-LPCXpresso/SConstruct @@ -12,12 +12,23 @@ from building import * TARGET = 'rtthread-%s.%s' % (rtconfig.BOARD_NAME, rtconfig.TARGET_EXT) -env = Environment(tools = ['mingw'], - AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, - CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, - CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, - AR = rtconfig.AR, ARFLAGS = '-rc', - LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) +if rtconfig.PLATFORM == 'armcc': + env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS, + # overwrite cflags, because cflags has '--C99' + CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES') +else: + env = Environment(tools = ['mingw'], + AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS, + CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS, + CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS, + AR = rtconfig.AR, ARFLAGS = '-rc', + LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) + env.PrependENVPath('PATH', rtconfig.EXEC_PATH) Export('RTT_ROOT') diff --git a/bsp/lpc54608-LPCXpresso/rtconfig.py b/bsp/lpc54608-LPCXpresso/rtconfig.py index 2a89817b8..a173ba289 100644 --- a/bsp/lpc54608-LPCXpresso/rtconfig.py +++ b/bsp/lpc54608-LPCXpresso/rtconfig.py @@ -16,9 +16,9 @@ elif CROSS_TOOL == 'keil': PLATFORM = 'armcc' EXEC_PATH = 'D:/Keil_v5' elif CROSS_TOOL == 'iar': - print '================ERROR============================' - print 'Not support iar yet!' - print '=================================================' + print('================ERROR============================') + print('Not support iar yet!') + print('=================================================') exit(0) if os.getenv('RTT_EXEC_PATH'): @@ -70,12 +70,11 @@ elif PLATFORM == 'armcc': CFLAGS = DEVICE + ' --apcs=interwork' AFLAGS = DEVICE LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread_' + \ - BOARD_NAME + '.map --scatter rtthread-' + BOARD_NAME + '.sct' + BOARD_NAME + '.map --scatter LPC54608J512_flash.scf' CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC' LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB' - CXXFLAGS = CFLAGS - + EXEC_PATH += '/arm/bin40/' if BUILD == 'debug': @@ -83,5 +82,8 @@ elif PLATFORM == 'armcc': AFLAGS += ' -g' else: CFLAGS += ' -O2' - + + CXXFLAGS = CFLAGS + CFLAGS += ' --c99' + POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'