diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 141033ffc2a4bd..59d4d7f111e44e 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -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 \ diff --git a/examples/lighting-app/silabs/BUILD.gn b/examples/lighting-app/silabs/BUILD.gn index daf3201512c322..63a206ee8ffaab 100644 --- a/examples/lighting-app/silabs/BUILD.gn +++ b/examples/lighting-app/silabs/BUILD.gn @@ -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")) } diff --git a/examples/smoke-co-alarm-app/silabs/BUILD.gn b/examples/smoke-co-alarm-app/silabs/BUILD.gn index 9a090eb6f11052..cafd4b6f7cc1bd 100644 --- a/examples/smoke-co-alarm-app/silabs/BUILD.gn +++ b/examples/smoke-co-alarm-app/silabs/BUILD.gn @@ -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")) } diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 9efd662bcd2fe9..f966cebed9dd62 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -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//) 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///) sl_matter_version Use provided software version at build time @@ -287,7 +287,6 @@ 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 @@ -295,9 +294,9 @@ else # 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" diff --git a/third_party/silabs/slc_gen/run_slc.py b/third_party/silabs/slc_gen/run_slc.py index 6d204eabbe938d..4ec7f59b9ae600 100644 --- a/third_party/silabs/slc_gen/run_slc.py +++ b/third_party/silabs/slc_gen/run_slc.py @@ -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