Skip to content

Commit 067f5a0

Browse files
authored
Merge pull request #3791 from theotherjimmy/remove-cr
Remove GCC_CR and refurbish LPCXpresso exporter
2 parents 355f69a + 1d95604 commit 067f5a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+47
-83
lines changed

tools/export/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
from tools.export import codered, ds5_5, iar, makefile
18+
from tools.export import lpcxpresso, ds5_5, iar, makefile
1919
from tools.export import embitz, coide, kds, simplicity, atmelstudio
2020
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt
2121
from tools.export import gnuarmeclipse
@@ -24,7 +24,7 @@
2424
EXPORTERS = {
2525
'uvision5': uvision.Uvision,
2626
'uvision': uvision.Uvision,
27-
'lpcxpresso': codered.CodeRed,
27+
'lpcxpresso': lpcxpresso.LPCXpresso,
2828
'gcc_arm': makefile.GccArm,
2929
'make_gcc_arm': makefile.GccArm,
3030
'make_armc5': makefile.Armc5,

tools/export/codered/arch_pro_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/cproject_cortexm0_common.tmpl

Lines changed: 0 additions & 3 deletions
This file was deleted.

tools/export/codered/cproject_cortexm3_common.tmpl

Lines changed: 0 additions & 3 deletions
This file was deleted.

tools/export/codered/lpc1114_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc11u35_401_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc11u35_501_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc11u37h_401_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc11u68_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc1549_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc1768_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc4088_dm_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc4088_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc4330_m4_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpc824_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/lpccappuccino_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/ublox_c027_project.tmpl

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/export/codered/__init__.py renamed to tools/export/lpcxpresso/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
from tools.export.exporters import Exporter
2020

21-
class CodeRed(Exporter):
22-
NAME = 'CodeRed'
23-
TOOLCHAIN = 'GCC_CR'
21+
class LPCXpresso(Exporter):
22+
NAME = 'LPCXpresso'
23+
TOOLCHAIN = 'GCC_ARM'
2424

2525
MBED_CONFIG_HEADER_SUPPORTED = True
2626

@@ -56,5 +56,5 @@ def generate(self):
5656
'symbols': self.toolchain.get_symbols()
5757
}
5858
ctx.update(self.flags)
59-
self.gen_file('codered/%s_project.tmpl' % self.target.lower(), ctx, '.project')
60-
self.gen_file('codered/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')
59+
self.gen_file('lpcxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project')
60+
self.gen_file('lpcxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')

tools/export/codered/arch_pro_cproject.tmpl renamed to tools/export/lpcxpresso/arch_pro_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm3_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm3_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc176x.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends "lpcxpresso/cproject_common.tmpl" %}
2+
3+
{% block core %}cm0{% endblock %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends "lpcxpresso/cproject_common.tmpl" %}
2+
3+
{% block core %}cm3{% endblock %}

tools/export/codered/lpc1114_cproject.tmpl renamed to tools/export/lpcxpresso/lpc1114_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc11xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc11u35_401_cproject.tmpl renamed to tools/export/lpcxpresso/lpc11u35_401_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc11xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc11u35_501_cproject.tmpl renamed to tools/export/lpcxpresso/lpc11u35_501_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc11xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc11u37h_401_cproject.tmpl renamed to tools/export/lpcxpresso/lpc11u37h_401_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc11xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc11u68_cproject.tmpl renamed to tools/export/lpcxpresso/lpc11u68_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}startup_LPC11U68.cpp{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc1549_cproject.tmpl renamed to tools/export/lpcxpresso/lpc1549_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm3_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm3_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc15xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxprosso/project_common.tmpl" %}

tools/export/codered/lpc1768_cproject.tmpl renamed to tools/export/lpcxpresso/lpc1768_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm3_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm3_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc176x.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpc824_cproject.tmpl renamed to tools/export/lpcxpresso/lpc824_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}startup_LPC824_CR.cpp{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/lpccappuccino_cproject.tmpl renamed to tools/export/lpcxpresso/lpccappuccino_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm0_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm0_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc11xx.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/export/codered/ublox_c027_cproject.tmpl renamed to tools/export/lpcxpresso/ublox_c027_cproject.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "codered_cproject_cortexm3_common.tmpl" %}
1+
{% extends "lpcxpresso/cproject_cortexm3_common.tmpl" %}
22

33
{% block startup_file %}cr_startup_lpc176x.c{% endblock %}
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends "lpcxpresso/project_common.tmpl" %}

tools/toolchains/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,26 +1395,24 @@ def get_config_macros(self):
13951395
return Config.config_to_macros(self.config_data) if self.config_data else []
13961396

13971397
from tools.settings import ARM_PATH
1398-
from tools.settings import GCC_ARM_PATH, GCC_CR_PATH
1398+
from tools.settings import GCC_ARM_PATH
13991399
from tools.settings import IAR_PATH
14001400

14011401
TOOLCHAIN_PATHS = {
14021402
'ARM': ARM_PATH,
14031403
'uARM': ARM_PATH,
14041404
'GCC_ARM': GCC_ARM_PATH,
1405-
'GCC_CR': GCC_CR_PATH,
14061405
'IAR': IAR_PATH
14071406
}
14081407

