From 2b7600bdf3ed3a00e191e873f21f59419860d981 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Tue, 20 Jan 2015 15:52:39 +0800 Subject: [PATCH] [BSP] update MDK project file for STM32F4 --- bsp/stm32f40x/SConstruct | 7 +- bsp/stm32f40x/project.uvproj | 378 ++++++++++++++++++++--------------- bsp/stm32f40x/rtconfig.py | 10 +- 3 files changed, 226 insertions(+), 169 deletions(-) diff --git a/bsp/stm32f40x/SConstruct b/bsp/stm32f40x/SConstruct index a58e07aa4b..99c2876aab 100644 --- a/bsp/stm32f40x/SConstruct +++ b/bsp/stm32f40x/SConstruct @@ -8,7 +8,12 @@ else: RTT_ROOT = os.path.normpath(os.getcwd() + '/../..') sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')] -from building import * +try: + from building import * +except: + print 'Cannot found RT-Thread root directory, please check RTT_ROOT' + print RTT_ROOT + exit(-1) TARGET = 'rtthread-stm32f4xx.' + rtconfig.TARGET_EXT diff --git a/bsp/stm32f40x/project.uvproj b/bsp/stm32f40x/project.uvproj index a2734d98af..85c434a0e9 100644 --- a/bsp/stm32f40x/project.uvproj +++ b/bsp/stm32f40x/project.uvproj @@ -343,7 +343,7 @@ USE_STDPERIPH_DRIVER - .;..\..\components\finsh;..\..\include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m4;Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x;Libraries\CMSIS\Include;Libraries\CMSIS\ST\STM32F4xx\Include;Libraries\STM32F4xx_StdPeriph_Driver\inc;applications;drivers + applications;.;Libraries/STM32F4xx_StdPeriph_Driver/inc;Libraries/CMSIS/ST/STM32F4xx/Include;Libraries/CMSIS/Include;drivers;../../include;../../libcpu/arm/cortex-m4;../../libcpu/arm/common;../../components/finsh;../../components/drivers/include;../../components/drivers/include;../../components/drivers/include @@ -386,45 +386,14 @@ application.c 1 - applications\application.c + applications/application.c startup.c 1 - applications\startup.c - - - - - Drivers - - - board.c - 1 - drivers\board.c - - - - - serial.c - 1 - drivers\serial.c - - - - - stm32f4xx_it.c - 1 - drivers\stm32f4xx_it.c - - - - - usart.c - 1 - drivers\usart.c + applications/startup.c @@ -434,231 +403,255 @@ system_stm32f4xx.c 1 - Libraries\CMSIS\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c + Libraries/CMSIS/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c misc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/misc.c stm32f4xx_adc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_adc.c stm32f4xx_can.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_can.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_can.c stm32f4xx_crc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_crc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_crc.c stm32f4xx_cryp.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c stm32f4xx_cryp_aes.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_aes.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_aes.c stm32f4xx_cryp_des.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_des.c stm32f4xx_cryp_tdes.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_tdes.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp_tdes.c stm32f4xx_dac.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dac.c stm32f4xx_dbgmcu.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dbgmcu.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c stm32f4xx_dcmi.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dcmi.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dcmi.c stm32f4xx_dma.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c stm32f4xx_exti.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c stm32f4xx_flash.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c stm32f4xx_fsmc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_fsmc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fsmc.c stm32f4xx_gpio.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c stm32f4xx_hash.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash.c stm32f4xx_hash_md5.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_md5.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_md5.c stm32f4xx_hash_sha1.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash_sha1.c stm32f4xx_i2c.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c stm32f4xx_iwdg.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_iwdg.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_iwdg.c stm32f4xx_pwr.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_pwr.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c stm32f4xx_rcc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c stm32f4xx_rng.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rng.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rng.c stm32f4xx_rtc.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rtc.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c stm32f4xx_sdio.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sdio.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c stm32f4xx_spi.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_spi.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c stm32f4xx_syscfg.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c stm32f4xx_tim.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_tim.c stm32f4xx_usart.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c stm32f4xx_wwdg.c 1 - Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_wwdg.c + Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c startup_stm32f4xx.s 2 - Libraries\CMSIS\ST\STM32F4xx\Source\Templates\arm\startup_stm32f4xx.s + Libraries/CMSIS/ST/STM32F4xx/Source/Templates/arm/startup_stm32f4xx.s + + + + + Drivers + + + board.c + 1 + drivers/board.c + + + + + stm32f4xx_it.c + 1 + drivers/stm32f4xx_it.c + + + + + usart.c + 1 + drivers/usart.c @@ -668,84 +661,84 @@ clock.c 1 - ..\..\src\clock.c + ../../src/clock.c device.c 1 - ..\..\src\device.c + ../../src/device.c idle.c 1 - ..\..\src\idle.c + ../../src/idle.c ipc.c 1 - ..\..\src\ipc.c + ../../src/ipc.c irq.c 1 - ..\..\src\irq.c + ../../src/irq.c kservice.c 1 - ..\..\src\kservice.c + ../../src/kservice.c mem.c 1 - ..\..\src\mem.c + ../../src/mem.c mempool.c 1 - ..\..\src\mempool.c + ../../src/mempool.c object.c 1 - ..\..\src\object.c + ../../src/object.c scheduler.c 1 - ..\..\src\scheduler.c + ../../src/scheduler.c thread.c 1 - ..\..\src\thread.c + ../../src/thread.c timer.c 1 - ..\..\src\timer.c + ../../src/timer.c @@ -755,129 +748,188 @@ cpuport.c 1 - ..\..\libcpu\arm\cortex-m4\cpuport.c + ../../libcpu/arm/cortex-m4/cpuport.c context_rvds.S 2 - ..\..\libcpu\arm\cortex-m4\context_rvds.S + ../../libcpu/arm/cortex-m4/context_rvds.S backtrace.c 1 - ..\..\libcpu\arm\common\backtrace.c + ../../libcpu/arm/common/backtrace.c div0.c 1 - ..\..\libcpu\arm\common\div0.c + ../../libcpu/arm/common/div0.c showmem.c 1 - ..\..\libcpu\arm\common\showmem.c + ../../libcpu/arm/common/showmem.c finsh - - - cmd.c - 1 - ..\..\components\finsh\cmd.c - - - - - finsh_compiler.c - 1 - ..\..\components\finsh\finsh_compiler.c - - - - - finsh_error.c - 1 - ..\..\components\finsh\finsh_error.c - - - - - finsh_heap.c - 1 - ..\..\components\finsh\finsh_heap.c - - - - - finsh_init.c - 1 - ..\..\components\finsh\finsh_init.c - - - - - finsh_node.c - 1 - ..\..\components\finsh\finsh_node.c - - - - - finsh_ops.c - 1 - ..\..\components\finsh\finsh_ops.c - - - - - finsh_parser.c - 1 - ..\..\components\finsh\finsh_parser.c - - - - - finsh_token.c - 1 - ..\..\components\finsh\finsh_token.c - - - - - finsh_var.c - 1 - ..\..\components\finsh\finsh_var.c - - - - - finsh_vm.c - 1 - ..\..\components\finsh\finsh_vm.c - - shell.c 1 - ..\..\components\finsh\shell.c + ../../components/finsh/shell.c symbol.c 1 - ..\..\components\finsh\symbol.c + ../../components/finsh/symbol.c + + + + + cmd.c + 1 + ../../components/finsh/cmd.c + + + + + finsh_compiler.c + 1 + ../../components/finsh/finsh_compiler.c + + + + + finsh_error.c + 1 + ../../components/finsh/finsh_error.c + + + + + finsh_heap.c + 1 + ../../components/finsh/finsh_heap.c + + + + + finsh_init.c + 1 + ../../components/finsh/finsh_init.c + + + + + finsh_node.c + 1 + ../../components/finsh/finsh_node.c + + + + + finsh_ops.c + 1 + ../../components/finsh/finsh_ops.c + + + + + finsh_parser.c + 1 + ../../components/finsh/finsh_parser.c + + + + + finsh_var.c + 1 + ../../components/finsh/finsh_var.c + + + + + finsh_vm.c + 1 + ../../components/finsh/finsh_vm.c + + + + + finsh_token.c + 1 + ../../components/finsh/finsh_token.c + + + + + DeviceDrivers + + + serial.c + 1 + ../../components/drivers/serial/serial.c + + + + + pin.c + 1 + ../../components/drivers/misc/pin.c + + + + + completion.c + 1 + ../../components/drivers/src/completion.c + + + + + dataqueue.c + 1 + ../../components/drivers/src/dataqueue.c + + + + + pipe.c + 1 + ../../components/drivers/src/pipe.c + + + + + portal.c + 1 + ../../components/drivers/src/portal.c + + + + + ringbuffer.c + 1 + ../../components/drivers/src/ringbuffer.c + + + + + workqueue.c + 1 + ../../components/drivers/src/workqueue.c diff --git a/bsp/stm32f40x/rtconfig.py b/bsp/stm32f40x/rtconfig.py index d22162626d..d1f081370e 100644 --- a/bsp/stm32f40x/rtconfig.py +++ b/bsp/stm32f40x/rtconfig.py @@ -6,16 +6,16 @@ CPU='cortex-m4' CROSS_TOOL='keil' if os.getenv('RTT_CC'): - CROSS_TOOL = os.getenv('RTT_CC') + CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': - PLATFORM = 'gcc' - EXEC_PATH = r'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' + PLATFORM = 'gcc' + EXEC_PATH = r'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' elif CROSS_TOOL == 'keil': - PLATFORM = 'armcc' - EXEC_PATH = r'C:/Keil' + PLATFORM = 'armcc' + EXEC_PATH = r'C:/Keil' elif CROSS_TOOL == 'iar': print '================ERROR============================' print 'Not support iar yet!'