From 12887d54ceb2781194bc5104e596917ceaf6c946 Mon Sep 17 00:00:00 2001 From: luhuadong Date: Thu, 7 May 2020 20:45:54 +0800 Subject: [PATCH] [BSP] optimize dist handle according to #3582 --- bsp/stm32/stm32l412-st-nucleo/rtconfig.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bsp/stm32/stm32l412-st-nucleo/rtconfig.py b/bsp/stm32/stm32l412-st-nucleo/rtconfig.py index ab166e687d..ad5c811ba7 100644 --- a/bsp/stm32/stm32l412-st-nucleo/rtconfig.py +++ b/bsp/stm32/stm32l412-st-nucleo/rtconfig.py @@ -17,8 +17,7 @@ if os.getenv('RTT_ROOT'): # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - #EXEC_PATH = r'C:\Users\XXYYZZ' - EXEC_PATH = r'/home/rudy/opt/gcc-arm-none-eabi-7-2017-q4-major/bin/' + EXEC_PATH = r'C:\Users\XXYYZZ' elif CROSS_TOOL == 'keil': PLATFORM = 'armcc' EXEC_PATH = r'C:/Keil_v5' @@ -58,7 +57,7 @@ if PLATFORM == 'gcc': else: CFLAGS += ' -O2' - CXXFLAGS = CFLAGS + CXXFLAGS = CFLAGS POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' @@ -89,7 +88,7 @@ elif PLATFORM == 'armcc': else: CFLAGS += ' -O2' - CXXFLAGS = CFLAGS + CXXFLAGS = CFLAGS CFLAGS += ' -std=c99' POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' @@ -139,6 +138,13 @@ elif PLATFORM == 'iar': LFLAGS += ' --entry __iar_program_start' CXXFLAGS = CFLAGS - + EXEC_PATH = EXEC_PATH + '/arm/bin/' POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' + +def dist_handle(BSP_ROOT): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT)