Skip to content

Commit

Permalink
revert changes on build script
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Nov 14, 2023
1 parent 85ffa2d commit 228a32c
Showing 1 changed file with 120 additions and 121 deletions.
241 changes: 120 additions & 121 deletions scripts/examples/gn_silabs_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fi
set -x
env
USE_WIFI=false
USE_RPS_EXTENSION=false
USE_DOCKER=false
USE_GIT_SHA_FOR_VERSION=true
USE_SLC=false
Expand Down Expand Up @@ -161,118 +160,118 @@ else
shift
while [ $# -gt 0 ]; do
case $1 in
--clean)
DIR_CLEAN=true
shift
;;
--wifi)
if [ -z "$2" ]; then
echo "--wifi requires rs9116 or SiWx917 or wf200"
exit 1
fi
if [ "$2" = "rs9116" ]; then
optArgs+="use_rs9116=true "
elif [ "$2" = "SiWx917" ]; then
optArgs+="use_SiWx917=true "
elif [ "$2" = "wf200" ]; then
optArgs+="use_wf200=true "
else
echo "Wifi usage: --wifi rs9116|SiWx917|wf200"
exit 1
fi
--clean)
DIR_CLEAN=true
shift
;;
--wifi)
if [ -z "$2" ]; then
echo "--wifi requires rs9116 or SiWx917 or wf200"
exit 1
fi
if [ "$2" = "rs9116" ]; then
optArgs+="use_rs9116=true "
elif [ "$2" = "SiWx917" ]; then
optArgs+="use_SiWx917=true "
elif [ "$2" = "wf200" ]; then
optArgs+="use_wf200=true "
else
echo "Wifi usage: --wifi rs9116|SiWx917|wf200"
exit 1
fi
USE_WIFI=true
optArgs+="chip_device_platform =\"efr32\" "
shift
shift
;;
--icd)
optArgs+="chip_enable_icd_server=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 chip_inet_config_enable_ipv4=true "
shift
;;
--additional_data_advertising)
optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
shift
;;
--use_ot_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" "
shift
;;
--use_ot_coap_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true "
shift
;;
--use_chip_lwip_lib)
optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" "
shift
;;
# Option not to be used until ot-efr32 github is updated
# --use_ot_github_sources)
# optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\""
# shift
# ;;
--release)
optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false "
shift
;;
--bootloader)
USE_BOOTLOADER=true
shift
;;
--docker)
optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" "
optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" "
optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" "
USE_DOCKER=true
shift
;;
--uart_log)
optArgs+="sl_uart_log_output=true "
shift
;;

--slc_generate)
optArgs+="slc_generate=true "
USE_SLC=true
shift
;;
--slc_reuse_files)
optArgs+="slc_reuse_files=true "
USE_SLC=true
shift
;;
--gn_path)
if [ -z "$2" ]; then
echo "--gn_path requires a path to GN"
exit 1
else
GN_PATH="$2"
fi
GN_PATH_PROVIDED=true
shift
shift
;;
*"sl_matter_version_str="*)
optArgs+="$1 "
USE_GIT_SHA_FOR_VERSION=false
shift
;;
*)
if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
# NCP Mode so base MCU is an EFR32
optArgs+="chip_device_platform =\"efr32\" "
shift
shift
;;
--icd)
optArgs+="chip_enable_icd_server=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 chip_inet_config_enable_ipv4=true "
shift
;;
--additional_data_advertising)
optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true "
shift
;;
--use_ot_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" "
shift
;;
--use_ot_coap_lib)
optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true "
shift
;;
--use_chip_lwip_lib)
optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" "
shift
;;
# Option not to be used until ot-efr32 github is updated
# --use_ot_github_sources)
# optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\""
# shift
# ;;
--release)
optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false "
shift
;;
--bootloader)
USE_BOOTLOADER=true
shift
;;
--docker)
optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" "
optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" "
optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" "
USE_DOCKER=true
shift
;;
--uart_log)
optArgs+="sl_uart_log_output=true "
shift
;;

--slc_generate)
optArgs+="slc_generate=true "
USE_SLC=true
shift
;;
--slc_reuse_files)
optArgs+="slc_reuse_files=true "
USE_SLC=true
shift
;;
--gn_path)
if [ -z "$2" ]; then
echo "--gn_path requires a path to GN"
exit 1
else
GN_PATH="$2"
fi
GN_PATH_PROVIDED=true
shift
shift
;;
*"sl_matter_version_str="*)
optArgs+="$1 "
USE_GIT_SHA_FOR_VERSION=false
shift
;;
*)
if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
# NCP Mode so base MCU is an EFR32
optArgs+="chip_device_platform =\"efr32\" "
fi
optArgs+=$1" "
shift
;;
fi
optArgs+=$1" "
shift
;;
esac
done

Expand All @@ -285,7 +284,6 @@ else
if [ "$SILABS_BOARD" == "BRD4325B" ] || [ "$SILABS_BOARD" == "BRD4325C" ] || [ "$SILABS_BOARD" == "BRD4338A" ] || [ "$SILABS_BOARD" == "BRD4325G" ]; then
echo "Compiling for 917 WiFi SOC"
USE_WIFI=true
USE_RPS_EXTENSION=true
optArgs+="chip_device_platform =\"SiWx917\" "
fi

Expand Down Expand Up @@ -340,23 +338,23 @@ else

# add bootloader to generated image
if [ "$USE_BOOTLOADER" == true ]; then
# Get .s37 path and name
binName="$(find "$BUILD_DIR" -type f -name "*.s37")"

# set commander path
if [ -z "$COMMANDER_PATH" ]; then
commanderPath="commander"
else
commanderPath="$COMMANDER_PATH"
fi
binName=""
InternalBootloaderBoards=("BRD4337A" "BRD2704A" "BRD2703A" "BRD4319A")
bootloaderPath=""

commanderPath=""
# find the matter root folder
if [ -z "$MATTER_ROOT" ]; then
MATTER_ROOT="$CHIP_ROOT"
fi

# set commander path
if [ -z "$COMMANDER_PATH" ]; then
commanderPath="commander"
else
commanderPath="$COMMANDER_PATH"
fi

# search bootloader directory for the respective bootloaders for the input board
bootloaderFiles=("$(find "$MATTER_ROOT/third_party/silabs/matter_support/matter/efr32/bootloader_binaries/" -maxdepth 1 -name "*$SILABS_BOARD*" | tr '\n' ' ')")

Expand All @@ -374,6 +372,7 @@ else
bootloaderPath="${bootloaderFiles[0]}"
fi
echo "$bootloaderPath"
binName="$(find "$BUILD_DIR" -type f -name "*.s37")"
echo "$binName"
"$commanderPath" convert "$binName" "$bootloaderPath" -o "$binName"
fi
Expand Down

0 comments on commit 228a32c

Please sign in to comment.