2013-06-24 13:32:08 +00:00
|
|
|
CORE_LABELS = {
|
|
|
|
"ARM7TDMI-S": "ARM7",
|
|
|
|
"Cortex-M0" : "M0",
|
|
|
|
"Cortex-M0+": "M0P",
|
|
|
|
"Cortex-M3" : "M3",
|
|
|
|
"Cortex-M4" : "M4"
|
|
|
|
}
|
|
|
|
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
class Target:
|
|
|
|
def __init__(self):
|
|
|
|
# ARM Core
|
|
|
|
self.core = None
|
|
|
|
|
|
|
|
# How much time (in seconds) it takes to the interface chip to flash a
|
|
|
|
# new image and reset the target chip
|
|
|
|
self.program_cycle_s = 1.5
|
|
|
|
|
|
|
|
# list of toolchains that are supported by the mbed SDK for this target
|
|
|
|
self.supported_toolchains = None
|
|
|
|
|
2013-06-24 13:32:08 +00:00
|
|
|
# list of extra specific labels
|
|
|
|
self.extra_labels = []
|
|
|
|
|
2013-04-18 14:43:29 +00:00
|
|
|
self.name = self.__class__.__name__
|
2013-06-24 13:32:08 +00:00
|
|
|
|
|
|
|
def get_labels(self):
|
|
|
|
return [self.name, CORE_LABELS[self.core]] + self.extra_labels
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LPC2368(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "ARM7TDMI-S"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC23XX']
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM"]
|
|
|
|
|
|
|
|
|
|
|
|
class LPC1768(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M3"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC176X']
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM", "GCC_ARM", "GCC_CS", "GCC_CR", "IAR"]
|
|
|
|
|
|
|
|
|
|
|
|
class LPC11U24(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M0"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC11UXX']
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM", "uARM"]
|
|
|
|
|
|
|
|
|
2013-06-23 16:22:46 +00:00
|
|
|
class KL05Z(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M0+"
|
2013-07-04 15:57:52 +00:00
|
|
|
|
|
|
|
self.extra_labels = ['Freescale']
|
2013-06-23 16:22:46 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM"]
|
|
|
|
|
|
|
|
self.program_cycle_s = 4
|
|
|
|
|
|
|
|
|
2013-04-18 14:43:29 +00:00
|
|
|
class KL25Z(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M0+"
|
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['Freescale']
|
|
|
|
|
2013-05-10 15:36:40 +00:00
|
|
|
self.supported_toolchains = ["ARM", "GCC_CW_EWL", "GCC_CW_NEWLIB"]
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
self.program_cycle_s = 4
|
|
|
|
|
|
|
|
|
|
|
|
class LPC812(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M0+"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC81X']
|
2013-04-18 14:43:29 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["uARM"]
|
|
|
|
|
|
|
|
self.program_cycle_s = 4
|
|
|
|
|
|
|
|
|
2013-05-16 06:53:02 +00:00
|
|
|
class LPC4088(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
|
|
|
self.core = "Cortex-M4"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC408X']
|
2013-05-16 06:53:02 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM", "GCC_CR"]
|
2013-06-23 16:22:46 +00:00
|
|
|
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-06-25 06:20:08 +00:00
|
|
|
class LPC4330(Target):
|
2013-06-19 12:10:44 +00:00
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
2013-06-25 06:20:08 +00:00
|
|
|
|
2013-05-16 06:53:02 +00:00
|
|
|
self.core = "Cortex-M4"
|
2013-06-25 06:20:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['NXP', 'LPC43XX']
|
2013-06-25 06:20:08 +00:00
|
|
|
|
|
|
|
self.supported_toolchains = ["ARM", "GCC_CR", "IAR"]
|
2013-06-23 16:22:46 +00:00
|
|
|
|
2013-06-26 12:34:34 +00:00
|
|
|
class STM32F407(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
|
|
|
|
2013-06-19 12:10:44 +00:00
|
|
|
self.core = "Cortex-M4"
|
2013-07-03 16:14:43 +00:00
|
|
|
|
|
|
|
self.extra_labels = ['STM', 'STM32F4XX']
|
|
|
|
|
2013-06-19 12:10:44 +00:00
|
|
|
self.supported_toolchains = ["GCC_ARM"]
|
2013-05-16 06:53:02 +00:00
|
|
|
|
2013-06-23 16:22:46 +00:00
|
|
|
|
2013-04-26 16:34:42 +00:00
|
|
|
class MBED_MCU(Target):
|
|
|
|
def __init__(self):
|
|
|
|
Target.__init__(self)
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-04-26 16:34:42 +00:00
|
|
|
self.core = "Cortex-M0+"
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-07-03 16:14:43 +00:00
|
|
|
self.extra_labels = ['ARM']
|
|
|
|
|
2013-04-26 16:34:42 +00:00
|
|
|
self.supported_toolchains = ["ARM"]
|
|
|
|
|
2013-06-24 13:32:08 +00:00
|
|
|
|
2013-04-18 14:43:29 +00:00
|
|
|
# Get a single instance for each target
|
|
|
|
TARGETS = [
|
|
|
|
LPC2368(),
|
|
|
|
LPC1768(),
|
|
|
|
LPC11U24(),
|
2013-06-23 16:22:46 +00:00
|
|
|
KL05Z(),
|
2013-04-18 14:43:29 +00:00
|
|
|
KL25Z(),
|
2013-04-26 16:34:42 +00:00
|
|
|
LPC812(),
|
2013-05-16 06:53:02 +00:00
|
|
|
LPC4088(),
|
2013-06-25 06:20:08 +00:00
|
|
|
LPC4330(),
|
2013-06-19 12:10:44 +00:00
|
|
|
STM32F407(),
|
2013-04-26 16:34:42 +00:00
|
|
|
MBED_MCU()
|
2013-04-18 14:43:29 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# Map each target name to its unique instance
|
|
|
|
TARGET_MAP = {}
|
|
|
|
for t in TARGETS:
|
|
|
|
TARGET_MAP[t.name] = t
|
|
|
|
|
|
|
|
TARGET_NAMES = TARGET_MAP.keys()
|