From 8ae5edacdaef5da98df5104682da3d30afd2f0a6 Mon Sep 17 00:00:00 2001 From: Mahadevan Mahesh Date: Mon, 5 Jun 2017 08:45:26 -0500 Subject: [PATCH] Add support for MCUXpresso inside mbed exporter Signed-off-by: Mahadevan Mahesh --- tools/export/__init__.py | 3 +- tools/export/mcuxpresso/__init__.py | 52 ++++ .../export/mcuxpresso/lpc54114_cproject.tmpl | 290 ++++++++++++++++++ tools/export/mcuxpresso/lpc54114_project.tmpl | 27 ++ 4 files changed, 371 insertions(+), 1 deletion(-) create mode 100644 tools/export/mcuxpresso/__init__.py create mode 100644 tools/export/mcuxpresso/lpc54114_cproject.tmpl create mode 100644 tools/export/mcuxpresso/lpc54114_project.tmpl diff --git a/tools/export/__init__.py b/tools/export/__init__.py index 83ae2d3969..6a2356c1ca 100644 --- a/tools/export/__init__.py +++ b/tools/export/__init__.py @@ -29,7 +29,7 @@ from tools.build_api import prepare_toolchain from tools.build_api import scan_resources from tools.toolchains import Resources from tools.export import lpcxpresso, ds5_5, iar, makefile -from tools.export import embitz, coide, kds, simplicity, atmelstudio +from tools.export import embitz, coide, kds, simplicity, atmelstudio, mcuxpresso from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt, vscode from tools.export import gnuarmeclipse from tools.export import qtcreator @@ -56,6 +56,7 @@ EXPORTERS = { 'eclipse_iar' : cdt.EclipseIAR, 'eclipse_armc5' : cdt.EclipseArmc5, 'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse, + 'mcuxpresso': mcuxpresso.MCUXpresso, 'qtcreator': qtcreator.QtCreator, 'vscode_gcc_arm' : vscode.VSCodeGcc, 'vscode_iar' : vscode.VSCodeIAR, diff --git a/tools/export/mcuxpresso/__init__.py b/tools/export/mcuxpresso/__init__.py new file mode 100644 index 0000000000..d31700d2ca --- /dev/null +++ b/tools/export/mcuxpresso/__init__.py @@ -0,0 +1,52 @@ +""" +mbed SDK +Copyright (c) 2011-2016 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 os.path import splitext, basename + +from tools.export.gnuarmeclipse import GNUARMEclipse + + +class MCUXpresso(GNUARMEclipse): + NAME = 'MCUXpresso' + TOOLCHAIN = 'GCC_ARM' + + MBED_CONFIG_HEADER_SUPPORTED = True + + TARGETS = [ + 'LPC54114', + ] + + def generate(self): + self.resources.win_to_unix() + libraries = [] + for lib in self.resources.libraries: + l, _ = splitext(basename(lib)) + libraries.append(l[3:]) + + self.compute_exclusions() + + ctx = { + 'name': self.project_name, + 'include_paths': self.resources.inc_dirs, + 'linker_script': self.resources.linker_script, + 'object_files': self.resources.objects, + 'libraries': libraries, + 'exclude': '|'.join(self.excluded_folders), + 'symbols': self.toolchain.get_symbols() + } + ctx.update(self.flags) + self.gen_file('mcuxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project') + self.gen_file('mcuxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') diff --git a/tools/export/mcuxpresso/lpc54114_cproject.tmpl b/tools/export/mcuxpresso/lpc54114_cproject.tmpl new file mode 100644 index 0000000000..0ee936407c --- /dev/null +++ b/tools/export/mcuxpresso/lpc54114_cproject.tmpl @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <?xml version="1.0" encoding="UTF-8"?> +<TargetConfig> +<Properties property_0="None" property_2="LPC5411x_256K.cfx" property_3="NXP" property_4="LPC54114J256" property_count="5" version="70200"/> +<infoList vendor="NXP"><info chip="LPC54114J256" name="LPC54114J256"><chip><name>LPC54114J256</name> +<family>LPC5411x</family> +<vendor>NXP</vendor> +<memory can_program="true" id="Flash" is_ro="true" size="256" type="Flash"/> +<memory id="RAM" size="192" type="RAM"/> +<memoryInstance derived_from="Flash" id="MFlash256" location="0x0" size="0x40000"/> +<memoryInstance derived_from="RAM" id="Ram0_64" location="0x20000000" size="0x10000"/> +<memoryInstance derived_from="RAM" id="Ram1_64" location="0x20010000" size="0x10000"/> +<memoryInstance derived_from="RAM" id="Ram2_32" location="0x20020000" size="0x8000"/> +<memoryInstance derived_from="RAM" id="RamX_32" location="0x4000000" size="0x8000"/> +<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40000000"/> +<peripheralInstance derived_from="IOCON" id="IOCON" location="0x40001000"/> +<peripheralInstance derived_from="GINT0" id="GINT0" location="0x40002000"/> +<peripheralInstance derived_from="GINT0" id="GINT1" location="0x40003000"/> +<peripheralInstance derived_from="PINT" id="PINT" location="0x40004000"/> +<peripheralInstance derived_from="INPUTMUX" id="INPUTMUX" location="0x40005000"/> +<peripheralInstance derived_from="CTIMER0" id="CTIMER0" location="0x40008000"/> +<peripheralInstance derived_from="CTIMER0" id="CTIMER1" location="0x40009000"/> +<peripheralInstance derived_from="WWDT" id="WWDT" location="0x4000C000"/> +<peripheralInstance derived_from="MRT0" id="MRT0" location="0x4000D000"/> +<peripheralInstance derived_from="UTICK0" id="UTICK0" location="0x4000E000"/> +<peripheralInstance derived_from="CTIMER0" id="CTIMER2" location="0x40028000"/> +<peripheralInstance derived_from="RTC" id="RTC" location="0x4002C000"/> +<peripheralInstance derived_from="ASYNC_SYSCON" id="ASYNC_SYSCON" location="0x40040000"/> +<peripheralInstance derived_from="CTIMER0" id="CTIMER3" location="0x40048000"/> +<peripheralInstance derived_from="CTIMER0" id="CTIMER4" location="0x40049000"/> +<peripheralInstance derived_from="SPIFI0" id="SPIFI0" location="0x40080000"/> +<peripheralInstance derived_from="DMA0" id="DMA0" location="0x40082000"/> +<peripheralInstance derived_from="USB0" id="USB0" location="0x40084000"/> +<peripheralInstance derived_from="SCT0" id="SCT0" location="0x40085000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM0" location="0x40086000"/> +<peripheralInstance derived_from="I2C0" id="I2C0" location="0x40086000"/> +<peripheralInstance derived_from="SPI0" id="SPI0" location="0x40086000"/> +<peripheralInstance derived_from="USART0" id="USART0" location="0x40086000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM1" location="0x40087000"/> +<peripheralInstance derived_from="I2C0" id="I2C1" location="0x40087000"/> +<peripheralInstance derived_from="SPI0" id="SPI1" location="0x40087000"/> +<peripheralInstance derived_from="USART0" id="USART1" location="0x40087000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM2" location="0x40088000"/> +<peripheralInstance derived_from="I2C0" id="I2C2" location="0x40088000"/> +<peripheralInstance derived_from="SPI0" id="SPI2" location="0x40088000"/> +<peripheralInstance derived_from="USART0" id="USART2" location="0x40088000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM3" location="0x40089000"/> +<peripheralInstance derived_from="I2C0" id="I2C3" location="0x40089000"/> +<peripheralInstance derived_from="SPI0" id="SPI3" location="0x40089000"/> +<peripheralInstance derived_from="USART0" id="USART3" location="0x40089000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM4" location="0x4008A000"/> +<peripheralInstance derived_from="I2C0" id="I2C4" location="0x4008A000"/> +<peripheralInstance derived_from="SPI0" id="SPI4" location="0x4008A000"/> +<peripheralInstance derived_from="USART0" id="USART4" location="0x4008A000"/> +<peripheralInstance derived_from="MAILBOX" id="MAILBOX" location="0x4008B000"/> +<peripheralInstance derived_from="GPIO" id="GPIO" location="0x4008C000"/> +<peripheralInstance derived_from="DMIC0" id="DMIC0" location="0x40090000"/> +<peripheralInstance derived_from="CRC_ENGINE" id="CRC_ENGINE" location="0x40095000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM5" location="0x40096000"/> +<peripheralInstance derived_from="I2C0" id="I2C5" location="0x40096000"/> +<peripheralInstance derived_from="SPI0" id="SPI5" location="0x40096000"/> +<peripheralInstance derived_from="USART0" id="USART5" location="0x40096000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM6" location="0x40097000"/> +<peripheralInstance derived_from="I2C0" id="I2C6" location="0x40097000"/> +<peripheralInstance derived_from="I2S0" id="I2S0" location="0x40097000"/> +<peripheralInstance derived_from="SPI0" id="SPI6" location="0x40097000"/> +<peripheralInstance derived_from="USART0" id="USART6" location="0x40097000"/> +<peripheralInstance derived_from="FLEXCOMM0" id="FLEXCOMM7" location="0x40098000"/> +<peripheralInstance derived_from="I2C0" id="I2C7" location="0x40098000"/> +<peripheralInstance derived_from="I2S0" id="I2S1" location="0x40098000"/> +<peripheralInstance derived_from="SPI0" id="SPI7" location="0x40098000"/> +<peripheralInstance derived_from="USART0" id="USART7" location="0x40098000"/> +<peripheralInstance derived_from="ADC0" id="ADC0" location="0x400A0000"/> +</chip> +<processor><name gcc_name="cortex-m4">Cortex-M4</name> +<family>Cortex-M</family> +</processor> +<processor><name gcc_name="cortex-m0plus">Cortex-M0+</name> +<family>Cortex-M</family> +</processor> +<link href="LPC54114_internal_peripheral.xml" show="embed" type="simple"/> +</info> +</infoList> +</TargetConfig> + + + SDK_2.x_LPCXpresso54114 + 2.2.0 + + + diff --git a/tools/export/mcuxpresso/lpc54114_project.tmpl b/tools/export/mcuxpresso/lpc54114_project.tmpl new file mode 100644 index 0000000000..ce4e268083 --- /dev/null +++ b/tools/export/mcuxpresso/lpc54114_project.tmpl @@ -0,0 +1,27 @@ + + + {{name}} + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + +