rt-thread/bsp/avr32/at32uc3a0256/rtconfig.py

62 lines
1.7 KiB
Python
Raw Normal View History

2013-01-08 22:40:58 +08:00
import os
# toolchains options
ARCH = 'avr32'
CPU = 'uc3'
PART = 'uc3a0256'
2013-01-08 22:40:58 +08:00
BOARD = 'USERBOARD'
ATOMICS = ' -D__STDC_NO_ATOMICS__'
2013-01-08 22:40:58 +08:00
CROSS_TOOL = 'gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = 'C:/Program Files (x86)/Atmel/AVR Tools/AVR Toolchain/bin'
2013-01-08 22:40:58 +08:00
elif CROSS_TOOL == 'keil':
2018-02-06 20:07:28 +08:00
print('================ERROR============================')
print('Not support keil yet!')
print('=================================================')
2013-01-08 22:40:58 +08:00
exit(0)
elif CROSS_TOOL == 'iar':
2018-02-06 20:07:28 +08:00
print('================ERROR============================')
print('Not support iar yet!')
print('=================================================')
2013-01-08 22:40:58 +08:00
exit(0)
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
#BUILD = 'debug'
BUILD = 'release'
if PLATFORM == 'gcc':
# toolchains
PREFIX = 'avr32-'
CC = PREFIX + 'gcc'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
LINK = PREFIX + 'gcc'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = ' -mpart=' + PART
CFLAGS = DEVICE + ' -DBOARD=' + BOARD + ATOMICS + ' -fmessage-length=0 -ffunction-sections -masm-addr-pseudos'
2013-01-08 22:40:58 +08:00
AFLAGS = ' -c -x assembler-with-cpp' + DEVICE
LFLAGS = DEVICE + ' -Wl,--gc-sections --rodata-writable -Wl,--direct-data -Lsoftware_framework/utils/libs/newlib_addons -T avr32elf_uc3a0256.lds'
2013-01-08 22:40:58 +08:00
CPATH = ''
LPATH = ''
if BUILD == 'debug':
CFLAGS += ' -O0 -g3 -Wall'
AFLAGS += ' -g3'
else:
CFLAGS += ' -O2 -Wall'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'