mirror of https://github.com/ARMmbed/mbed-os.git
Proper fix for Cortex-M/Cortex-A RTOS issue
Created two new labels (CORTEX_A and CORTEX_M) that can be used to differentiate between Cortex-A and Cortex-M code in the build system.pull/663/head
parent
b5c8a23e79
commit
45ddf10698
|
@ -37,14 +37,6 @@ from workspace_tools.build_api import static_analysis_scan, static_analysis_scan
|
||||||
from workspace_tools.build_api import print_build_results
|
from workspace_tools.build_api import print_build_results
|
||||||
from workspace_tools.settings import CPPCHECK_CMD, CPPCHECK_MSG_FORMAT
|
from workspace_tools.settings import CPPCHECK_CMD, CPPCHECK_MSG_FORMAT
|
||||||
|
|
||||||
# Cortex-M and Cortex-A use different RTOS sources, return the proper libs here
|
|
||||||
def get_rtos_libs(options, mcu):
|
|
||||||
if options.rtos:
|
|
||||||
libs = ['rtx', 'rtos'] if mcu.core != 'Cortex-A9' else ['rtx_ca', 'rtos_ca']
|
|
||||||
else:
|
|
||||||
libs = []
|
|
||||||
return libs
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
start = time()
|
start = time()
|
||||||
|
|
||||||
|
@ -163,6 +155,8 @@ if __name__ == '__main__':
|
||||||
libraries = []
|
libraries = []
|
||||||
|
|
||||||
# Additional Libraries
|
# Additional Libraries
|
||||||
|
if options.rtos:
|
||||||
|
libraries.extend(["rtx", "rtos"])
|
||||||
if options.eth:
|
if options.eth:
|
||||||
libraries.append("eth")
|
libraries.append("eth")
|
||||||
if options.usb:
|
if options.usb:
|
||||||
|
@ -191,7 +185,7 @@ if __name__ == '__main__':
|
||||||
mcu = TARGET_MAP[target]
|
mcu = TARGET_MAP[target]
|
||||||
# CMSIS and MBED libs analysis
|
# CMSIS and MBED libs analysis
|
||||||
static_analysis_scan(mcu, toolchain, CPPCHECK_CMD, CPPCHECK_MSG_FORMAT, verbose=options.verbose, jobs=options.jobs)
|
static_analysis_scan(mcu, toolchain, CPPCHECK_CMD, CPPCHECK_MSG_FORMAT, verbose=options.verbose, jobs=options.jobs)
|
||||||
for lib_id in libraries + get_rtos_libs(options, mcu):
|
for lib_id in libraries:
|
||||||
# Static check for library
|
# Static check for library
|
||||||
static_analysis_scan_lib(lib_id, mcu, toolchain, CPPCHECK_CMD, CPPCHECK_MSG_FORMAT,
|
static_analysis_scan_lib(lib_id, mcu, toolchain, CPPCHECK_CMD, CPPCHECK_MSG_FORMAT,
|
||||||
options=options.options,
|
options=options.options,
|
||||||
|
@ -214,7 +208,7 @@ if __name__ == '__main__':
|
||||||
lib_build_res = build_mbed_libs(mcu, toolchain, options=options.options,
|
lib_build_res = build_mbed_libs(mcu, toolchain, options=options.options,
|
||||||
notify=notify, verbose=options.verbose, jobs=options.jobs, clean=options.clean,
|
notify=notify, verbose=options.verbose, jobs=options.jobs, clean=options.clean,
|
||||||
macros=options.macros)
|
macros=options.macros)
|
||||||
for lib_id in libraries + get_rtos_libs(options, mcu):
|
for lib_id in libraries:
|
||||||
notify = print_notify_verbose if options.extra_verbose_notify else None # Special notify for CI (more verbose)
|
notify = print_notify_verbose if options.extra_verbose_notify else None # Special notify for CI (more verbose)
|
||||||
build_lib(lib_id, mcu, toolchain, options=options.options,
|
build_lib(lib_id, mcu, toolchain, options=options.options,
|
||||||
notify=notify, verbose=options.verbose, clean=options.clean,
|
notify=notify, verbose=options.verbose, clean=options.clean,
|
||||||
|
|
|
@ -33,18 +33,6 @@ LIBRARIES = [
|
||||||
"build_dir": RTOS_LIBRARIES,
|
"build_dir": RTOS_LIBRARIES,
|
||||||
"dependencies": [MBED_LIBRARIES, MBED_RTX],
|
"dependencies": [MBED_LIBRARIES, MBED_RTX],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "rtx_ca",
|
|
||||||
"source_dir": MBED_RTX_CA,
|
|
||||||
"build_dir": RTOS_LIBRARIES,
|
|
||||||
"dependencies": [MBED_LIBRARIES],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "rtos_ca",
|
|
||||||
"source_dir": RTOS_ABSTRACTION,
|
|
||||||
"build_dir": RTOS_LIBRARIES,
|
|
||||||
"dependencies": [MBED_LIBRARIES, MBED_RTX_CA],
|
|
||||||
},
|
|
||||||
|
|
||||||
# USB Device libraries
|
# USB Device libraries
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,6 @@ MBED_RPC = join(LIB_DIR, "rpc")
|
||||||
# mbed RTOS
|
# mbed RTOS
|
||||||
RTOS = join(LIB_DIR, "rtos")
|
RTOS = join(LIB_DIR, "rtos")
|
||||||
MBED_RTX = join(RTOS, "rtx")
|
MBED_RTX = join(RTOS, "rtx")
|
||||||
MBED_RTX_CA = join(RTOS, "rtx_ca")
|
|
||||||
RTOS_ABSTRACTION = join(RTOS, "rtos")
|
RTOS_ABSTRACTION = join(RTOS, "rtos")
|
||||||
|
|
||||||
RTOS_LIBRARIES = join(BUILD_DIR, "rtos")
|
RTOS_LIBRARIES = join(BUILD_DIR, "rtos")
|
||||||
|
|
|
@ -16,13 +16,13 @@ limitations under the License.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
CORE_LABELS = {
|
CORE_LABELS = {
|
||||||
"ARM7TDMI-S": "ARM7",
|
"ARM7TDMI-S": ["ARM7"],
|
||||||
"Cortex-M0" : "M0",
|
"Cortex-M0" : ["M0", "CORTEX_M"],
|
||||||
"Cortex-M0+": "M0P",
|
"Cortex-M0+": ["M0P", "CORTEX_M"],
|
||||||
"Cortex-M3" : "M3",
|
"Cortex-M3" : ["M3", "CORTEX_M"],
|
||||||
"Cortex-M4" : "M4",
|
"Cortex-M4" : ["M4", "CORTEX_M"],
|
||||||
"Cortex-M4F" : "M4",
|
"Cortex-M4F" : ["M4", "CORTEX_M"],
|
||||||
"Cortex-A9" : "A9"
|
"Cortex-A9" : ["A9", "CORTEX_A"]
|
||||||
}
|
}
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -58,7 +58,7 @@ class Target:
|
||||||
return 4 if self.is_disk_virtual else 1.5
|
return 4 if self.is_disk_virtual else 1.5
|
||||||
|
|
||||||
def get_labels(self):
|
def get_labels(self):
|
||||||
return [self.name, CORE_LABELS[self.core]] + self.extra_labels
|
return [self.name] + CORE_LABELS[self.core] + self.extra_labels
|
||||||
|
|
||||||
def init_hooks(self, hook, toolchain_name):
|
def init_hooks(self, hook, toolchain_name):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue