Skip to content

Commit 7ac0300

Browse files
committedMay 7, 2024
Pull request project-chip#1818: Cherry-pick work from silabs_slc_1.2
Merge in WMN_TOOLS/matter from bring_slc_1.2 to silabs_slc_1.3 Squashed commit of the following: commit 19add3ea535c32ee0cf81e96eb0b42cf2aea0af5 Author: Curtis Rahman <Curtis.Rahman@silabs.com> Date: Wed May 1 15:20:43 2024 +0000 Pull request project-chip#1798: MATTER-3181 LZ4 Compression Enabled Applications for SQA testing Merge in WMN_TOOLS/matter from feature/lz4_bootloader to silabs_slc_1.2 Squashed commit of the following: commit 16c6408fbcd5d2185217140567f23c82d0765059 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Apr 30 17:58:28 2024 -0400 Added option for example application specific components commit c72b4770b99178c2c072c0b6669cac385ba2c9a6 Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Apr 30 10:21:53 2024 -0400 Added ability to add components for bootloader commit 42ee5bb2410a1b937818516d25366bbea1928abc Author: Curtis Rahman <curtis.rahman@silabs.com> Date: Tue Apr 30 11:04:21 2024 -0400 Added ability to add components for bootloader ... and 4 more commits commit 09c5417baa519cbe9abe00ce2905693e4248c0e3 Author: Chirag Bansal <Chirag.Bansal@silabs.com> Date: Sat Apr 27 03:53:11 2024 +0000 Pull request project-chip#1790: Adding the required header files for shell Fix on wifi Merge in WMN_TOOLS/matter from bugfix/matter_shell_wifi to silabs_slc_1.2 Squashed commit of the following: commit e31ba30352aa3320f2a7b542eb7b0188beb9fb82 Author: chbansal <chirag.bansal@silabs.com> Date: Fri Apr 26 00:42:05 2024 +0530 adding the required header files for shell commit 60806456fb721e6a70c8079b8df872e19f786952 Author: Sarthak Shaha <Sarthak.Shaha@silabs.com> Date: Fri May 3 22:31:13 2024 +0000 Pull request project-chip#1811: removed unsupported app from matter_templates.xml Merge in WMN_TOOLS/matter from remove_unsupported_board_thermostat to silabs_slc_1.2 Squashed commit of the following: commit f27f5b9a1459807a8fe7d59b619815a4615731c5 Author: Sarthak Shaha <sarthak.shaha@silabs.com> Date: Fri May 3 17:32:51 2024 -0400 added solution for brd2704 and removed for brd2601 commit a3259d576b48a7e55ced7ccf485458d535915e6a Author: Sarthak Shaha <sarthak.shaha@silabs.com> Date: Fri May 3 17:04:16 2024 -0400 removed unsupported app from matter_templates.xml ... and 5 more commits
1 parent f7d4778 commit 7ac0300

File tree

3 files changed

+279
-226
lines changed

3 files changed

+279
-226
lines changed
 

‎jenkins/jenkinsFunctions.groovy

+79-26
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,15 @@ def getSeries(brd){
146146
return ""
147147
}
148148
}
149-
def getBuildConfigs(board="", appName="", otaVersion="", ncp = "", configs = "", useWorkspace = false, additionalComponents = ""){
149+
def getBuildConfigs(board="", appName="", otaVersion="", ncp = "", configs = "", useWorkspace = false, applicationComponents = "", bootloaderComponents = ""){
150150
def buildMap = [:]
151151
buildMap["board"] = board
152152
buildMap["appName"] = appName
153153
buildMap["otaVersion"] = otaVersion
154154
buildMap["ncp"] = ncp
155155
buildMap["configs"] = configs
156-
buildMap["additionalComponents"] = additionalComponents
156+
buildMap["applicationComponents"] = applicationComponents
157+
buildMap["bootloaderComponents"] = bootloaderComponents
157158
buildMap["useWorkspace"] = useWorkspace
158159
return buildMap
159160
}
@@ -180,16 +181,22 @@ def buildOtaImages(){
180181
def software_version_2 = '--configuration CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION:2,CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING:\\"2\\"'
181182
def software_version_3 = '--configuration CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION:3,CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING:\\"3\\"'
182183
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+
193200
slcBuild(appsToBuild, "OTA Images")
194201
}
195202
// Builds all Wifi examples by board (depending on build type)
@@ -202,7 +209,7 @@ def buildWifi(appsToBuild, boardToBuild, ncpToBuild, buildWithWorkspaces)
202209
def buildConfigurations = []
203210

204211
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="")
206213
}
207214
slcBuild(buildConfigurations, nodeDescription)
208215
}
@@ -220,7 +227,7 @@ def buildThread(appList, boardToBuild)
220227

