mbed-os/workspace_tools/export/gccarm.py

95 lines
2.5 KiB
Python
Raw Normal View History

2013-08-06 13:38:00 +00:00
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from exporters import Exporter
from os.path import splitext, basename
class GccArm(Exporter):
NAME = 'GccArm'
TOOLCHAIN = 'GCC_ARM'
2014-03-18 12:16:42 +00:00
TARGETS = [
'LPC1768',
'LPC1549',
2014-03-18 12:16:42 +00:00
'KL05Z',
'KL25Z',
'KL43Z',
2014-03-18 12:16:42 +00:00
'KL46Z',
'K64F',
'K22F',
'K20D50M',
2014-03-18 12:16:42 +00:00
'LPC4088',
2014-07-22 01:41:05 +00:00
'LPC4330_M4',
2014-03-18 12:16:42 +00:00
'LPC11U24',
'LPC1114',
'LPC11U35_401',
'LPC11U35_501',
'STM32F407',
2014-03-19 12:15:59 +00:00
'DISCO_F100RB',
'DISCO_F051R8',
'DISCO_F407VG',
'DISCO_F303VC',
'UBLOX_C027',
2014-05-28 09:54:42 +00:00
'ARCH_PRO',
2014-05-31 20:33:21 +00:00
'NRF51822',
'HRM1017',
'LPC2368',
'LPCCAPPUCCINO',
2014-07-07 07:11:47 +00:00
'ARCH_BLE',
'MTS_GAMBIT',
'ARCH_MAX',
'NUCLEO_F401RE',
'NUCLEO_F411RE',
2014-09-01 10:12:53 +00:00
'ARCH_MAX',
'DISCO_F429ZI',
[EXPORT][NUCLEO_F334R8] export to gcc_arm and coide - rtos library is not working because of double defined SysTick_Handler in system_stm32f3xx.c and in rtos - please see pullrequest #526 for a correct export - tests are working fine: Test summary: +--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+ | Result | Target | Toolchain | Test ID | Test Description | Elapsed Time (sec) | Timeout (sec) | Loops | +--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+ | OK | NUCLEO_F334R8 | GCC_ARM | DTCT_1 | Simple detect test | 0.44 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | EXAMPLE_1 | /dev/null | 3.37 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_10 | Hello World | 0.37 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_11 | Ticker Int | 11.31 | 20 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_12 | C++ | 1.32 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_16 | RTC | 4.7 | 15 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_2 | stdio | 0.76 | 20 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_23 | Ticker Int us | 11.37 | 15 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_24 | Timeout Int us | 11.41 | 15 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_25 | Time us | 11.31 | 15 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_26 | Integer constant division | 1.32 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A1 | Basic | 1.32 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A21 | Call function before main (mbed_main) | 1.31 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A5 | DigitalIn DigitalOut | 1.31 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A6 | DigitalInOut | 1.31 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A7 | InterruptIn | 9.31 | 10 | 1/1 | | OK | NUCLEO_F334R8 | GCC_ARM | MBED_A9 | Serial Echo at 115200 | 5.97 | 10 | 1/1 | +--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+ Result: 17 OK Completed in 125.02 sec
2014-10-03 23:45:38 +00:00
'NUCLEO_F334R8',
'DISCO_L053C8',
2014-10-31 12:34:43 +00:00
'NUCLEO_L053R8',
'DISCO_F334C8',
2014-03-18 12:16:42 +00:00
]
DOT_IN_RELATIVE_PATH = True
def generate(self):
# "make" wants Unix paths
self.resources.win_to_unix()
to_be_compiled = []
for r_type in ['s_sources', 'c_sources', 'cpp_sources']:
r = getattr(self.resources, r_type)
if r:
for source in r:
base, ext = splitext(source)
to_be_compiled.append(base + '.o')
libraries = []
for lib in self.resources.libraries:
l, _ = splitext(basename(lib))
libraries.append(l[3:])
ctx = {
'name': self.program_name,
'to_be_compiled': to_be_compiled,
'object_files': self.resources.objects,
'include_paths': self.resources.inc_dirs,
'library_paths': self.resources.lib_dirs,
'linker_script': self.resources.linker_script,
'libraries': libraries,
'symbols': self.toolchain.get_symbols()
}
self.gen_file('gcc_arm_%s.tmpl' % self.target.lower(), ctx, 'Makefile')