Skip to content

Commit 8ae5eda

Browse files
mmahadevan108JojoS62
authored andcommitted
Add support for MCUXpresso inside mbed exporter
Signed-off-by: Mahadevan Mahesh <[email protected]>
1 parent 99a8467 commit 8ae5eda

File tree

4 files changed

+371
-1
lines changed

4 files changed

+371
-1
lines changed

tools/export/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from tools.build_api import scan_resources
3030
from tools.toolchains import Resources
3131
from tools.export import lpcxpresso, ds5_5, iar, makefile
32-
from tools.export import embitz, coide, kds, simplicity, atmelstudio
32+
from tools.export import embitz, coide, kds, simplicity, atmelstudio, mcuxpresso
3333
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt, vscode
3434
from tools.export import gnuarmeclipse
3535
from tools.export import qtcreator
@@ -56,6 +56,7 @@
5656
'eclipse_iar' : cdt.EclipseIAR,
5757
'eclipse_armc5' : cdt.EclipseArmc5,
5858
'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse,
59+
'mcuxpresso': mcuxpresso.MCUXpresso,
5960
'qtcreator': qtcreator.QtCreator,
6061
'vscode_gcc_arm' : vscode.VSCodeGcc,
6162
'vscode_iar' : vscode.VSCodeIAR,

tools/export/mcuxpresso/__init__.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"""
2+
mbed SDK
3+
Copyright (c) 2011-2016 ARM Limited
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
"""
17+
from os.path import splitext, basename
18+
19+
from tools.export.gnuarmeclipse import GNUARMEclipse
20+
21+
22+
class MCUXpresso(GNUARMEclipse):
23+
NAME = 'MCUXpresso'
24+
TOOLCHAIN = 'GCC_ARM'
25+
26+
MBED_CONFIG_HEADER_SUPPORTED = True
27+
28+
TARGETS = [
29+
'LPC54114',
30+
]
31+
32+
def generate(self):
33+
self.resources.win_to_unix()
34+
libraries = []
35+
for lib in self.resources.libraries:
36+
l, _ = splitext(basename(lib))
37+
libraries.append(l[3:])
38+
39+
self.compute_exclusions()
40+
41+
ctx = {
42+
'name': self.project_name,
43+
'include_paths': self.resources.inc_dirs,
44+
'linker_script': self.resources.linker_script,
45+
'object_files': self.resources.objects,
46+
'libraries': libraries,
47+
'exclude': '|'.join(self.excluded_folders),
48+
'symbols': self.toolchain.get_symbols()
49+
}
50+
ctx.update(self.flags)
51+
self.gen_file('mcuxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project')
52+
self.gen_file('mcuxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')

0 commit comments

Comments
 (0)