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:
Tue Mar 19 15:02:40 2019 +0000
Revision:
95:930ccc91b349
Parent:
92:7faf6dcb791f
Corrected Wi-SUN certificate length calculation

mbed TLS expects null terminator to be calculated to PEM length.

.
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 69:a8a0ac9f3f8a 21 "NUCLEO_F429ZI"
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 0:85f4174a8e29 26 ARM: "armcc",
mbed_official 77:2d8a3de185b7 27 // ARMC6: "armc6",
mbed_official 0:85f4174a8e29 28 GCC_ARM: "arm-none-eabi-gcc",
mbed_official 43:49df70842a8a 29 IAR: "iar_arm"
mbed_official 0:85f4174a8e29 30 ]
mbed_official 0:85f4174a8e29 31
mbed_official 0:85f4174a8e29 32 // Configurations
mbed_official 0:85f4174a8e29 33 def configurations = [
mbed_official 0:85f4174a8e29 34 LOWPAN: "6lowpan_Atmel_RF.json",
mbed_official 0:85f4174a8e29 35 THREAD: "Thread_Atmel_RF.json",
mbed_official 92:7faf6dcb791f 36 THREAD_SLIP: "Thread_SLIP_Atmel_RF.json",
mbed_official 92:7faf6dcb791f 37 WI_SUN: "Wisun_Stm_s2lp_RF.json"
mbed_official 0:85f4174a8e29 38 ]
mbed_official 0:85f4174a8e29 39
mbed_official 0:85f4174a8e29 40 def stepsForParallel = [:]
mbed_official 0:85f4174a8e29 41
mbed_official 0:85f4174a8e29 42 // Jenkins pipeline does not support map.each, we need to use oldschool for loop
mbed_official 0:85f4174a8e29 43 for (int i = 0; i < targets.size(); i++) {
mbed_official 0:85f4174a8e29 44 for(int j = 0; j < toolchains.size(); j++) {
mbed_official 0:85f4174a8e29 45 for(int k = 0; k < configurations.size(); k++) {
mbed_official 0:85f4174a8e29 46 def target = targets.get(i)
mbed_official 0:85f4174a8e29 47 def toolchain = toolchains.keySet().asList().get(j)
mbed_official 0:85f4174a8e29 48 def compilerLabel = toolchains.get(toolchain)
mbed_official 0:85f4174a8e29 49 def configurationLabel = configurations.keySet().asList().get(k)
mbed_official 0:85f4174a8e29 50 def configurationFile = configurations.get(configurationLabel)
mbed_official 0:85f4174a8e29 51 def stepName = "${target} ${configurationLabel} ${toolchain}"
mbed_official 92:7faf6dcb791f 52 // SLIP configuration exist only for K64F based Raspberry HAT and Wi-SUN configuration exist only for K64F
mbed_official 92:7faf6dcb791f 53 if ((configurationLabel == "THREAD_SLIP" || configurationLabel == "WI_SUN") && target != "K64F") {
mbed_official 17:fbeba6669995 54 continue;
mbed_official 17:fbeba6669995 55 }
mbed_official 0:85f4174a8e29 56 stepsForParallel[stepName] = buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain)
mbed_official 0:85f4174a8e29 57 }
mbed_official 0:85f4174a8e29 58 }
mbed_official 0:85f4174a8e29 59 }
mbed_official 0:85f4174a8e29 60
mbed_official 0:85f4174a8e29 61 timestamps {
mbed_official 0:85f4174a8e29 62 parallel stepsForParallel
mbed_official 0:85f4174a8e29 63 }
mbed_official 0:85f4174a8e29 64
mbed_official 0:85f4174a8e29 65 def buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain) {
mbed_official 0:85f4174a8e29 66 return {
mbed_official 0:85f4174a8e29 67 stage ("${target}_${compilerLabel}_${configurationLabel}") {
mbed_official 0:85f4174a8e29 68 node ("${compilerLabel}") {
mbed_official 0:85f4174a8e29 69 deleteDir()
mbed_official 0:85f4174a8e29 70 dir("nanostack-border-router") {
mbed_official 0:85f4174a8e29 71 checkout scm
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 }