资源简介
针对STM32芯片,MDK开发环境,基于RT-Thread操作系统的2581配置程序;能够通过串口与电脑相连,在线完成对2581的配置。
代码片段和文件信息
import os
# toolchains options
ARCH=‘arm‘
CPU=‘cortex-m3‘
CROSS_TOOL=‘keil‘
if os.getenv(‘RTT_CC‘):
CROSS_TOOL = os.getenv(‘RTT_CC‘)
#device options
# STM32_TYPE =
# ‘STM32F10X_LD‘‘STM32F10X_LD_VL‘
# ‘STM32F10X_MD‘‘STM32F10X_MD_VL‘
# ‘STM32F10X_HD‘‘STM32F10X_HD_VL‘
# ‘STM32F10X_XL‘‘STM32F10X_CL‘
STM32_TYPE = ‘STM32F10X_HD‘
# lcd panel options
# ‘FMT0371‘‘ILI932X‘ ‘SSD1289‘
RT_USING_LCD_TYPE = ‘SSD1289‘
# 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 = ‘D:/SourceryGCC/bin‘
elif CROSS_TOOL == ‘keil‘:
PLATFORM = ‘armcc‘
EXEC_PATH = ‘C:/Keil‘
elif CROSS_TOOL == ‘iar‘:
PLATFORM = ‘iar‘
IAR_PATH = ‘C:/Program Files/IAR Systems/embedded Workbench 6.0 Evaluation‘
if os.getenv(‘RTT_EXEC_PATH‘):
EXEC_PATH = os.getenv(‘RTT_EXEC_PATH‘)
BUILD = ‘debug‘
if PLATFORM == ‘gcc‘:
# toolchains
PREFIX = ‘arm-none-eabi-‘
CC = PREFIX + ‘gcc‘
AS = PREFIX + ‘gcc‘
AR = PREFIX + ‘ar‘
link = PREFIX + ‘gcc‘
TARGET_EXT = ‘axf‘
SIZE = PREFIX + ‘size‘
OBJDUMP = PREFIX + ‘objdump‘
OBJCPY = PREFIX + ‘objcopy‘
DEVICE = ‘ -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections‘
CFLAGS = DEVICE
AFLAGS = ‘ -c‘ + DEVICE + ‘ -x assembler-with-cpp‘
LFLAGS = DEVICE + ‘ -Wl--gc-sections-Map=rtthread-stm32.map-cref-uReset_Handler -T stm32_rom.ld‘
CPATH = ‘‘
LPATH = ‘‘
if BUILD == ‘debug‘:
CFLAGS += ‘ -O0 -gdwarf-2‘
AFLAGS += ‘ -gdwarf-2‘
else:
CFLAGS += ‘ -O2‘
POST_ACTION = OBJCPY + ‘ -O binary $TARGET rtthread.bin\n‘ + SIZE + ‘ $TARGET \n‘
elif PLATFORM == ‘armcc‘:
# toolchains
CC = ‘armcc‘
AS = ‘armasm‘
AR = ‘armar‘
link = ‘armlink‘
TARGET_EXT = ‘axf‘
DEVICE = ‘ --device DARMSTM‘
CFLAGS = DEVICE + ‘ --apcs=interwork‘
AFLAGS = DEVICE
LFLAGS = DEVICE + ‘ --info sizes --info totals --info unused --info veneers --list rtthread-stm32.map --scatter stm32_rom.sct‘
CFLAGS += ‘ --c99‘
CFLAGS += ‘ -I‘ + EXEC_PATH + ‘/ARM/RV31/INC‘
LFLAGS += ‘ --libpath ‘ + EXEC_PATH + ‘/ARM/RV31/LIB‘
EXEC_PATH += ‘/arm/bin40/‘
if BUILD == ‘debug‘:
CFLAGS += ‘ -g -O0‘
AFLAGS += ‘ -g‘
else:
CFLAGS += ‘ -O2‘
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 = ‘ -D USE_STDPERIPH_DRIVER‘ + ‘ -D STM32F10X_HD‘
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 += ‘ --debug‘
CFLAGS += ‘ --endian=little‘
CFLAGS += ‘ --cpu=Cortex-M3
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 459 2016-04-24 20:13 gpio_LMX2581\.gitattributes
文件 143 2016-04-24 20:13 gpio_LMX2581\.gitignore
文件 4016 2016-04-24 20:13 gpio_LMX2581\.travis.yml
文件 571 2016-04-24 20:13 gpio_LMX2581\AUTHORS
文件 3907 2017-01-09 00:02 gpio_LMX2581\bsp\stm32f10x\applications\application.c
文件 7340 2016-04-24 20:13 gpio_LMX2581\bsp\stm32f10x\applications\canapp.c
文件 338 2016-04-24 20:13 gpio_LMX2581\bsp\stm32f10x\applications\SConsc
文件 2708 2016-06-30 23:50 gpio_LMX2581\bsp\stm32f10x\applications\startup.c
文件 418052 2016-06-30 22:25 gpio_LMX2581\bsp\stm32f10x\build\application.crf
文件 3465 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\application.d
文件 435260 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\application.o
文件 29790 2016-06-30 10:26 gpio_LMX2581\bsp\stm32f10x\build\backtrace.crf
文件 431 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\backtrace.d
文件 23780 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\backtrace.o
文件 406415 2016-06-30 10:26 gpio_LMX2581\bsp\stm32f10x\build\board.crf
文件 3061 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\board.d
文件 425932 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\board.o
文件 416641 2016-06-13 17:18 gpio_LMX2581\bsp\stm32f10x\build\bxcan.crf
文件 3206 2016-06-13 17:18 gpio_LMX2581\bsp\stm32f10x\build\bxcan.d
文件 432948 2016-06-13 17:18 gpio_LMX2581\bsp\stm32f10x\build\bxcan.o
文件 72022 2016-06-13 17:12 gpio_LMX2581\bsp\stm32f10x\build\can.crf
文件 542 2016-06-13 17:18 gpio_LMX2581\bsp\stm32f10x\build\can.d
文件 399505 2016-06-30 10:26 gpio_LMX2581\bsp\stm32f10x\build\canapp.crf
文件 2879 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\canapp.d
文件 416212 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\canapp.o
文件 31817 2016-06-30 10:26 gpio_LMX2581\bsp\stm32f10x\build\clock.crf
文件 416 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\clock.d
文件 26328 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\clock.o
文件 49985 2016-06-30 10:26 gpio_LMX2581\bsp\stm32f10x\build\cmd.crf
文件 590 2016-12-29 22:35 gpio_LMX2581\bsp\stm32f10x\build\cmd.d
............此处省略5396个文件信息
评论
共有 条评论