mbed_wifi_MQTT_PM25

Dependencies:   mbed-os-example-wifi-DISCO_IOTBOARD_MQTT MQTT

Committer:
adustm adustm@gmail.com
Date:
Thu Feb 15 10:34:31 2018 +0100
Revision:
55:23a0d1e8270a
Parent:
54:b9963ccc0c2d
Child:
57:c8c960b825f0
Update main.cpp / mbed_app.json and Readme for DISCO_L475VG_IOT01A wifi module
Add mbed_app_ism43362.json + wifi-ism43362.lib

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 43:45429aa163a0 1 properties ([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [
mbed_official 43:45429aa163a0 2 [$class: 'StringParameterDefinition', name: 'mbed_os_revision', defaultValue: '', description: 'Revision of mbed-os to build. Use format "pull/PR-NUMBER/head" to access mbed-os PR']
mbed_official 43:45429aa163a0 3 ]]])
mbed_official 43:45429aa163a0 4
mbed_official 43:45429aa163a0 5 if (params.mbed_os_revision == '') {
mbed_official 43:45429aa163a0 6 echo 'Use mbed OS revision from mbed-os.lib'
mbed_official 43:45429aa163a0 7 } else {
mbed_official 43:45429aa163a0 8 echo "Use mbed OS revisiong ${params.mbed_os_revision}"
mbed_official 43:45429aa163a0 9 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 43:45429aa163a0 10 echo "Revision is a Pull Request"
mbed_official 43:45429aa163a0 11 }
mbed_official 43:45429aa163a0 12 }
mbed_official 43:45429aa163a0 13
mbed_official 43:45429aa163a0 14 // List of targets with supported RF shields to compile
mbed_official 43:45429aa163a0 15 def targets = [
mbed_official 43:45429aa163a0 16 "UBLOX_EVK_ODIN_W2": ["builtin"],
mbed_official 54:b9963ccc0c2d 17 "REALTEK_RTL8195AM": ["builtin"],
mbed_official 43:45429aa163a0 18 "K64F": ["WIFI_ESP8266"],
mbed_official 46:9282f93cd1ce 19 "NUCLEO_F401RE": ["WIFI_IDW0XX1"],
adustm adustm@gmail.com 55:23a0d1e8270a 20 "NUCLEO_F429ZI": ["WIFI_ESP8266"],
adustm adustm@gmail.com 55:23a0d1e8270a 21 "DISCO_L475VG_IOT01A": ["WIFI_ISM43362"]
mbed_official 43:45429aa163a0 22 ]
mbed_official 43:45429aa163a0 23
mbed_official 43:45429aa163a0 24 // Map toolchains to compilers
mbed_official 43:45429aa163a0 25 def toolchains = [
mbed_official 43:45429aa163a0 26 ARM: "armcc",
mbed_official 43:45429aa163a0 27 GCC_ARM: "arm-none-eabi-gcc",
mbed_official 43:45429aa163a0 28 IAR: "IAR-linux"
mbed_official 43:45429aa163a0 29 ]
mbed_official 43:45429aa163a0 30
mbed_official 43:45429aa163a0 31 // Supported RF shields
mbed_official 43:45429aa163a0 32 def radioshields = [
mbed_official 43:45429aa163a0 33 "builtin",
mbed_official 47:6796df310c90 34 "WIFI_IDW0XX1",
mbed_official 43:45429aa163a0 35 "WIFI_ESP8266"
mbed_official 43:45429aa163a0 36 ]
mbed_official 43:45429aa163a0 37
mbed_official 43:45429aa163a0 38 def stepsForParallel = [:]
mbed_official 43:45429aa163a0 39
mbed_official 43:45429aa163a0 40 // Jenkins pipeline does not support map.each, we need to use oldschool for loop
mbed_official 43:45429aa163a0 41 for (int i = 0; i < targets.size(); i++) {
mbed_official 43:45429aa163a0 42 for(int j = 0; j < toolchains.size(); j++) {
mbed_official 43:45429aa163a0 43 for(int k = 0; k < radioshields.size(); k++) {
mbed_official 43:45429aa163a0 44 def target = targets.keySet().asList().get(i)
mbed_official 43:45429aa163a0 45 def allowed_shields = targets.get(target)
mbed_official 43:45429aa163a0 46 def toolchain = toolchains.keySet().asList().get(j)
mbed_official 43:45429aa163a0 47 def compilerLabel = toolchains.get(toolchain)
mbed_official 43:45429aa163a0 48 def radioshield = radioshields.get(k)
mbed_official 43:45429aa163a0 49
mbed_official 43:45429aa163a0 50 def stepName = "${target} ${toolchain} ${radioshield}"
mbed_official 43:45429aa163a0 51 if(allowed_shields.contains(radioshield)) {
mbed_official 43:45429aa163a0 52 stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, radioshield)
mbed_official 43:45429aa163a0 53 }
mbed_official 43:45429aa163a0 54 }
mbed_official 43:45429aa163a0 55 }
mbed_official 43:45429aa163a0 56 }
mbed_official 43:45429aa163a0 57
mbed_official 43:45429aa163a0 58 timestamps {
mbed_official 43:45429aa163a0 59 parallel stepsForParallel
mbed_official 43:45429aa163a0 60 }
mbed_official 43:45429aa163a0 61
mbed_official 43:45429aa163a0 62 def buildStep(target, compilerLabel, toolchain, radioShield) {
mbed_official 43:45429aa163a0 63 return {
mbed_official 43:45429aa163a0 64 stage ("${target}_${compilerLabel}_${radioShield}") {
mbed_official 43:45429aa163a0 65 node ("${compilerLabel}") {
mbed_official 43:45429aa163a0 66 deleteDir()
mbed_official 43:45429aa163a0 67 dir("mbed-os-example-wifi") {
mbed_official 43:45429aa163a0 68 checkout scm
mbed_official 43:45429aa163a0 69 def config_file = "mbed_app.json"
mbed_official 43:45429aa163a0 70
mbed_official 43:45429aa163a0 71 if ("${radioShield}" != "internal") {
mbed_official 43:45429aa163a0 72 // Replace default rf shield
mbed_official 43:45429aa163a0 73 execute("sed -i 's/\"value\": \"internal\"/\"value\": \"${radioShield}\"/' ${config_file}")
mbed_official 43:45429aa163a0 74 }
mbed_official 43:45429aa163a0 75
mbed_official 43:45429aa163a0 76 // Set mbed-os to revision received as parameter
mbed_official 43:45429aa163a0 77 execute ("mbed deploy --protocol ssh")
mbed_official 43:45429aa163a0 78 if (params.mbed_os_revision != '') {
mbed_official 43:45429aa163a0 79 dir ("mbed-os") {
mbed_official 43:45429aa163a0 80 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 43:45429aa163a0 81 execute("git fetch origin ${params.mbed_os_revision}:PR")
mbed_official 43:45429aa163a0 82 execute("git checkout PR")
mbed_official 43:45429aa163a0 83 } else {
mbed_official 43:45429aa163a0 84 execute ("git checkout ${params.mbed_os_revision}")
mbed_official 43:45429aa163a0 85 }
mbed_official 43:45429aa163a0 86 }
mbed_official 43:45429aa163a0 87 }
mbed_official 46:9282f93cd1ce 88 execute("mbed new .")
mbed_official 43:45429aa163a0 89 execute ("mbed compile --build out/${target}_${toolchain}_${radioShield}/ -m ${target} -t ${toolchain} -c --app-config ${config_file}")
mbed_official 43:45429aa163a0 90 }
mbed_official 43:45429aa163a0 91 stash name: "${target}_${toolchain}_${radioShield}", includes: '**/mbed-os-example-wifi.bin'
mbed_official 43:45429aa163a0 92 archive '**/mbed-os-example-wifi.bin'
mbed_official 43:45429aa163a0 93 step([$class: 'WsCleanup'])
mbed_official 43:45429aa163a0 94 }
mbed_official 43:45429aa163a0 95 }
mbed_official 43:45429aa163a0 96 }
mbed_official 43:45429aa163a0 97 }