Includes library modifications to allow access to AIN_4 (AIN_0 / 5)

Committer:
bryantaylor
Date:
Tue Sep 20 21:26:12 2016 +0000
Revision:
0:eafc3fd41f75
hackathon

Who changed what in which revision?

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