Nanostack Border Router is a generic mbed border router implementation that provides the 6LoWPAN ND or Thread border router initialization logic.

Committer:
mbed_official
Date:
Wed Nov 27 10:02:22 2019 +0000
Revision:
108:0c14bd1d3334
Parent:
101:5fa704b51e88
Fix conflicting declarations of main() (#197)

Update the main() to be compatible with the declaration from
platform/mbed_toolchain.h that adds the MBED_USED attribute.
Without the attribute the main() symbol is not emitted with the
GCC toolchain using "-Wl,--wrap,main" and "-flto" flags.
.
Commit copied from https://github.com/ARMmbed/nanostack-border-router

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 31:11a6bfef0d31 1 properties ([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [
mbed_official 82:3d9e3b7b3dcf 2 [$class: 'StringParameterDefinition', name: 'mbed_os_revision', defaultValue: '', description: 'Revision of mbed-os to build. By default mbed-os.lib is used. To access mbed-os PR use format "pull/PR number/head"'],
mbed_official 82:3d9e3b7b3dcf 3 [$class: 'ChoiceParameterDefinition', name: 'profile', defaultValue: "debug", choices: ["debug", "develop", "release"], description: 'Select compilation profile from list: debug, develop or release.']
mbed_official 31:11a6bfef0d31 4 ]]])
mbed_official 31:11a6bfef0d31 5
mbed_official 31:11a6bfef0d31 6 if (params.mbed_os_revision == '') {
mbed_official 31:11a6bfef0d31 7 echo 'Use mbed OS revision from mbed-os.lib'
mbed_official 31:11a6bfef0d31 8 } else {
mbed_official 31:11a6bfef0d31 9 echo "Use mbed OS revision ${params.mbed_os_revision}"
mbed_official 31:11a6bfef0d31 10 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 31:11a6bfef0d31 11 echo "Revision is a Pull Request"
mbed_official 31:11a6bfef0d31 12 }
mbed_official 31:11a6bfef0d31 13 }
mbed_official 31:11a6bfef0d31 14
mbed_official 82:3d9e3b7b3dcf 15 echo "Use build profile: ${params.profile}"
mbed_official 82:3d9e3b7b3dcf 16
mbed_official 0:85f4174a8e29 17 // List of targets to compile
mbed_official 0:85f4174a8e29 18 def targets = [
mbed_official 6:3c1f873ebe0b 19 "K64F",
mbed_official 69:a8a0ac9f3f8a 20 "K66F",
mbed_official 101:5fa704b51e88 21 "DISCO_F769NI"
mbed_official 0:85f4174a8e29 22 ]
mbed_official 0:85f4174a8e29 23
mbed_official 43:49df70842a8a 24 // Map toolchains to CI labels
mbed_official 0:85f4174a8e29 25 def toolchains = [
mbed_official 101:5fa704b51e88 26 ARM: "armc6",
mbed_official 0:85f4174a8e29 27 GCC_ARM: "arm-none-eabi-gcc",
mbed_official 43:49df70842a8a 28 IAR: "iar_arm"
mbed_official 0:85f4174a8e29 29 ]
mbed_official 0:85f4174a8e29 30
mbed_official 0:85f4174a8e29 31 // Configurations
mbed_official 0:85f4174a8e29 32 def configurations = [
mbed_official 0:85f4174a8e29 33 LOWPAN: "6lowpan_Atmel_RF.json",
mbed_official 0:85f4174a8e29 34 THREAD: "Thread_Atmel_RF.json",
mbed_official 92:7faf6dcb791f 35 THREAD_SLIP: "Thread_SLIP_Atmel_RF.json",
mbed_official 92:7faf6dcb791f 36 WI_SUN: "Wisun_Stm_s2lp_RF.json"
mbed_official 0:85f4174a8e29 37 ]
mbed_official 0:85f4174a8e29 38
mbed_official 0:85f4174a8e29 39 def stepsForParallel = [:]
mbed_official 0:85f4174a8e29 40
mbed_official 0:85f4174a8e29 41 // Jenkins pipeline does not support map.each, we need to use oldschool for loop
mbed_official 0:85f4174a8e29 42 for (int i = 0; i < targets.size(); i++) {
mbed_official 0:85f4174a8e29 43 for(int j = 0; j < toolchains.size(); j++) {
mbed_official 0:85f4174a8e29 44 for(int k = 0; k < configurations.size(); k++) {
mbed_official 0:85f4174a8e29 45 def target = targets.get(i)
mbed_official 0:85f4174a8e29 46 def toolchain = toolchains.keySet().asList().get(j)
mbed_official 0:85f4174a8e29 47 def compilerLabel = toolchains.get(toolchain)
mbed_official 0:85f4174a8e29 48 def configurationLabel = configurations.keySet().asList().get(k)
mbed_official 0:85f4174a8e29 49 def configurationFile = configurations.get(configurationLabel)
mbed_official 0:85f4174a8e29 50 def stepName = "${target} ${configurationLabel} ${toolchain}"
mbed_official 101:5fa704b51e88 51 // SLIP configuration exist only for K64F based Raspberry HAT
mbed_official 101:5fa704b51e88 52 if ((configurationLabel == "THREAD_SLIP") && target != "K64F") {
mbed_official 17:fbeba6669995 53 continue;
mbed_official 17:fbeba6669995 54 }
mbed_official 0:85f4174a8e29 55 stepsForParallel[stepName] = buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain)
mbed_official 0:85f4174a8e29 56 }
mbed_official 0:85f4174a8e29 57 }
mbed_official 0:85f4174a8e29 58 }
mbed_official 0:85f4174a8e29 59
mbed_official 0:85f4174a8e29 60 timestamps {
mbed_official 0:85f4174a8e29 61 parallel stepsForParallel
mbed_official 0:85f4174a8e29 62 }
mbed_official 0:85f4174a8e29 63
mbed_official 0:85f4174a8e29 64 def buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain) {
mbed_official 0:85f4174a8e29 65 return {
mbed_official 0:85f4174a8e29 66 stage ("${target}_${compilerLabel}_${configurationLabel}") {
mbed_official 0:85f4174a8e29 67 node ("${compilerLabel}") {
mbed_official 0:85f4174a8e29 68 deleteDir()
mbed_official 0:85f4174a8e29 69 dir("nanostack-border-router") {
mbed_official 0:85f4174a8e29 70 checkout scm
mbed_official 101:5fa704b51e88 71 execute("git clean -ffdx")
mbed_official 0:85f4174a8e29 72 execute("mbed deploy --protocol ssh")
mbed_official 31:11a6bfef0d31 73 // Update mbed-os revision if requested
mbed_official 31:11a6bfef0d31 74 if (params.mbed_os_revision != '') {
mbed_official 31:11a6bfef0d31 75 dir ("mbed-os") {
mbed_official 31:11a6bfef0d31 76 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 31:11a6bfef0d31 77 execute("git fetch origin ${params.mbed_os_revision}:_PR_")
mbed_official 31:11a6bfef0d31 78 execute("git checkout _PR_")
mbed_official 31:11a6bfef0d31 79 } else {
mbed_official 31:11a6bfef0d31 80 execute ("git checkout ${params.mbed_os_revision}")
mbed_official 31:11a6bfef0d31 81 }
mbed_official 31:11a6bfef0d31 82 }
mbed_official 31:11a6bfef0d31 83 }
mbed_official 82:3d9e3b7b3dcf 84 execute("mbed compile --build out/${configurationLabel}/${target}/${toolchain}/ -m ${target} -t ${toolchain} --app-config ./configs/${configurationFile} --profile ${params.profile}")
mbed_official 0:85f4174a8e29 85 }
mbed_official 0:85f4174a8e29 86 archive '**/nanostack-border-router.bin'
mbed_official 0:85f4174a8e29 87 }
mbed_official 0:85f4174a8e29 88 }
mbed_official 0:85f4174a8e29 89 }
mbed_official 0:85f4174a8e29 90 }