Skip to content

Commit

Permalink
Build 917 NCP Using Wisemcu SDK Package
Browse files Browse the repository at this point in the history
  • Loading branch information
KishorSilabs committed Feb 3, 2023
1 parent 17d7f00 commit d9949ca
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 6 deletions.
20 changes: 17 additions & 3 deletions examples/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,23 @@ import("${silabs_common_plat_dir}/efr32/args.gni")
# Sanity check
assert(!(chip_enable_wifi && chip_enable_openthread))
assert(!(use_rs911x && chip_enable_openthread))
assert(!(use_rs9117 && chip_enable_openthread))
assert(!(use_wf200 && chip_enable_openthread))

if (chip_enable_wifi) {
assert(use_rs911x || use_wf200)
assert(use_rs911x || use_wf200 || use_rs9117)
enable_openthread_cli = false
import("${chip_root}/src/platform/silabs/EFR32/wifi_args.gni")

if (use_rs911x) {
wiseconnect_sdk_root =
"${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk"
import("rs911x/rs911x.gni")
} else if (use_rs9117) {
wisemcu_sdk_root =
"${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk"
import("rs911x/rs9117.gni")
}

if (use_wf200) {
import("wf200/wf200.gni")
}
Expand Down Expand Up @@ -293,7 +297,17 @@ source_set("efr32-common") {

#add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk
cflags = rs911x_cflags
} else if (use_wf200) {
} else if (use_rs9117){
sources += rs911x_src_plat

# All the stuff from wiseconnect
sources += rs911x_src_sapi
include_dirs += rs911x_inc_plat

#add compilation flags for rs991x build. This will be addressed directly in wiseconnect sdk in the next version release of that sdk
cflags = rs911x_cflags
}
else if (use_wf200) {
sources += wf200_plat_src
include_dirs += wf200_plat_incs
}
Expand Down
64 changes: 64 additions & 0 deletions examples/platform/silabs/efr32/rs911x/rs9117.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import("//build_overrides/chip.gni")

examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32"
wifi_sdk_dir = "${chip_root}/src/platform/silabs/EFR32/wifi"
wisemcu_sdk_root = "${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk"

rs911x_src_plat = [
"${examples_plat_dir}/rs911x/rsi_if.c",
"${examples_plat_dir}/rs911x/wfx_rsi_host.c",
"${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_interrupt.c",
"${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_ioports.c",
"${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_timer.c",
"${examples_plat_dir}/rs911x/hal/efx_spi.c",
"${wifi_sdk_dir}/wfx_notify.cpp",
]

#
# All the stuff from wiseconnect
#
rs911x_src_sapi = [
"${wisemcu_sdk_root}/sapi/wlan/rsi_wlan_apis.c",
"${wisemcu_sdk_root}/sapi/common/rsi_apis_non_rom.c",
"${wisemcu_sdk_root}/sapi/common/rsi_apis_rom.c",
"${wisemcu_sdk_root}/sapi/common/rsi_common_apis.c",
"${wisemcu_sdk_root}/sapi/common/rsi_device_init_apis.c",
"${wisemcu_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_frame_rd_wr.c",
"${wisemcu_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_functs.c",
"${wisemcu_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_iface_init.c",
"${wisemcu_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_mem_rd_wr.c",
"${wisemcu_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_reg_rd_wr.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_common.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_device_init.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_driver_event_handlers.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_driver.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_events_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_events.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_iap.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_nwk_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_nwk.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_pkt_mgmt_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_pkt_mgmt.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_queue_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_queue.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_scheduler_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_scheduler.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_setregion_countryinfo.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_timer.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_utils_rom.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_utils.c",
"${wisemcu_sdk_root}/sapi/driver/rsi_wlan.c",
"${wisemcu_sdk_root}/sapi/rtos/freertos_wrapper/rsi_os_wrapper.c",

# Apparently - the rsi library needs this (though we may not use use it)
"${wisemcu_sdk_root}/sapi/network/socket/rsi_socket.c",
"${wisemcu_sdk_root}/sapi/network/socket/rsi_socket_rom.c",
]

rs911x_cflags = [ "-Wno-empty-body" ]

rs911x_inc_plat = [
"${examples_plat_dir}/rs911x",
"${examples_plat_dir}/rs911x/hal",
"${wisemcu_sdk_root}/sapi/include",
]
10 changes: 10 additions & 0 deletions examples/platform/silabs/efr32/rs911x/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap)
*********************************************************************/
int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
{
#ifdef RS9117_WIFI
//TODO: for wisemcu
return 0;
#else
int32_t status;
uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 };
status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff));
Expand All @@ -132,6 +136,7 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
extra_info->overrun_count = test->overrun_count - temp_reset->overrun_count;
}
return status;
#endif
}

/******************************************************************
Expand All @@ -144,6 +149,10 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
*********************************************************************/
int32_t wfx_rsi_reset_count()
{
#ifdef RS9117_WIFI
//TODO: for wisemcu
return 0;
#else
int32_t status;
uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 };
status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff));
Expand All @@ -163,6 +172,7 @@ int32_t wfx_rsi_reset_count()
temp_reset->overrun_count = test->overrun_count;
}
return status;
#endif
}

/******************************************************************
Expand Down
8 changes: 5 additions & 3 deletions scripts/examples/gn_efr32_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,17 @@ else
case $1 in
--wifi)
if [ -z "$2" ]; then
echo "--wifi requires rs911x or wf200"
echo "--wifi requires rs911x or rs9117 or wf200"
exit 1
fi
if [ "$2" = "rs911x" ]; then
optArgs+="use_rs911x=true "
elif [ "$2" = "rs9117" ]; then
optArgs+="use_rs9117=true "
elif [ "$2" = "wf200" ]; then
optArgs+="use_wf200=true "
else
echo "Wifi usage: --wifi rs911x|wf200"
echo "Wifi usage: --wifi rs911x|rs9117|wf200"
exit 1
fi
USE_WIFI=true
Expand Down Expand Up @@ -176,7 +178,7 @@ else
shift
;;
*)
if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
if [ "$1" =~ *"use_rs911x=true"* ] || [ "$1" =~ *"use_rs9117=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then
USE_WIFI=true
fi

Expand Down
12 changes: 12 additions & 0 deletions third_party/silabs/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ template("efr32_sdk") {
"RSI_SPI_INTERFACE",
"RSI_WITH_OS",
]
} else if (use_rs9117) {
defines += [
"SL_HEAP_SIZE=32768",
"SL_WIFI=1",
"SL_WFX_USE_SPI",
"EFX32_RS911X=1",
"RS911X_WIFI",
"RS9117_WIFI",
"RSI_WLAN_ENABLE",
"RSI_SPI_INTERFACE",
"RSI_WITH_OS",
]
} else if (use_wf200) {
defines += [
"SL_HEAP_SIZE=24576",
Expand Down
1 change: 1 addition & 0 deletions third_party/silabs/silabs_board.gni
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare_args() {
# WIFI rcp boards options for wifi apps.
use_wf200 = false
use_rs911x = false
use_rs9117 = false
use_rs911x_sockets = false
}

Expand Down

0 comments on commit d9949ca

Please sign in to comment.