@@ -146,14 +146,15 @@ def getSeries(brd){
146
146
return " "
147
147
}
148
148
}
149
- def getBuildConfigs (board = " " , appName = " " , otaVersion = " " , ncp = " " , configs = " " , useWorkspace = false , additionalComponents = " " ){
149
+ def getBuildConfigs (board = " " , appName = " " , otaVersion = " " , ncp = " " , configs = " " , useWorkspace = false , applicationComponents = " " , bootloaderComponents = " " ){
150
150
def buildMap = [:]
151
151
buildMap[" board" ] = board
152
152
buildMap[" appName" ] = appName
153
153
buildMap[" otaVersion" ] = otaVersion
154
154
buildMap[" ncp" ] = ncp
155
155
buildMap[" configs" ] = configs
156
- buildMap[" additionalComponents" ] = additionalComponents
156
+ buildMap[" applicationComponents" ] = applicationComponents
157
+ buildMap[" bootloaderComponents" ] = bootloaderComponents
157
158
buildMap[" useWorkspace" ] = useWorkspace
158
159
return buildMap
159
160
}
@@ -180,16 +181,22 @@ def buildOtaImages(){
180
181
def software_version_2 = ' --configuration CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION:2,CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING:\\ "2\\ "'
181
182
def software_version_3 = ' --configuration CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION:3,CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING:\\ "3\\ "'
182
183
def appsToBuild = []
183
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
184
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lock-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
185
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " dishwasher-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
186
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " light-switch-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
187
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " thermostat" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
188
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " window-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
189
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 3" , ncp = " " , configs = software_version_3, useWorkspace = true , additionalComponents = " " )
190
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " wf200" , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
191
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " 917-ncp" , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
192
- appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " rs911x" , configs = software_version_2, useWorkspace = true , additionalComponents = " " )
184
+
185
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
186
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lock-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
187
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " dishwasher-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
188
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " light-switch-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
189
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " thermostat" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
190
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " window-app" , otaVersion= " 2" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
191
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 3" , ncp = " " , configs = software_version_3, useWorkspace = true , applicationComponents = " " )
192
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " wf200" , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
193
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " 917-ncp" , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
194
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2" , ncp = " rs911x" , configs = software_version_2, useWorkspace = true , applicationComponents = " " )
195
+
196
+ // LZ4 Images
197
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 2-lz4" , ncp = " " , configs = software_version_2, useWorkspace = true , applicationComponents = " " , bootloaderComponents = " ,bootloader_gbl_compression_lz4" )
198
+ appsToBuild + = getBuildConfigs(board= " BRD4187C" , appName= " lighting-app" , otaVersion= " 3-lz4" , ncp = " " , configs = software_version_3, useWorkspace = true , applicationComponents = " " , bootloaderComponents = " ,bootloader_gbl_compression_lz4" )
199
+
193
200
slcBuild(appsToBuild, " OTA Images" )
194
201
}
195
202
// Builds all Wifi examples by board (depending on build type)
@@ -202,7 +209,7 @@ def buildWifi(appsToBuild, boardToBuild, ncpToBuild, buildWithWorkspaces)
202
209
def buildConfigurations = []
203
210
204
211
for (int i = 0 ; i < appsToBuild. size(); i++ ) {
205
- buildConfigurations + = getBuildConfigs(board= boardToBuild, appName= appsToBuild[i], otaVersion= " " , ncp= ncpToBuild, configs= " " , useWorkspace= buildWithWorkspaces, additionalComponents = " " )
212
+ buildConfigurations + = getBuildConfigs(board= boardToBuild, appName= appsToBuild[i], otaVersion= " " , ncp= ncpToBuild, configs= " " , useWorkspace= buildWithWorkspaces, applicationComponents = " " )
206
213
}
207
214
slcBuild(buildConfigurations, nodeDescription)
208
215
}
@@ -220,7 +227,7 @@ def buildThread(appList, boardToBuild)
220
227
221
228
// Add each build configuration to a list
222
229
for (int i = 0 ; i < appsToBuild. size(); i++ ) {
223
- buildConfigurations + = getBuildConfigs(board= boardToBuild, appName= appsToBuild[i], otaVersion= " " , ncp= " " , configs= " " , useWorkspace= params. BUILD_WITH_WORKSPACES , additionalComponents = " " )
230
+ buildConfigurations + = getBuildConfigs(board= boardToBuild, appName= appsToBuild[i], otaVersion= " " , ncp= " " , configs= " " , useWorkspace= params. BUILD_WITH_WORKSPACES , applicationComponents = " " )
224
231
}
225
232
226
233
// Build for compiled build configuration list
@@ -272,7 +279,8 @@ def generateProjects(paramMap){
272
279
def ncp = paramMap[" ncp" ]
273
280
def ota = paramMap[" otaVersion" ]
274
281
def parameters = paramMap[" configs" ]
275
- def additionalComponents = paramMap[" additionalComponents" ]
282
+ def applicationComponents = paramMap[" applicationComponents" ]
283
+ def bootloaderComponents = paramMap[" bootloaderComponents" ]
276
284
def useWorkspaces = paramMap[" useWorkspace" ]
277
285
def slcPrjName = getPrjFileName(brd, app, useWorkspaces, ncp)
278
286
def platform = " /efr32/"
@@ -303,13 +311,29 @@ def generateProjects(paramMap){
303
311
}
304
312
305
313
echo " Generating ${ app} for ${ brd} "
314
+ sh " printenv"
315
+
306
316
def output = brd + " /" + app + ncp + ota
307
- sh """
308
- printenv
309
- export POST_BUILD_EXE=${ commanderPath}
310
- ${ commanderPath} -version
311
- ${ UC_CLI_DIR} slc generate --daemon -d ${ output} ${ projTypeFlag} ${ projFilePath} --with '${ brdLowerCase}${ additionalComponents} ' ${ parameters} -data gsdk/out/dmp_uc.data --generator-timeout=1800
312
- """
317
+
318
+ if (bootloaderComponents && useWorkspaces){
319
+ // Build for solutions
320
+ sh """
321
+ export POST_BUILD_EXE=${ commanderPath}
322
+ ${ commanderPath} -version
323
+ ${ UC_CLI_DIR} slc generate --daemon -d ${ output} ${ projTypeFlag} ${ projFilePath} --with '${ brdLowerCase}${ bootloaderComponents} ' -pids bootloader ${ parameters} -data gsdk/out/dmp_uc.data --generator-timeout=1800
324
+ ${ UC_CLI_DIR} slc generate --daemon -d ${ output} ${ projTypeFlag} ${ projFilePath} --with '${ brdLowerCase}${ applicationComponents} ' -pids application ${ parameters} -data gsdk/out/dmp_uc.data --generator-timeout=1800
325
+ """
326
+ }
327
+ else {
328
+ // Build for just application
329
+ sh """
330
+ export POST_BUILD_EXE=${ commanderPath}
331
+ ${ commanderPath} -version
332
+ ${ UC_CLI_DIR} slc generate --daemon -d ${ output} ${ projTypeFlag} ${ projFilePath} --with '${ brdLowerCase}${ applicationComponents} ' ${ parameters} -data gsdk/out/dmp_uc.data --generator-timeout=1800
333
+ """
334
+ }
335
+
336
+
313
337
return output
314
338
}
315
339
// Runs code to generate example based on input
@@ -536,6 +560,29 @@ def pushToUbai(matterBranchName=env.BRANCH_NAME,matterBuildNumber=env.BUILD_NUMB
536
560
{
537
561
def savedWorkspace = env. WORKSPACE + " /matter/" + savedDirectory
538
562
563
+ dir(env. WORKSPACE + " /matter/" ) {
564
+ withCredentials([usernamePassword(credentialsId : ' svc_gsdk' , passwordVariable : ' SL_PASSWORD' , usernameVariable : ' SL_USERNAME' )])
565
+ {
566
+ sh '''
567
+ ls -al;pwd
568
+ set -o pipefail
569
+ set -x
570
+
571
+ ota_file="ota-scripts.zip"
572
+ zip -r "${ota_file}" "scripts/tools/silabs" "src/app/ota_image_tool.py" "src/controller/python/chip/tlv" -x "*.md"
573
+
574
+ echo 'UBAI uploading ......'
575
+ ubai_upload_cli --client-id jenkins-gsdk-pipelines-Matter --file-path ota-scripts.zip --metadata app_name matter \
576
+ --metadata branch ${BRANCH_NAME} --metadata build_number ${BUILD_NUMBER} --metadata stack matter --metadata target matter --username ${SL_USERNAME} --password ${SL_PASSWORD}
577
+
578
+ if [ $? -eq 0 ]; then
579
+ echo 'uploaded to UBAI successfully....... '
580
+ else
581
+ echo FAIL
582
+ fi
583
+ '''
584
+ }
585
+ }
539
586
dir(savedWorkspace) {
540
587
withCredentials([usernamePassword(credentialsId : ' svc_gsdk' , passwordVariable : ' SL_PASSWORD' , usernameVariable : ' SL_USERNAME' )])
541
588
{
@@ -946,7 +993,7 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
946
993
def appName = paramMap[" appName" ]
947
994
def otaVersion = paramMap[" otaVersion" ]
948
995
def ncp = paramMap[" ncp" ]
949
- def additionalComponents = paramMap[" additionalComponents " ]
996
+ def applicationComponents = paramMap[" applicationComponents " ]
950
997
def buildWithWorkspaces = paramMap[" useWorkspace" ]
951
998
def config_args = paramMap[" configs" ]
952
999
def fileName = getPrjFileName(board, appName, buildWithWorkspaces, ncp)
@@ -956,13 +1003,15 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
956
1003
def buildType = " release"
957
1004
def binaryNamingHelper = " thread"
958
1005
def mapNamingHelper = fileName. replaceAll(" -internal" , " " ). replaceAll(" -bootloader" , " " )
1006
+ def otaVersionOnly = otaVersion
1007
+ def otaCompression = " lzma"
959
1008
960
1009
// Modify output path to differentiate OTA & code size analysis builds from release builds
961
1010
if (otaVersion){
962
1011
out_dir = ' ota_automation_out'
963
1012
buildType = appName
964
1013
}
965
- if (additionalComponents . contains(" matter_no_debug" )){
1014
+ if (applicationComponents . contains(" matter_no_debug" )){
966
1015
buildType = ' nodebug'
967
1016
}
968
1017
if (ncp){
@@ -971,6 +1020,10 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
971
1020
// Create designated standardized filepath for each binary and place outputted images there
972
1021
// For example: release/BRD4187C/OpenThread/lighting-app-thread.s37
973
1022
def newBinaryLocation = " ${ savedDirectory} /${ out_dir} /${ buildType}${ otaVersion} /${ board} /${ protocol} "
1023
+ if (otaVersion. contains(" -lz4" )){
1024
+ otaVersionOnly = otaVersion - " -lz4"
1025
+ otaCompression = " lz4"
1026
+ }
974
1027
sh " mkdir -p ${ newBinaryLocation} "
975
1028
def stashName = " "
976
1029
def stashFile = " "
@@ -983,8 +1036,8 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
983
1036
984
1037
// If OTA build, create OTA image from .gbl and passed in version number
985
1038
if (otaVersion){
986
- sh " ${ commanderPath} gbl create ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .gbl --app ${ stashFile} --compress lzma "
987
- sh " ./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn ${ otaVersion } -vs ${ otaVersion } .0 -da sha256 ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .gbl ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .ota"
1039
+ sh " ${ commanderPath} gbl create ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .gbl --app ${ stashFile} --compress ${ otaCompression } "
1040
+ sh " ./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn ${ otaVersionOnly } -vs ${ otaVersionOnly } .0 -da sha256 ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .gbl ${ newBinaryLocation} /${ appName} -${ binaryNamingHelper} .ota"
988
1041
}
989
1042
}
990
1043
// 917 Soc build (.slcp)
@@ -1005,7 +1058,7 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
1005
1058
}
1006
1059
1007
1060
// Only stash file if it does not have special configuration/component modifications - used later in sanity test stage
1008
- if ((! additionalComponents . contains(" matter_no_debug" )) && (! config_args. contains(" copy" )) && (otaVersion == " " )){
1061
+ if ((! applicationComponents . contains(" matter_no_debug" )) && (! config_args. contains(" copy" )) && (otaVersion == " " )){
1009
1062
stash name : getStashName(board, appName, ncp), includes : stashFile
1010
1063
}
1011
1064
}
0 commit comments