14091408
from tools.toolchains.arm import ARM_STD, ARM_MICRO
1410-
from tools.toolchains.gcc import GCC_ARM, GCC_CR
1409+
from tools.toolchains.gcc import GCC_ARM
14111410
from tools.toolchains.iar import IAR
14121411

14131412
TOOLCHAIN_CLASSES = {
14141413
'ARM': ARM_STD,
14151414
'uARM': ARM_MICRO,
14161415
'GCC_ARM': GCC_ARM,
1417-
'GCC_CR': GCC_CR,
14181416
'IAR': IAR
14191417
}
14201418

tools/toolchains/gcc.py

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class GCC(mbedToolchain):
2929
INDEX_PATTERN = re.compile('(?P<col>\s*)\^')
3030

3131
def __init__(self, target, notify=None, macros=None,
32-
silent=False, tool_path="", extra_verbose=False,
33-
build_profile=None):
32+
silent=False, extra_verbose=False, build_profile=None):
3433
mbedToolchain.__init__(self, target, notify, macros, silent,
3534
extra_verbose=extra_verbose,
3635
build_profile=build_profile)
3736

37+
tool_path=TOOLCHAIN_PATHS['GCC_ARM']
3838
# Add flags for current size setting
3939
default_lib = "std"
4040
if hasattr(target, "default_lib"):
@@ -92,7 +92,7 @@ def __init__(self, target, notify=None, macros=None,
9292

9393
self.flags['ld'] += self.cpu
9494
self.ld = [join(tool_path, "arm-none-eabi-gcc")] + self.flags['ld']
95-
self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc"]
95+
self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc", "nosys"]
9696
self.preproc = [join(tool_path, "arm-none-eabi-cpp"), "-E", "-P"]
9797

9898
self.ar = join(tool_path, "arm-none-eabi-ar")
@@ -126,7 +126,7 @@ def parse_output(self, output):
126126
# The warning/error notification is multiline
127127
msg = None
128128
for line in output.splitlines():
129-
match = GCC.DIAGNOSTIC_PATTERN.search(line)
129+
match = self.DIAGNOSTIC_PATTERN.search(line)
130130
if match is not None:
131131
if msg is not None:
132132
self.cc_info(msg)
@@ -143,7 +143,7 @@ def parse_output(self, output):
143143
}
144144
elif msg is not None:
145145
# Determine the warning/error column by calculating the ^ position
146-
match = GCC.INDEX_PATTERN.match(line)
146+
match = self.INDEX_PATTERN.match(line)
147147
if match is not None:
148148
msg['col'] = len(match.group('col'))
149149
self.cc_info(msg)
@@ -280,46 +280,12 @@ def make_ld_define(name, value):
280280
def redirect_symbol(source, sync, build_dir):
281281
return "-Wl,--defsym=%s=%s" % (source, sync)
282282

283-
284-
class GCC_ARM(GCC):
285283
@staticmethod
286284
def check_executable():
287285
"""Returns True if the executable (arm-none-eabi-gcc) location
288286
specified by the user exists OR the executable can be found on the PATH.
289287
Returns False otherwise."""
290288
return mbedToolchain.generic_check_executable("GCC_ARM", 'arm-none-eabi-gcc', 1)
291289

292-
def __init__(self, target, notify=None, macros=None,
293-
silent=False, extra_verbose=False, build_profile=None):
294-
GCC.__init__(self, target, notify, macros, silent,
295-
TOOLCHAIN_PATHS['GCC_ARM'], extra_verbose=extra_verbose,
296-
build_profile=build_profile)
297-
298-
self.sys_libs.append("nosys")
299-
300-
301-
class GCC_CR(GCC):
302-
@staticmethod
303-
def check_executable():
304-
"""Returns True if the executable (arm-none-eabi-gcc) location
305-
specified by the user exists OR the executable can be found on the PATH.
306-
Returns False otherwise."""
307-
return mbedToolchain.generic_check_executable("GCC_CR", 'arm-none-eabi-gcc', 1)
308-
309-
def __init__(self, target, notify=None, macros=None,
310-
silent=False, extra_verbose=False, build_profile=None):
311-
GCC.__init__(self, target, notify, macros, silent,
312-
TOOLCHAIN_PATHS['GCC_CR'], extra_verbose=extra_verbose,
313-
build_profile=build_profile)
314-
315-
additional_compiler_flags = [
316-
"-D__NEWLIB__", "-D__CODE_RED", "-D__USE_CMSIS", "-DCPP_USE_HEAP",
317-
]
318-
self.cc += additional_compiler_flags
319-
self.cppc += additional_compiler_flags
320-
321-
# Use latest gcc nanolib
322-
self.ld.append("--specs=nano.specs")
323-
if target.name in ["LPC1768", "LPC4088", "LPC4088_DM", "LPC4330", "UBLOX_C027", "LPC2368"]:
324-
self.ld.extend(["-u _printf_float", "-u _scanf_float"])
325-
self.ld += ["-nostdlib"]
290+
class GCC_ARM(GCC):
291+
pass

0 commit comments

Comments
 (0)