mirror of https://github.com/ARMmbed/mbed-os.git
Add STM32 to the buildchain
parent
d18875bee3
commit
40abe5fb74
|
@ -144,6 +144,8 @@ CHIP_VENDOR = {
|
||||||
"LPC812" : "nxp",
|
"LPC812" : "nxp",
|
||||||
|
|
||||||
"KL25Z" : "freescale",
|
"KL25Z" : "freescale",
|
||||||
|
|
||||||
|
"STM32F407": "stm",
|
||||||
}
|
}
|
||||||
|
|
||||||
def build_mbed_libs(target, toolchain, verbose=False):
|
def build_mbed_libs(target, toolchain, verbose=False):
|
||||||
|
|
|
@ -4,10 +4,11 @@ DEFAULT_SUPPORT = {
|
||||||
"LPC2368" : ["ARM"],
|
"LPC2368" : ["ARM"],
|
||||||
"KL25Z" : ["ARM", "GCC_CW"],
|
"KL25Z" : ["ARM", "GCC_CW"],
|
||||||
"LPC812" : ["uARM"],
|
"LPC812" : ["uARM"],
|
||||||
|
"STM32F407" : ["GCC_ARM"]
|
||||||
}
|
}
|
||||||
CORTEX_ARM_SUPPORT = {
|
CORTEX_ARM_SUPPORT = {
|
||||||
"LPC1768" : ["ARM"],
|
"LPC1768" : ["ARM"],
|
||||||
"LPC11U24": ["ARM", "uARM"],
|
"LPC11U24": ["ARM", "uARM"],
|
||||||
"KL25Z" : ["ARM"],
|
"KL25Z" : ["ARM"],
|
||||||
"LPC812" : ["uARM"],
|
"LPC812" : ["uARM"],
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,22 @@ LIBRARIES = [
|
||||||
"dependencies": [MBED_LIBRARIES],
|
"dependencies": [MBED_LIBRARIES],
|
||||||
"supported": DEFAULT_SUPPORT
|
"supported": DEFAULT_SUPPORT
|
||||||
},
|
},
|
||||||
|
|
||||||
|
# STM
|
||||||
|
{
|
||||||
|
"id": "stm_cmsis",
|
||||||
|
"source_dir": join(STM, "cmsis"),
|
||||||
|
"build_dir": MBED_LIBRARIES,
|
||||||
|
"supported": DEFAULT_SUPPORT
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "stm_mbed",
|
||||||
|
"name": "mbed",
|
||||||
|
"source_dir": [join(STM, "capi"), MBED_CAPI, MBED_CPP],
|
||||||
|
"build_dir": MBED_LIBRARIES,
|
||||||
|
"dependencies": [MBED_LIBRARIES],
|
||||||
|
"supported": DEFAULT_SUPPORT
|
||||||
|
},
|
||||||
|
|
||||||
# RTOS libraries
|
# RTOS libraries
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,7 @@ MBED_RPC = join(MBED_BASE, "rpc")
|
||||||
VENDOR = join(MBED_BASE, "vendor")
|
VENDOR = join(MBED_BASE, "vendor")
|
||||||
NXP = join(VENDOR, "NXP")
|
NXP = join(VENDOR, "NXP")
|
||||||
FREESCALE = join(VENDOR, "Freescale")
|
FREESCALE = join(VENDOR, "Freescale")
|
||||||
|
STM = join(VENDOR, "STM")
|
||||||
|
|
||||||
MBED_LIBRARIES = join(BUILD_DIR, "mbed")
|
MBED_LIBRARIES = join(BUILD_DIR, "mbed")
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ type directory, because it would get confused with the legacy "ARM" toolchain.
|
||||||
* ARM -> ARM_STD
|
* ARM -> ARM_STD
|
||||||
* uARM -> ARM_MICRO
|
* uARM -> ARM_MICRO
|
||||||
"""
|
"""
|
||||||
TARGETS = set(['LPC1768', 'LPC11U24', 'LPC2368', 'KL25Z', 'LPC812'])
|
TARGETS = set(['LPC1768', 'LPC11U24', 'LPC2368', 'KL25Z', 'LPC812', "STM32F407"])
|
||||||
TOOLCHAINS = set(['ARM', 'uARM', 'GCC_ARM', 'GCC_CS', 'GCC_CR', 'GCC_CW', 'IAR'])
|
TOOLCHAINS = set(['ARM', 'uARM', 'GCC_ARM', 'GCC_CS', 'GCC_CR', 'GCC_CW', 'IAR'])
|
||||||
TYPES = set(['GCC'])
|
TYPES = set(['GCC'])
|
||||||
|
|
||||||
|
@ -130,6 +130,7 @@ class mbedToolchain:
|
||||||
"LPC11U24": ["__CORTEX_M0", "ARM_MATH_CM0"],
|
"LPC11U24": ["__CORTEX_M0", "ARM_MATH_CM0"],
|
||||||
"KL25Z" : ["__CORTEX_M0", "ARM_MATH_CM0"],
|
"KL25Z" : ["__CORTEX_M0", "ARM_MATH_CM0"],
|
||||||
"LPC812" : ["__CORTEX_M0", "ARM_MATH_CM0"],
|
"LPC812" : ["__CORTEX_M0", "ARM_MATH_CM0"],
|
||||||
|
"STM32F407" : ["__CORTEX_M4", "ARM_MATH_CM4"],
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, target, notify=None):
|
def __init__(self, target, notify=None):
|
||||||
|
@ -325,6 +326,8 @@ class mbedToolchain:
|
||||||
|
|
||||||
if hasattr(self, "cc_extra"):
|
if hasattr(self, "cc_extra"):
|
||||||
command.extend(self.cc_extra(base))
|
command.extend(self.cc_extra(base))
|
||||||
|
|
||||||
|
print " ".join(command)
|
||||||
|
|
||||||
self.debug(command)
|
self.debug(command)
|
||||||
_, stderr, rc = run_cmd(command, dirname(object), chroot=self.CHROOT)
|
_, stderr, rc = run_cmd(command, dirname(object), chroot=self.CHROOT)
|
||||||
|
@ -524,6 +527,7 @@ class GCC(mbedToolchain):
|
||||||
"LPC11U24": "cortex-m0",
|
"LPC11U24": "cortex-m0",
|
||||||
"KL25Z": "cortex-m0",
|
"KL25Z": "cortex-m0",
|
||||||
"LPC812" : "cortex-m0",
|
"LPC812" : "cortex-m0",
|
||||||
|
"STM32F407" : "cortex-m4",
|
||||||
}
|
}
|
||||||
|
|
||||||
STD_LIB_NAME = "lib%s.a"
|
STD_LIB_NAME = "lib%s.a"
|
||||||
|
@ -534,7 +538,7 @@ class GCC(mbedToolchain):
|
||||||
mbedToolchain.__init__(self, target, notify)
|
mbedToolchain.__init__(self, target, notify)
|
||||||
self.IGNORE_DIR.remove('GCC')
|
self.IGNORE_DIR.remove('GCC')
|
||||||
self.cpu = ["-mcpu=%s" % GCC.CPU[target]]
|
self.cpu = ["-mcpu=%s" % GCC.CPU[target]]
|
||||||
if target in ["LPC1768", "LPC11U24", "KL25Z", "LPC812"]:
|
if target in ["LPC1768", "LPC11U24", "KL25Z", "LPC812", "STM32F407"]:
|
||||||
self.cpu.append("-mthumb")
|
self.cpu.append("-mthumb")
|
||||||
|
|
||||||
# Note: We are using "-O2" instead of "-Os" to avoid this known GCC bug:
|
# Note: We are using "-O2" instead of "-Os" to avoid this known GCC bug:
|
||||||
|
@ -627,7 +631,7 @@ class GCC_ARM(GCC):
|
||||||
|
|
||||||
# Use latest gcc nanolib
|
# Use latest gcc nanolib
|
||||||
self.ld.append("--specs=nano.specs")
|
self.ld.append("--specs=nano.specs")
|
||||||
if target in ["LPC1768"]:
|
if target in ["LPC1768", "STM32F407"]:
|
||||||
self.ld.extend(["-u", "_printf_float", "-u", "_scanf_float"])
|
self.ld.extend(["-u", "_printf_float", "-u", "_scanf_float"])
|
||||||
|
|
||||||
self.sys_libs.append("nosys")
|
self.sys_libs.append("nosys")
|
||||||
|
|
Loading…
Reference in New Issue