221228
// Add each build configuration to a list
222229
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="")
224231
}
225232

226233
// Build for compiled build configuration list
@@ -272,7 +279,8 @@ def generateProjects(paramMap){
272279
def ncp = paramMap["ncp"]
273280
def ota = paramMap["otaVersion"]
274281
def parameters = paramMap["configs"]
275-
def additionalComponents = paramMap["additionalComponents"]
282+
def applicationComponents = paramMap["applicationComponents"]
283+
def bootloaderComponents = paramMap["bootloaderComponents"]
276284
def useWorkspaces = paramMap["useWorkspace"]
277285
def slcPrjName = getPrjFileName(brd, app, useWorkspaces, ncp)
278286
def platform = "/efr32/"
@@ -303,13 +311,29 @@ def generateProjects(paramMap){
303311
}
304312

305313
echo "Generating ${app} for ${brd}"
314+
sh "printenv"
315+
306316
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+
313337
return output
314338
}
315339
// Runs code to generate example based on input
@@ -536,6 +560,29 @@ def pushToUbai(matterBranchName=env.BRANCH_NAME,matterBuildNumber=env.BUILD_NUMB
536560
{
537561
def savedWorkspace = env.WORKSPACE + "/matter/" + savedDirectory
538562

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+
}
539586
dir(savedWorkspace) {
540587
withCredentials([usernamePassword(credentialsId: 'svc_gsdk', passwordVariable: 'SL_PASSWORD', usernameVariable: 'SL_USERNAME')])
541588
{
@@ -946,7 +993,7 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
946993
def appName = paramMap["appName"]
947994
def otaVersion = paramMap["otaVersion"]
948995
def ncp = paramMap["ncp"]
949-
def additionalComponents = paramMap["additionalComponents"]
996+
def applicationComponents = paramMap["applicationComponents"]
950997
def buildWithWorkspaces = paramMap["useWorkspace"]
951998
def config_args = paramMap["configs"]
952999
def fileName = getPrjFileName(board, appName, buildWithWorkspaces, ncp)
@@ -956,13 +1003,15 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
9561003
def buildType = "release"
9571004
def binaryNamingHelper = "thread"
9581005
def mapNamingHelper = fileName.replaceAll("-internal", "").replaceAll("-bootloader", "")
1006+
def otaVersionOnly = otaVersion
1007+
def otaCompression = "lzma"
9591008

9601009
// Modify output path to differentiate OTA & code size analysis builds from release builds
9611010
if(otaVersion){
9621011
out_dir = 'ota_automation_out'
9631012
buildType = appName
9641013
}
965-
if(additionalComponents.contains("matter_no_debug")){
1014+
if(applicationComponents.contains("matter_no_debug")){
9661015
buildType = 'nodebug'
9671016
}
9681017
if(ncp){
@@ -971,6 +1020,10 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
9711020
// Create designated standardized filepath for each binary and place outputted images there
9721021
// For example: release/BRD4187C/OpenThread/lighting-app-thread.s37
9731022
def newBinaryLocation = "${savedDirectory}/${out_dir}/${buildType}${otaVersion}/${board}/${protocol}"
1023+
if (otaVersion.contains("-lz4")){
1024+
otaVersionOnly = otaVersion - "-lz4"
1025+
otaCompression = "lz4"
1026+
}
9741027
sh "mkdir -p ${newBinaryLocation}"
9751028
def stashName = ""
9761029
def stashFile = ""
@@ -983,8 +1036,8 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
9831036

9841037
// If OTA build, create OTA image from .gbl and passed in version number
9851038
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"
9881041
}
9891042
}
9901043
// 917 Soc build (.slcp)
@@ -1005,7 +1058,7 @@ def saveGeneratedBinaries(paramMap, gsdkPath, matterPath, buildDir){
10051058
}
10061059

10071060
// 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 == "")){
10091062
stash name: getStashName(board, appName, ncp), includes: stashFile
10101063
}
10111064
}

0 commit comments

Comments
 (0)