Skip to content

Commit

Permalink
[Silabs] Add a low power build flag to the efr32 build script (#23324)
Browse files Browse the repository at this point in the history
* Add low power flag

* Add variants to python builders

* update hardcoded text file

* Apply Restyler changes
  • Loading branch information
mkardous-silabs authored Oct 31, 2022
1 parent c4814da commit eeb4cdc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def BuildEfr32Target():

target.AppendModifier('rpc', enable_rpcs=True)
target.AppendModifier('with-ota-requestor', enable_ota_requestor=True)
target.AppendModifier('sed', enable_sed=True)
target.AppendModifier('low-power', enable_low_power=True)

return target

Expand Down
9 changes: 9 additions & 0 deletions scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def __init__(self,
board: Efr32Board = Efr32Board.BRD4161A,
enable_rpcs: bool = False,
enable_ota_requestor: bool = False,
enable_sed: bool = False,
enable_low_power: bool = False
):
super(Efr32Builder, self).__init__(
root=app.BuildRoot(root),
Expand All @@ -128,6 +130,13 @@ def __init__(self,
if enable_ota_requestor:
self.extra_gn_options.append('chip_enable_ota_requestor=true')

if enable_sed:
self.extra_gn_options.append('enable_sleepy_device=true chip_openthread_ftd=false')

if enable_low_power:
self.extra_gn_options.append(
'chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true')

def GnBuildArgs(self):
return self.extra_gn_options

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x
bouffalolab-{bl602-iot-matter-v1,bl602-iot-dvk-3s,bl602-night-light,xt-zb6-devkit,bl706-iot-dvk,bl706-night-light}-light[-shell][-115200][-rpc]
cc13x2x7_26x2x7-{all-clusters,all-clusters-minimal,lock,pump,pump-controller,shell}[-ftd][-mtd]
cyw30739-cyw930739m2evb_01-{light,lock,ota-requestor}[-no-progress-logging]
efr32-{brd4161a,brd4187c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,brd4304a}-{window-covering,switch,unit-test,light,lock}[-rpc][-with-ota-requestor]
efr32-{brd4161a,brd4187c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,brd4304a}-{window-covering,switch,unit-test,light,lock}[-rpc][-with-ota-requestor][-sed][-low-power]
esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-requestor,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only]
genio-lighting-app
linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang]
Expand Down
9 changes: 8 additions & 1 deletion scripts/examples/gn_efr32_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ if [ "$#" == "0" ]; then
Presets
--sed
enable sleepy end device, set thread mtd
For minimum consumption, disable openthread cli and qr code
For minimum consumption, add --low-power
--low-power
disables all power consuming features for the most power efficient build
This flag is to be used with --sed
--wifi <wf200 | rs911x>
build wifi example variant for given exansion board
--additional_data_advertising
Expand Down Expand Up @@ -140,6 +143,10 @@ else
optArgs+="enable_sleepy_device=true chip_openthread_ftd=false "
shift
;;
--low-power)
optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true "
shift
;;
--chip_enable_wifi_ipv4)
optArgs+="chip_enable_wifi_ipv4=true "
shift
Expand Down

0 comments on commit eeb4cdc

Please sign in to comment.