Skip to content

Commit

Permalink
Add option of user to configure silabs_pre_gen or slc_gen paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs committed Jul 18, 2023
1 parent 7a815f6 commit 8447bd8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions examples/lighting-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if (slc_generate) {
"${use_wstk_leds}",
"${use_external_flash}",
"${silabs_mcu}",
"${slc_gen_path}",
],
"list lines"))
}
Expand Down
1 change: 1 addition & 0 deletions examples/smoke-co-alarm-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if (slc_generate) {
"${use_wstk_leds}",
"${use_external_flash}",
"${silabs_mcu}",
"${slc_gen_path}",
],
"list lines"))
}
Expand Down
6 changes: 6 additions & 0 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ if [ "$#" == "0" ]; then
Periodic query timeout variable for OTA in seconds
rs91x_wpa3_transition
Support for WPA3 transition mode on RS91x
slc_gen_path
Allow users to define a path where slc generates boards files. (requires --slc_generate or --slc_reuse_files)
(default: /third_party/silabs/slc_gen/<board>/)
sl_pre_gen_path
Allow users to define a path to pre-generated boards files
(default: /third_party/silabs/matter_support/matter/<family>/<board>/)
sl_matter_version
Use provided software version at build time
sl_matter_version_str
Expand Down
10 changes: 6 additions & 4 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ declare_args() {
# Argument to enable IPv4 for wifi
# aligning to match chip_inet_config_enable_ipv4 default configuration
chip_enable_wifi_ipv4 = false
silabs_gen_folder = ""

# Calls SLC-CLI at run time
slc_generate = false
Expand All @@ -72,14 +71,17 @@ declare_args() {
sl_ot_efr32_root =
"${efr32_sdk_root}/protocol/openthread/platform-abstraction/efr32"
sl_openthread_root = "${efr32_sdk_root}/util/third_party/openthread"

# board related pre-generated files path (default)
sl_pre_gen_path =
"${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/"
}

if (slc_generate || slc_reuse_files) {
silabs_gen_folder = "${chip_root}/third_party/silabs/slc_gen/${silabs_board}/"
silabs_gen_folder = slc_gen_path
} else {
print("Using pre-generate files")
silabs_gen_folder =
"${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/"
silabs_gen_folder = sl_pre_gen_path
}

# Defines an efr32 SDK build target.
Expand Down
3 changes: 3 additions & 0 deletions third_party/silabs/silabs_board.gni
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ declare_args() {
declare_args() {
# Enables LCD Qr Code on supported devices
show_qr_code = !disable_lcd

# board related generated files path (used if slc_generate or slc_reuse_files is set)
slc_gen_path = "${chip_root}/third_party/silabs/slc_gen/${silabs_board}/"
}

if (silabs_board == "") {
Expand Down
2 changes: 1 addition & 1 deletion third_party/silabs/slc_gen/run_slc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def isMG24(partnumber):
use_wstk_leds = asBoolean(sys.argv[5])
use_external_flash = asBoolean(sys.argv[6])
silabs_mcu = str(sys.argv[7])
output_path = str(sys.argv[8])

slcp_file_path = os.path.join(root_path, "examples/platform/silabs/matter-platform.slcp")
template_path = os.path.join(root_path, "third_party/silabs/slc_gen/")
output_path = template_path + sys.argv[2] + '/'

slc_arguments = ""

Expand Down

0 comments on commit 8447bd8

Please sign in to comment.