Skip to content

Add support for MCUXpresso inside mbed exporter #4819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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
Expand All @@ -56,6 +56,7 @@
'eclipse_iar' : cdt.EclipseIAR,
'eclipse_armc5' : cdt.EclipseArmc5,
'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse,
'mcuxpresso': mcuxpresso.MCUXpresso,
'qtcreator': qtcreator.QtCreator,
'zip' : zip.ZIP,
'cmsis' : cmsis.CMSIS,
Expand Down
52 changes: 52 additions & 0 deletions tools/export/mcuxpresso/__init__.py
Original file line number Diff line number Diff line change
@@ -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')
Loading