diff options
| author | Kevin Liu <[email protected]> | 2022-04-14 10:54:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-14 10:54:53 +0800 |
| commit | 8af8decb620608e4be2c0c87c0245ed89fb0fa8d (patch) | |
| tree | 6ec32e6613e10664dc965c956e98e3b9887c8985 /bsp/microchip/same70/rtconfig.py | |
| parent | efdd28bde620b7695ef852b8ab647cbddb12e646 (diff) | |
Add Microchip SAM series MCU support for RT-Thread (#5771)
* Add Microchip SAM series MCU support for RT-Thread
Add Microchip SAM series MCU support for RT-Thread, including SAM Cortex-M0+, M4F and M7.
* Add bsp directory to ignored check list
Add bsp directory to ignored check list, add microchip /samc21/same54/same70 to workflows list
* remove STDIO definition and bug fix
1. remove STDIO code from Microchip official BSP. 2. bug fix of SAME70 hpl/hpl_usart.c, samc21&same54 hpl/hpl_sercom.c baudrate update interface. 3. Add RT-Thread standard STDIO implementation on Microchip SAM MCU.
* add CAN driver & example and script fix
Add CAN driver and example for SAMC21/SAME5x/SAME70 and fix rtconfig.py issue(unused space might result link error)
* Add Chinese version README
Add Chinese version README for SAMC21/E54/E70
Diffstat (limited to 'bsp/microchip/same70/rtconfig.py')
| -rw-r--r-- | bsp/microchip/same70/rtconfig.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/bsp/microchip/same70/rtconfig.py b/bsp/microchip/same70/rtconfig.py new file mode 100644 index 0000000000..8fbfc8dfb4 --- /dev/null +++ b/bsp/microchip/same70/rtconfig.py @@ -0,0 +1,69 @@ +import os + +# toolchains options +ARCH='arm' +CPU='cortex-m7' +CROSS_TOOL='gcc' + +if os.getenv('RTT_CC'): + CROSS_TOOL = os.getenv('RTT_CC') +if os.getenv('RTT_ROOT'): + RTT_ROOT = os.getenv('RTT_ROOT') + +DEVICE_SERIES = 'SAME70' +#DEVICE_SERIES = 'SAMS70' +#DEVICE_SERIES = 'SAMV70' +#DEVICE_SERIES = 'SAMV71' +DEVICE_TYPE = '__SAME70Q21B__' +#DEVICE_TYPE = '__SAMS70Q21B__' +DEVICE_PART = 'same70' + +# 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'C:/workspace/tools/embedcpp/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin' +elif CROSS_TOOL == 'keil': + PLATFORM = 'armcc' + EXEC_PATH = r'C:/Keil_v5' +elif CROSS_TOOL == 'iar': + PLATFORM = 'iar' + EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0' + +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' + CXX = PREFIX + 'g++' + LINK = PREFIX + 'gcc' + TARGET_EXT = 'elf' + SIZE = PREFIX + 'size' + OBJDUMP = PREFIX + 'objdump' + OBJCPY = PREFIX + 'objcopy' + + DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -mlong-calls' + CFLAGS = DEVICE + ' -Dgcc' + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb ' + LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T bsp/same70b/gcc/gcc/same70q21b_flash.ld' + + CPATH = '' + LPATH = '' + + if BUILD == 'debug': + CFLAGS += ' -O0 -gdwarf-2 -g' + AFLAGS += ' -gdwarf-2' + else: + CFLAGS += ' -O2' + + CXXFLAGS = CFLAGS + CFLAGS += ' -std=c99' + + POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + |
