Maxim mbed development library

Dependents:   sensomed

Committer:
switches
Date:
Tue Nov 08 18:27:11 2016 +0000
Revision:
0:0e018d759a2a
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:0e018d759a2a 1 #!/usr/bin/env python2
switches 0:0e018d759a2a 2
switches 0:0e018d759a2a 3 """
switches 0:0e018d759a2a 4 Travis-CI build script
switches 0:0e018d759a2a 5
switches 0:0e018d759a2a 6 mbed SDK
switches 0:0e018d759a2a 7 Copyright (c) 2011-2013 ARM Limited
switches 0:0e018d759a2a 8
switches 0:0e018d759a2a 9 Licensed under the Apache License, Version 2.0 (the "License");
switches 0:0e018d759a2a 10 you may not use this file except in compliance with the License.
switches 0:0e018d759a2a 11 You may obtain a copy of the License at
switches 0:0e018d759a2a 12
switches 0:0e018d759a2a 13 http://www.apache.org/licenses/LICENSE-2.0
switches 0:0e018d759a2a 14
switches 0:0e018d759a2a 15 Unless required by applicable law or agreed to in writing, software
switches 0:0e018d759a2a 16 distributed under the License is distributed on an "AS IS" BASIS,
switches 0:0e018d759a2a 17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
switches 0:0e018d759a2a 18 See the License for the specific language governing permissions and
switches 0:0e018d759a2a 19 limitations under the License.
switches 0:0e018d759a2a 20 """
switches 0:0e018d759a2a 21
switches 0:0e018d759a2a 22 import os
switches 0:0e018d759a2a 23 import sys
switches 0:0e018d759a2a 24
switches 0:0e018d759a2a 25 ################################################################################
switches 0:0e018d759a2a 26 # Configure builds here
switches 0:0e018d759a2a 27 # "libs" can contain "dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat"
switches 0:0e018d759a2a 28
switches 0:0e018d759a2a 29 build_list = (
switches 0:0e018d759a2a 30 { "target": "LPC1768", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "eth", "usb_host", "usb", "ublox", "fat"] },
switches 0:0e018d759a2a 31 { "target": "LPC2368", "toolchains": "GCC_ARM", "libs": ["fat"] },
switches 0:0e018d759a2a 32 { "target": "LPC2460", "toolchains": "GCC_ARM", "libs": ["rtos", "usb_host", "usb", "fat"] },
switches 0:0e018d759a2a 33 { "target": "LPC11U24", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 34 { "target": "OC_MBUINO", "toolchains": "GCC_ARM", "libs": ["fat"] },
switches 0:0e018d759a2a 35
switches 0:0e018d759a2a 36 { "target": "LPC11U24_301", "toolchains": "GCC_ARM", "libs": ["fat"] },
switches 0:0e018d759a2a 37
switches 0:0e018d759a2a 38 { "target": "B96B_F446VE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 39 { "target": "NUCLEO_L053R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 40 { "target": "NUCLEO_L152RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 41 { "target": "NUCLEO_F030R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 42 { "target": "NUCLEO_F031K6", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 43 { "target": "NUCLEO_F042K6", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 44 { "target": "NUCLEO_F070RB", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 45 { "target": "NUCLEO_F072RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 46 { "target": "NUCLEO_F091RC", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 47 { "target": "NUCLEO_F103RB", "toolchains": "GCC_ARM", "libs": ["rtos", "fat"] },
switches 0:0e018d759a2a 48 { "target": "NUCLEO_F207ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 49 { "target": "NUCLEO_F302R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 50 { "target": "NUCLEO_F303K8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 51 { "target": "NUCLEO_F303RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 52 { "target": "NUCLEO_F303ZE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 53 { "target": "NUCLEO_F334R8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 54 { "target": "NUCLEO_F401RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 55 { "target": "NUCLEO_F410RB", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 56 { "target": "NUCLEO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 57 { "target": "NUCLEO_L432KC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 58 { "target": "NUCLEO_L476RG", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 59 { "target": "NUCLEO_L011K4", "toolchains": "GCC_ARM", "libs": ["dsp"] },
switches 0:0e018d759a2a 60 { "target": "NUCLEO_L031K6", "toolchains": "GCC_ARM", "libs": ["dsp"] },
switches 0:0e018d759a2a 61 { "target": "NUCLEO_L073RZ", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 62 { "target": "NUCLEO_F429ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 63 { "target": "NUCLEO_F446RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 64 { "target": "NUCLEO_F446ZE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 65 { "target": "NUCLEO_F746ZG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 66 { "target": "NUCLEO_F767ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 67
switches 0:0e018d759a2a 68 { "target": "MOTE_L152RC", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 69
switches 0:0e018d759a2a 70 { "target": "ELMO_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 71
switches 0:0e018d759a2a 72 { "target": "MTS_MDOT_F405RG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] },
switches 0:0e018d759a2a 73 { "target": "MTS_MDOT_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] },
switches 0:0e018d759a2a 74 { "target": "MTS_DRAGONFLY_F411RE", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 75 { "target": "ARCH_MAX", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 76
switches 0:0e018d759a2a 77 { "target": "DISCO_F051R8", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 78 { "target": "DISCO_F334C8", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 79 { "target": "DISCO_F401VC", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 80 { "target": "DISCO_F407VG", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 81 { "target": "DISCO_F429ZI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 82 { "target": "DISCO_F469NI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 83 { "target": "DISCO_F746NG", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 84 { "target": "DISCO_F769NI", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 85
switches 0:0e018d759a2a 86 { "target": "LPC1114", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 87 { "target": "LPC11U35_401", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 88 { "target": "UBLOX_C027", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 89 { "target": "LPC11U35_501", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 90 { "target": "LPC11U68", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 91 { "target": "LPC11U37H_401", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 92
switches 0:0e018d759a2a 93 { "target": "KL05Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 94 { "target": "KL25Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 95 { "target": "KL27Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 96 { "target": "KL43Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 97 { "target": "KL46Z", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 98 { "target": "K20D50M", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 99 { "target": "TEENSY3_1", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 100 { "target": "K64F", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 101 { "target": "K22F", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 102 { "target": "LPC4088", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb", "fat"] },
switches 0:0e018d759a2a 103 { "target": "ARCH_PRO", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 104 { "target": "LPC1549", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 105 { "target": "NRF51822", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 106 { "target": "DELTA_DFCM_NNN40", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 107 { "target": "NRF51_DK", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 108 { "target": "NRF51_MICROBIT", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "fat"] },
switches 0:0e018d759a2a 109
switches 0:0e018d759a2a 110 { "target": "EFM32ZG_STK3200", "toolchains": "GCC_ARM", "libs": ["dsp"] },
switches 0:0e018d759a2a 111 { "target": "EFM32HG_STK3400", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
switches 0:0e018d759a2a 112 { "target": "EFM32LG_STK3600", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
switches 0:0e018d759a2a 113 { "target": "EFM32GG_STK3700", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
switches 0:0e018d759a2a 114 { "target": "EFM32WG_STK3800", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos", "usb"] },
switches 0:0e018d759a2a 115 { "target": "EFM32PG_STK3401", "toolchains": "GCC_ARM", "libs": ["dsp", "rtos"] },
switches 0:0e018d759a2a 116
switches 0:0e018d759a2a 117 { "target": "MAXWSNENV", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 118 { "target": "MAX32600MBED", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 119 { "target": "MAX32620HSP", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 120
switches 0:0e018d759a2a 121 { "target": "RZ_A1H", "toolchains": "GCC_ARM", "libs": ["fat"] },
switches 0:0e018d759a2a 122
switches 0:0e018d759a2a 123 { "target": "SAMR21G18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 124 { "target": "SAMD21J18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 125 { "target": "SAMD21G18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 126 { "target": "SAML21J18A", "toolchains": "GCC_ARM", "libs": ["dsp", "fat"] },
switches 0:0e018d759a2a 127 )
switches 0:0e018d759a2a 128
switches 0:0e018d759a2a 129 ################################################################################
switches 0:0e018d759a2a 130 # Configure example test building (linking against external mbed SDK libraries liek fat or rtos)
switches 0:0e018d759a2a 131
switches 0:0e018d759a2a 132 linking_list = [
switches 0:0e018d759a2a 133 {"target": "LPC1768",
switches 0:0e018d759a2a 134 "toolchains": "GCC_ARM",
switches 0:0e018d759a2a 135 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
switches 0:0e018d759a2a 136 "eth" : ["NET_1", "NET_2", "NET_3", "NET_4"],
switches 0:0e018d759a2a 137 "fat" : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
switches 0:0e018d759a2a 138 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
switches 0:0e018d759a2a 139 "usb" : ["USB_1", "USB_2" ,"USB_3"],
switches 0:0e018d759a2a 140 }
switches 0:0e018d759a2a 141 },
switches 0:0e018d759a2a 142 {"target": "K64F",
switches 0:0e018d759a2a 143 "toolchains": "GCC_ARM",
switches 0:0e018d759a2a 144 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_16"],
switches 0:0e018d759a2a 145 "fat" : ["MBED_A12", "PERF_1", "PERF_2", "PERF_3"],
switches 0:0e018d759a2a 146 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
switches 0:0e018d759a2a 147 "usb" : ["USB_1", "USB_2" ,"USB_3"],
switches 0:0e018d759a2a 148 }
switches 0:0e018d759a2a 149 },
switches 0:0e018d759a2a 150 {"target": "K22F",
switches 0:0e018d759a2a 151 "toolchains": "GCC_ARM",
switches 0:0e018d759a2a 152 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_16"],
switches 0:0e018d759a2a 153 "fat" : ["MBED_A12", "PERF_1", "PERF_2", "PERF_3"],
switches 0:0e018d759a2a 154 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
switches 0:0e018d759a2a 155 "usb" : ["USB_1", "USB_2" ,"USB_3"],
switches 0:0e018d759a2a 156 }
switches 0:0e018d759a2a 157 },
switches 0:0e018d759a2a 158 {"target": "KL43Z",
switches 0:0e018d759a2a 159 "toolchains": "GCC_ARM",
switches 0:0e018d759a2a 160 "tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_16"],
switches 0:0e018d759a2a 161 "fat" : ["MBED_A12", "PERF_1", "PERF_2", "PERF_3"],
switches 0:0e018d759a2a 162 "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
switches 0:0e018d759a2a 163 "usb" : ["USB_1", "USB_2" ,"USB_3"],
switches 0:0e018d759a2a 164 }
switches 0:0e018d759a2a 165 }
switches 0:0e018d759a2a 166 ]
switches 0:0e018d759a2a 167
switches 0:0e018d759a2a 168 ################################################################################
switches 0:0e018d759a2a 169
switches 0:0e018d759a2a 170 # Driver
switches 0:0e018d759a2a 171
switches 0:0e018d759a2a 172 def run_builds(dry_run):
switches 0:0e018d759a2a 173 for build in build_list:
switches 0:0e018d759a2a 174 toolchain_list = build["toolchains"]
switches 0:0e018d759a2a 175 if type(toolchain_list) != type([]): toolchain_list = [toolchain_list]
switches 0:0e018d759a2a 176 for toolchain in toolchain_list:
switches 0:0e018d759a2a 177 cmdline = "python tools/build.py -m %s -t %s -j 4 -c --silent "% (build["target"], toolchain)
switches 0:0e018d759a2a 178 libs = build.get("libs", [])
switches 0:0e018d759a2a 179 if libs:
switches 0:0e018d759a2a 180 cmdline = cmdline + " ".join(["--" + l for l in libs])
switches 0:0e018d759a2a 181 print "Executing: " + cmdline
switches 0:0e018d759a2a 182 if not dry_run:
switches 0:0e018d759a2a 183 if os.system(cmdline) != 0:
switches 0:0e018d759a2a 184 sys.exit(1)
switches 0:0e018d759a2a 185
switches 0:0e018d759a2a 186
switches 0:0e018d759a2a 187 def run_test_linking(dry_run):
switches 0:0e018d759a2a 188 """ Function run make.py commands to build and link simple mbed SDK
switches 0:0e018d759a2a 189 tests against few libraries to make sure there are no simple linking errors.
switches 0:0e018d759a2a 190 """
switches 0:0e018d759a2a 191 for link in linking_list:
switches 0:0e018d759a2a 192 toolchain_list = link["toolchains"]
switches 0:0e018d759a2a 193 if type(toolchain_list) != type([]):
switches 0:0e018d759a2a 194 toolchain_list = [toolchain_list]
switches 0:0e018d759a2a 195 for toolchain in toolchain_list:
switches 0:0e018d759a2a 196 tests = link["tests"]
switches 0:0e018d759a2a 197 # Call make.py for each test group for particular library
switches 0:0e018d759a2a 198 for test_lib in tests:
switches 0:0e018d759a2a 199 test_names = tests[test_lib]
switches 0:0e018d759a2a 200 test_lib_switch = "--" + test_lib if test_lib else ""
switches 0:0e018d759a2a 201 cmdline = "python tools/make.py -m %s -t %s -c --silent %s -n %s " % (link["target"], toolchain, test_lib_switch, ",".join(test_names))
switches 0:0e018d759a2a 202 print "Executing: " + cmdline
switches 0:0e018d759a2a 203 if not dry_run:
switches 0:0e018d759a2a 204 if os.system(cmdline) != 0:
switches 0:0e018d759a2a 205 sys.exit(1)
switches 0:0e018d759a2a 206
switches 0:0e018d759a2a 207 def run_test_testsuite(dry_run):
switches 0:0e018d759a2a 208 cmdline = "python tools/singletest.py --version"
switches 0:0e018d759a2a 209 print "Executing: " + cmdline
switches 0:0e018d759a2a 210 if not dry_run:
switches 0:0e018d759a2a 211 if os.system(cmdline) != 0:
switches 0:0e018d759a2a 212 sys.exit(1)
switches 0:0e018d759a2a 213
switches 0:0e018d759a2a 214 if __name__ == "__main__":
switches 0:0e018d759a2a 215 run_builds("-s" in sys.argv)
switches 0:0e018d759a2a 216 run_test_linking("-s" in sys.argv)
switches 0:0e018d759a2a 217 run_test_testsuite("-s" in sys.argv)