nkjnm

Dependencies:   MAX44000 nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Committer:
nitsshukla
Date:
Fri Nov 04 12:06:04 2016 +0000
Revision:
7:3a65ef12ba31
Parent:
1:55a6170b404f
kghj;

Who changed what in which revision?

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