Skip to content

Commit

Permalink
Fix pathing issue, use the active python3 installation on any env. Ma…
Browse files Browse the repository at this point in the history
…ke sure slc has a configured and trusted gsdk set
  • Loading branch information
jmartinez-silabs committed Jul 18, 2023
1 parent c927ac3 commit 9b15dc7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ jobs:
with:
gh-context: ${{ toJson(github) }}

# - name: Test SLC gen
# timeout-minutes: 30
# run: |
# scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker
# scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker
# rm -rf ./out/
- name: Test SLC gen
timeout-minutes: 30
run: |
scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker
scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker
rm -rf ./out/
- name: Build some BRD4187C variants
run: |
./scripts/run_in_build_env.sh \
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (slc_generate) {
"${use_wstk_leds}",
"${use_external_flash}",
"${silabs_mcu}",
"${slc_gen_path}",
rebase_path(slc_gen_path),
],
"list lines"))
}
Expand Down
2 changes: 1 addition & 1 deletion examples/smoke-co-alarm-app/silabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (slc_generate) {
"${use_wstk_leds}",
"${use_external_flash}",
"${silabs_mcu}",
"${slc_gen_path}",
rebase_path(slc_gen_path),
],
"list lines"))
}
Expand Down
7 changes: 3 additions & 4 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ if [ "$#" == "0" ]; then
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)
Allow users to define a path where slc generates board 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
Allow users to define a path to pre-generated board files
(default: /third_party/silabs/matter_support/matter/<family>/<board>/)
sl_matter_version
Use provided software version at build time
Expand Down Expand Up @@ -287,17 +287,16 @@ else
fi

if [ "$USE_SLC" == true ]; then
PYTHON_PATH="/usr/bin/python3"
if [ "$GN_PATH_PROVIDED" == false ]; then
GN_PATH=./.environment/cipd/packages/pigweed/gn
fi
elif [ "$USE_SLC" == false ]; then
# Activation needs to be after SLC generation which is done in gn gen.
# Zap generation requires activation and is done in the build phase
source "$CHIP_ROOT/scripts/activate.sh"
PYTHON_PATH=$VIRTUAL_ENV"/bin/python3"
fi

PYTHON_PATH="$(which python3)"
BUILD_DIR=$OUTDIR/$SILABS_BOARD
echo BUILD_DIR="$BUILD_DIR"

Expand Down
10 changes: 10 additions & 0 deletions third_party/silabs/slc_gen/run_slc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def isMG24(partnumber):

print(slc_arguments)

if "GSDK_ROOT" in os.environ:
gsdk_root = os.getenv('GSDK_ROOT')
else:
# If no gsdk path is set in the environment, use the standard path to the submodule
gsdk_root = os.path.join(root_path, "third_party/silabs/gecko_sdk/")

# make sure we have a configured and trusted gsdk in slc
subprocess.run(["slc", "configuration", "--sdk", gsdk_root], check=True)
subprocess.run(["slc", "signature", "trust", "--sdk", gsdk_root], check=True)

subprocess.run(["slc", "generate", slcp_file_path, "-d", output_path, "--with", slc_arguments], check=True)

# cleanup of unwanted files
Expand Down

0 comments on commit 9b15dc7

Please sign in to comment.