diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn
index 2780e2e..f2ddfd5 100644
--- a/examples/platform/silabs/SiWx917/BUILD.gn
+++ b/examples/platform/silabs/SiWx917/BUILD.gn
@@ -192,11 +192,11 @@
     "${silabs_common_plat_dir}/silabs_utils.cpp",
     "${silabs_common_plat_dir}/syscalls_stubs.cpp",
     "${silabs_common_plat_dir}/wifi/wfx_notify.cpp",
+    "${silabs_common_plat_dir}/wifi/wfx_rsi_host.cpp",
     "${silabs_plat_si91x_wifi_dir}/dhcp_client.cpp",
     "${silabs_plat_si91x_wifi_dir}/ethernetif.cpp",
     "${silabs_plat_si91x_wifi_dir}/lwip_netif.cpp",
     "SiWx917/sl_wifi_if.cpp",
-    "SiWx917/wfx_rsi_host.cpp",
   ]
 
   if (chip_enable_pw_rpc || chip_build_libshell || sl_uart_log_output) {
diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp
index 92d5ca4..ad3e15f 100644
--- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp
+++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp
@@ -90,10 +90,11 @@
 // TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else.
 #define WIFI_SCAN_TIMEOUT_TICK 10000
 
-WfxRsi_t wfx_rsi;
+#if !defined(MIN)
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+#endif
 
-/* Declare a variable to hold the data associated with the created event group. */
-StaticEventGroup_t rsiDriverEventGroup;
+WfxRsi_t wfx_rsi;
 
 bool hasNotifiedIPV6 = false;
 #if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
@@ -451,7 +452,6 @@
     }
 #endif // SL_MBEDTLS_USE_TINYCRYPT
 
-    wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
     wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
     osSemaphoreRelease(sl_rs_ble_init_sem);
     return status;
@@ -537,7 +537,9 @@
         strncpy(cur_scan_result.ssid, (char *) &scan_result->scan_info[idx].ssid, WFX_MAX_SSID_LENGTH);
 
         // if user has provided ssid, then check if the current scan result ssid matches the user provided ssid
-        if (wfx_rsi.scan_ssid != NULL && strcmp(wfx_rsi.scan_ssid, cur_scan_result.ssid) != CMP_SUCCESS)
+        if (wfx_rsi.scan_ssid != NULL &&
+            (strncmp(wfx_rsi.scan_ssid, cur_scan_result.ssid, MIN(strlen(wfx_rsi.scan_ssid), strlen(cur_scan_result.ssid))) ==
+             CMP_SUCCESS))
         {
             continue;
         }
diff --git a/examples/platform/silabs/efr32/rs911x/rs9117.gni b/examples/platform/silabs/efr32/rs911x/rs9117.gni
index 356b72f..cff3e3d 100644
--- a/examples/platform/silabs/efr32/rs911x/rs9117.gni
+++ b/examples/platform/silabs/efr32/rs911x/rs9117.gni
@@ -4,11 +4,11 @@
 
 rs911x_src_plat = [
   "${examples_plat_dir}/rs911x/sl_wifi_if.cpp",
-  "${examples_plat_dir}/rs911x/wfx_rsi_host.cpp",
   "${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_interrupt.c",
   "${examples_plat_dir}/rs911x/hal/sl_si91x_ncp_utility.c",
   "${examples_plat_dir}/rs911x/hal/efx32_ncp_host.c",
   "${silabs_common_plat_dir}/wifi/wfx_notify.cpp",
+  "${silabs_common_plat_dir}/wifi/wfx_rsi_host.cpp",
 ]
 
 rs9117_inc_plat = [
diff --git a/examples/platform/silabs/efr32/rs911x/rs911x.gni b/examples/platform/silabs/efr32/rs911x/rs911x.gni
index 54507de..b25fbef 100644
--- a/examples/platform/silabs/efr32/rs911x/rs911x.gni
+++ b/examples/platform/silabs/efr32/rs911x/rs911x.gni
@@ -3,13 +3,13 @@
 import("${efr32_sdk_build_root}/efr32_sdk.gni")
 
 rs911x_src_plat = [
-  "${examples_plat_dir}/rs911x/rsi_if.c",
-  "${examples_plat_dir}/rs911x/wfx_rsi_host.cpp",
+  "${examples_plat_dir}/rs911x/rsi_if.cpp",
   "${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",
   "${silabs_common_plat_dir}/wifi/wfx_notify.cpp",
+  "${silabs_common_plat_dir}/wifi/wfx_rsi_host.cpp",
 ]
 
 #
diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.c b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp
similarity index 93%
rename from examples/platform/silabs/efr32/rs911x/rsi_if.c
rename to examples/platform/silabs/efr32/rs911x/rsi_if.cpp
index f012128..d5560d6 100644
--- a/examples/platform/silabs/efr32/rs911x/rsi_if.c
+++ b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp
@@ -30,6 +30,9 @@
 // TODO Fix include order issue #33120
 #include "wfx_host_events.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #include "rsi_bootup_config.h"
 #include "rsi_common_apis.h"
 #include "rsi_data_types.h"
@@ -42,10 +45,13 @@
 #include "rsi_wlan_apis.h"
 #include "rsi_wlan_config.h"
 #include "rsi_wlan_non_rom.h"
-#include "silabs_utils.h"
+#ifdef __cplusplus
+}
+#endif
 
 #include "dhcp_client.h"
 #include "lwip/nd6.h"
+#include "silabs_utils.h"
 #include "wfx_rsi.h"
 
 // TODO convert this file to cpp and use CodeUtils.h
@@ -55,14 +61,17 @@
 
 #define WFX_QUEUE_SIZE 10
 
-/* Rsi driver Task will use as its stack */
-StackType_t driverRsiTaskStack[WFX_RSI_WLAN_TASK_SZ] = { 0 };
-
-/* Structure that will hold the TCB of the wfxRsi Task being created. */
-StaticTask_t driverRsiTaskBuffer;
-
-/* Declare a variable to hold the data associated with the created event group. */
-StaticEventGroup_t rsiDriverEventGroup;
+static osThreadId_t sDrvThread;
+constexpr uint32_t kDrvTaskSize = 1792;
+static uint8_t drvStack[kDrvTaskSize];
+static osThread_t sDrvTaskControlBlock;
+osThreadAttr_t kDrvTaskAttr = { .name       = "drv_rsi",
+                                .attr_bits  = osThreadDetached,
+                                .cb_mem     = &sDrvTaskControlBlock,
+                                .cb_size    = osThreadCbSize,
+                                .stack_mem  = drvStack,
+                                .stack_size = kDrvTaskSize,
+                                .priority   = osPriorityHigh };
 
 bool hasNotifiedIPV6 = false;
 #if (CHIP_DEVICE_CONFIG_ENABLE_IPV4)
@@ -83,6 +92,19 @@
 static uint8_t wfx_rsi_drv_buf[WFX_RSI_BUF_SZ];
 static wfx_wifi_scan_ext_t temp_reset;
 
+/******************************************************************
+ * @fn   void rsi_wireless_driver_task_wrapper(void * argument)
+ * @brief
+ *       wrapper thread for the driver task
+ * @param[in] argument: argument
+ * @return
+ *       None
+ *********************************************************************/
+static void rsi_wireless_driver_task_wrapper(void * argument)
+{
+    rsi_wireless_driver_task();
+}
+
 static void DHCPTimerEventHandler(void * arg)
 {
     WfxEvent_t event;
@@ -359,11 +381,10 @@
     }
     SILABS_LOG("wfx_rsi_init: start wireless drv task", __func__);
     /*
-     * Create the driver task
+     * Create the driver wrapper thread
      */
-    wfx_rsi.drv_task = xTaskCreateStatic((TaskFunction_t) rsi_wireless_driver_task, "rsi_drv", WFX_RSI_WLAN_TASK_SZ, NULL,
-                                         WLAN_TASK_PRIORITY, driverRsiTaskStack, &driverRsiTaskBuffer);
-    if (NULL == wfx_rsi.drv_task)
+    sDrvThread = osThreadNew(rsi_wireless_driver_task_wrapper, NULL, &kDrvTaskAttr);
+    if (NULL == sDrvThread)
     {
         SILABS_LOG("wfx_rsi_init: error: rsi_wireless_driver_task failed", __func__);
         return RSI_ERROR_INVALID_PARAM;
@@ -605,7 +626,8 @@
     sta_netif = wfx_get_netif(SL_WFX_STA_INTERFACE);
     if (sta_netif == NULL)
     {
-        // TODO: Notify the application that the interface is not set up or Chipdie here because we are in an unkonwn state
+        // TODO: Notify the application that the interface is not set up or Chipdie here because we
+        // are in an unkonwn state
         SILABS_LOG("HandleDHCPPolling: failed to get STA netif");
         return;
     }
@@ -664,7 +686,8 @@
     if (status != osOK)
     {
         SILABS_LOG("WfxPostEvent: failed to post event with status: %d", status);
-        // TODO: Handle error, requeue event depending on queue size or notify relevant task, Chipdie, etc.
+        // TODO: Handle error, requeue event depending on queue size or notify relevant task,
+        // Chipdie, etc.
     }
 }
 
@@ -673,7 +696,7 @@
     // Process event
     switch (inEvent.eventType)
     {
-    case WFX_EVT_STA_CONN:
+    case WFX_EVT_STA_CONN: {
         SILABS_LOG("Starting LwIP STA");
         wfx_rsi.dev_state |= WFX_RSI_ST_STA_CONNECTED;
         ResetDHCPNotificationFlags();
@@ -683,8 +706,9 @@
         // of AP connectivity.
         // wfx_connected_notify(0, &wfx_rsi.ap_mac); // This
         // is independant of IP connectivity.
-        break;
-    case WFX_EVT_STA_DISCONN:
+    }
+    break;
+    case WFX_EVT_STA_DISCONN: {
         // TODO: This event is not being posted anywhere, seems to be a dead code or we are missing something
         wfx_rsi.dev_state &=
             ~(WFX_RSI_ST_STA_READY | WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED | WFX_RSI_ST_STA_DHCP_DONE);
@@ -697,14 +721,15 @@
         wfx_ip_changed_notify(IP_STATUS_FAIL);
 #endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
         wfx_ipv6_notify(GET_IPV6_FAIL);
-        break;
+    }
+    break;
     case WFX_EVT_AP_START:
         // TODO: Currently unimplemented
         break;
     case WFX_EVT_AP_STOP:
         // TODO: Currently unimplemented
         break;
-    case WFX_EVT_SCAN:
+    case WFX_EVT_SCAN: {
 #ifdef SL_WFX_CONFIG_SCAN
         rsi_rsp_scan_t scan_rsp = { 0 };
         int32_t status          = rsi_wlan_bgscan_profile(1, &scan_rsp, sizeof(scan_rsp));
@@ -721,10 +746,12 @@
             {
                 scan = &scan_rsp.scan_info[x];
                 // is it a scan all or target scan
-                if (!wfx_rsi.scan_ssid || (wfx_rsi.scan_ssid && strcmp(wfx_rsi.scan_ssid, (char *) scan->ssid) == CMP_SUCCESS))
+                if (wfx_rsi.scan_ssid != NULL &&
+                    (strncmp(wfx_rsi.scan_ssid, (char *) scan->ssid, MIN(strlen(wfx_rsi.scan_ssid), sizeof(scan->ssid))) ==
+                     CMP_SUCCESS))
                 {
                     strncpy(ap.ssid, (char *) scan->ssid, MIN(sizeof(ap.ssid), sizeof(scan->ssid)));
-                    ap.security = scan->security_mode;
+                    ap.security = static_cast<wfx_sec_t>(scan->security_mode);
                     ap.rssi     = (-1) * scan->rssi_val;
                     configASSERT(sizeof(ap.bssid) >= BSSID_LEN);
                     configASSERT(sizeof(scan->bssid) >= BSSID_LEN);
@@ -748,22 +775,28 @@
             vPortFree(wfx_rsi.scan_ssid);
             wfx_rsi.scan_ssid = (char *) 0;
         }
-        break;
 #endif /* SL_WFX_CONFIG_SCAN */
-    case WFX_EVT_STA_START_JOIN:
+    }
+    break;
+    case WFX_EVT_STA_START_JOIN: {
         // saving the AP related info
         wfx_rsi_save_ap_info();
         // Joining to the network
         wfx_rsi_do_join();
-        break;
-    case WFX_EVT_STA_DO_DHCP:
+    }
+    break;
+    case WFX_EVT_STA_DO_DHCP: {
         StartDHCPTimer(WFX_RSI_DHCP_POLL_INTERVAL);
-        break;
-    case WFX_EVT_STA_DHCP_DONE:
+    }
+    break;
+    case WFX_EVT_STA_DHCP_DONE: {
         CancelDHCPTimer();
-        break;
-    case WFX_EVT_DHCP_POLL:
+    }
+    break;
+    case WFX_EVT_DHCP_POLL: {
         HandleDHCPPolling();
+    }
+    break;
     default:
         break;
     }
@@ -893,7 +926,7 @@
 int32_t wfx_rsi_send_data(void * p, uint16_t len)
 {
     int32_t status;
-    register uint8_t * host_desc;
+    uint8_t * host_desc;
     rsi_pkt_t * pkt;
 
     pkt       = (rsi_pkt_t *) p;
diff --git a/examples/platform/silabs/efr32/rs911x/wfx_rsi_host.cpp b/examples/platform/silabs/efr32/rs911x/wfx_rsi_host.cpp
deleted file mode 100644
index 8d92c0e..0000000
--- a/examples/platform/silabs/efr32/rs911x/wfx_rsi_host.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- *
- *    Copyright (c) 2022 Project CHIP Authors
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "em_bus.h"
-#include "em_cmu.h"
-#include "em_gpio.h"
-#include "em_ldma.h"
-#include "em_usart.h"
-#include "sl_status.h"
-
-#include "silabs_utils.h"
-
-#include "FreeRTOS.h"
-#include "event_groups.h"
-#include "task.h"
-
-#include "wfx_host_events.h"
-#include "wfx_rsi.h"
-
-/* wfxRsi Task will use as its stack */
-StackType_t wfxRsiTaskStack[WFX_RSI_TASK_SZ] = { 0 };
-
-/* Structure that will hold the TCB of the wfxRsi Task being created. */
-StaticTask_t wfxRsiTaskBuffer;
-
-/*********************************************************************
- * @fn  sl_status_t wfx_wifi_start(void)
- * @brief
- * Called from ConnectivityManagerImpl.cpp - to enable the device
- * Create the RSI task and let it deal with life.
- * @param[in]  None
- * @return  Returns SL_STATUS_OK if successful,
- *          SL_STATUS_FAIL otherwise
- ***********************************************************************/
-sl_status_t wfx_wifi_start(void)
-{
-    if (wfx_rsi.dev_state & WFX_RSI_ST_STARTED)
-    {
-        return SL_STATUS_OK;
-    }
-    wfx_rsi.dev_state |= WFX_RSI_ST_STARTED;
-    /*
-     * Create the Wifi driver task
-     */
-    wfx_rsi.wlan_task = xTaskCreateStatic(wfx_rsi_task, "wfx_rsi", WFX_RSI_TASK_SZ, NULL, WLAN_DRIVER_TASK_PRIORITY,
-                                          wfxRsiTaskStack, &wfxRsiTaskBuffer);
-
-    if (NULL == wfx_rsi.wlan_task)
-    {
-        return SL_STATUS_FAIL;
-    }
-    return SL_STATUS_OK;
-}
-
-/*********************************************************************
- * @fn  void wfx_enable_sta_mode(void)
- * @brief
- *      driver enable the STA mode
- * @param[in]  None
- * @return   None
- ***********************************************************************/
-void wfx_enable_sta_mode(void)
-{
-    wfx_rsi.dev_state |= WFX_RSI_ST_STA_MODE;
-}
-
-/*********************************************************************
- * @fn  bool wfx_is_sta_mode_enabled(void)
- * @brief
- *      driver enabled the STA mode
- * @param[in]  None
- * @return   mode
- ***********************************************************************/
-bool wfx_is_sta_mode_enabled(void)
-{
-    bool mode;
-    mode = !!(wfx_rsi.dev_state & WFX_RSI_ST_STA_MODE);
-    return mode;
-}
-
-/*********************************************************************
- * @fn  wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr)
- * @brief
- *      get the wifi mac address
- * @param[in]  Interface:
- * @param[in]  addr : address
- * @return
- *       None
- ***********************************************************************/
-void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr)
-{
-    if (addr)
-    {
-#ifdef SL_WFX_CONFIG_SOFTAP
-        *addr = (interface == SL_WFX_SOFTAP_INTERFACE) ? wfx_rsi.softap_mac : wfx_rsi.sta_mac;
-#else
-        *addr = wfx_rsi.sta_mac;
-#endif
-    }
-}
-
-/*********************************************************************
- * @fn  void wfx_set_wifi_provision(wfx_wifi_provision_t *cfg)
- * @brief
- *      Driver set the wifi provision
- * @param[in]  cfg:  wifi configuration
- * @return
- *       None
- ***********************************************************************/
-void wfx_set_wifi_provision(wfx_wifi_provision_t * cfg)
-{
-    if (cfg)
-    {
-        wfx_rsi.sec = *cfg;
-        wfx_rsi.dev_state |= WFX_RSI_ST_STA_PROVISIONED;
-    }
-}
-
-/*********************************************************************
- * @fn  bool wfx_get_wifi_provision(wfx_wifi_provision_t *wifiConfig)
- * @brief
- *      Driver get the wifi provision
- * @param[in]  wifiConfig:  wifi configuration
- * @return  return false if successful,
- *        true otherwise
- ***********************************************************************/
-bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig)
-{
-    if (wifiConfig != NULL)
-    {
-        if (wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED)
-        {
-            *wifiConfig = wfx_rsi.sec;
-            return true;
-        }
-    }
-    return false;
-}
-
-/*********************************************************************
- * @fn  void wfx_clear_wifi_provision(void)
- * @brief
- *      Driver is clear the wifi provision
- * @param[in]  None
- * @return  None
- ***********************************************************************/
-void wfx_clear_wifi_provision(void)
-{
-    memset(&wfx_rsi.sec, 0, sizeof(wfx_rsi.sec));
-    wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_PROVISIONED;
-}
-
-/*************************************************************************
- * @fn sl_status_t wfx_connect_to_ap(void)
- * @brief
- * Start a JOIN command to the AP - Done by the wfx_rsi task
- * @param[in]   None
- * @return  returns SL_STATUS_OK if successful,
- *         SL_STATUS_INVALID_CONFIGURATION otherwise
- ****************************************************************************/
-sl_status_t wfx_connect_to_ap(void)
-{
-    WfxEvent_t event;
-    if (wfx_rsi.dev_state & WFX_RSI_ST_STA_PROVISIONED)
-    {
-        SILABS_LOG("Connecting to access point -> SSID: %s", &wfx_rsi.sec.ssid[0]);
-        event.eventType = WFX_EVT_STA_START_JOIN;
-        WfxPostEvent(&event);
-    }
-    else
-    {
-        SILABS_LOG("Error: access point not provisioned.");
-        return SL_STATUS_INVALID_CONFIGURATION;
-    }
-    return SL_STATUS_OK;
-}
-
-#if SL_ICD_ENABLED
-#if SLI_SI917
-/*********************************************************************
- * @fn  sl_status_t wfx_power_save()
- * @brief
- *      Implements the power save in sleepy application
- * @param[in]  sl_si91x_ble_state : State to set for the BLE
-               sl_si91x_wifi_state : State to set for the WiFi
- * @return  SL_STATUS_OK if successful,
- *          SL_STATUS_FAIL otherwise
- ***********************************************************************/
-sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t sl_si91x_wifi_state)
-{
-    return (wfx_rsi_power_save(sl_si91x_ble_state, sl_si91x_wifi_state) ? SL_STATUS_FAIL : SL_STATUS_OK);
-}
-#else  // For RS9116
-/*********************************************************************
- * @fn  sl_status_t wfx_power_save()
- * @brief
- *      Implements the power save in sleepy application
- * @param[in]  None
- * @return  SL_STATUS_OK if successful,
- *          SL_STATUS_FAIL otherwise
- ***********************************************************************/
-sl_status_t wfx_power_save()
-{
-    return (wfx_rsi_power_save() ? SL_STATUS_FAIL : SL_STATUS_OK);
-}
-#endif /* SLI_SI917 */
-#endif /* SL_ICD_ENABLED */
-
-/*********************************************************************
- * @fn  void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif)
- * @brief
- *      Implement the ipv6 setup
- * @param[in]  whichif:
- * @return  None
- ***********************************************************************/
-void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif)
-{
-    /*
-     * TODO: Implement IPV6 setup, currently in wfx_rsi_task()
-     * This is hooked with MATTER code.
-     */
-}
-
-/*********************************************************************
- * @fn  bool wfx_is_sta_connected(void)
- * @brief
- *      called fuction when driver is connected to STA
- * @param[in]  None
- * @return  returns ture if successful,
- *          false otherwise
- ***********************************************************************/
-bool wfx_is_sta_connected(void)
-{
-    bool status;
-    status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_CONNECTED) ? true : false;
-    return status;
-}
-
-/*********************************************************************
- * @fn  wifi_mode_t wfx_get_wifi_mode()
- * @brief
- *      get the wifi mode
- * @param[in]  None
- * @return  return WIFI_MODE_NULL if successful,
- *          WIFI_MODE_STA otherwise
- ***********************************************************************/
-wifi_mode_t wfx_get_wifi_mode()
-{
-    if (wfx_rsi.dev_state & WFX_RSI_ST_DEV_READY)
-        return WIFI_MODE_STA;
-    return WIFI_MODE_NULL;
-}
-
-/*********************************************************************
- * @fn  sl_status_t wfx_sta_discon(void)
- * @brief
- *      called fuction when STA disconnected
- * @param[in]  None
- * @return  return SL_STATUS_OK if successful,
- *          SL_STATUS_FAIL otherwise
- ***********************************************************************/
-sl_status_t wfx_sta_discon(void)
-{
-    int32_t status;
-    status = wfx_rsi_disconnect();
-    wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTED;
-    return status;
-}
-#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
-/*********************************************************************
- * @fn  bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if)
- * @brief
- *      called fuction when driver have ipv4 address
- * @param[in]  which_if:
- * @return  returns ture if successful,
- *          false otherwise
- ***********************************************************************/
-bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if)
-{
-    bool status = false;
-    if (which_if == SL_WFX_STA_INTERFACE)
-    {
-        status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_DHCP_DONE) ? true : false;
-    }
-    else
-    {
-        status = false; /* TODO */
-    }
-    return status;
-}
-#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
-
-/*********************************************************************
- * @fn  bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if)
- * @brief
- *      called fuction when driver have ipv6 address
- * @param[in]  which_if:
- * @return  returns ture if successful,
- *          false otherwise
- ***********************************************************************/
-bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if)
-{
-    bool status = false;
-    if (which_if == SL_WFX_STA_INTERFACE)
-    {
-        status = (wfx_rsi.dev_state & WFX_RSI_ST_STA_CONNECTED) ? true : false;
-    }
-    else
-    {
-        status = false; /* TODO */
-    }
-    return status;
-}
-
-/*********************************************************************
- * @fn  bool wfx_hw_ready(void)
- * @brief
- *      called fuction when driver ready
- * @param[in]  None
- * @return  returns ture if successful,
- *          false otherwise
- ***********************************************************************/
-bool wfx_hw_ready(void)
-{
-    return (wfx_rsi.dev_state & WFX_RSI_ST_DEV_READY) ? true : false;
-}
-
-/*********************************************************************
- * @fn  int32_t wfx_get_ap_info(wfx_wifi_scan_result_t *ap)
- * @brief
- *      get the access point information
- * @param[in]  ap: access point
- * @return
- *      access point information
- ***********************************************************************/
-int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap)
-{
-    return wfx_rsi_get_ap_info(ap);
-}
-
-/*********************************************************************
- * @fn   int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t *extra_info)
- * @brief
- *      get the access point extra information
- * @param[in]  extra_info:access point extra information
- * @return
- *      access point extra information
- ***********************************************************************/
-int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info)
-{
-    return wfx_rsi_get_ap_ext(extra_info);
-}
-
-/***************************************************************************
- * @fn   int32_t wfx_reset_counts(){
- * @brief
- *      get the driver reset count
- * @param[in]  None
- * @return
- *      reset count
- *****************************************************************************/
-int32_t wfx_reset_counts()
-{
-    return wfx_rsi_reset_count();
-}
-
-#ifdef SL_WFX_CONFIG_SCAN
-/*******************************************************************************
- * @fn   bool wfx_start_scan(char *ssid, void (*callback)(wfx_wifi_scan_result_t *))
- * @brief
- *       called fuction when driver start scaning
- * @param[in]  ssid:
- * @return returns ture if successful,
- *          false otherwise
- *******************************************************************************/
-bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *))
-{
-    int sz;
-    WfxEvent_t event;
-    if (wfx_rsi.scan_cb)
-        return false; /* Already in progress */
-    if (ssid)
-    {
-        sz = strlen(ssid);
-        if ((wfx_rsi.scan_ssid = (char *) pvPortMalloc(sz + 1)) == (char *) 0)
-        {
-            return false;
-        }
-        strcpy(wfx_rsi.scan_ssid, ssid);
-    }
-    wfx_rsi.scan_cb = callback;
-
-    event.eventType = WFX_EVT_SCAN;
-    WfxPostEvent(&event);
-
-    return true;
-}
-
-/***************************************************************************
- * @fn   void wfx_cancel_scan(void)
- * @brief
- *      called function when driver cancel scaning
- * @param[in]  None
- * @return
- *      None
- *****************************************************************************/
-void wfx_cancel_scan(void)
-{
-    /* Not possible */
-}
-#endif /* SL_WFX_CONFIG_SCAN */
diff --git a/examples/platform/silabs/uart.cpp b/examples/platform/silabs/uart.cpp
index 7d6dad9..a05dd70 100644
--- a/examples/platform/silabs/uart.cpp
+++ b/examples/platform/silabs/uart.cpp
@@ -138,7 +138,13 @@
                                            .cb_size    = osThreadCbSize,
                                            .stack_mem  = uartStack,
                                            .stack_size = kUartTaskSize,
-                                           .priority   = osPriorityRealtime };
+#if SLI_SI91X_MCU_INTERFACE
+                                           // Reducing the priority of the UART task to avoid priority inversion
+                                           .priority = osPriorityNormal
+#else
+                                           .priority = osPriorityRealtime
+#endif // SLI_SI91X_MCU_INTERFACE
+};
 
 typedef struct
 {
diff --git a/examples/platform/silabs/wfx_rsi.h b/examples/platform/silabs/wfx_rsi.h
index 502dd1a..5e7358e 100644
--- a/examples/platform/silabs/wfx_rsi.h
+++ b/examples/platform/silabs/wfx_rsi.h
@@ -17,7 +17,9 @@
 #pragma once
 
 #include <app/icd/server/ICDServerConfig.h>
+#include <cmsis_os2.h>
 #include <event_groups.h>
+#include <sl_cmsis_os2_common.h>
 #include <wfx_host_events.h>
 
 #ifndef RSI_BLE_ENABLE
@@ -28,10 +30,8 @@
  * Interface to RSI Sapis
  */
 
-#define WFX_RSI_WLAN_TASK_SZ (1024 + 512 + 256) /* Stack for the WLAN task	 	*/
-#define WFX_RSI_TASK_SZ (1024 + 1024)           /* Stack for the WFX/RSI task		*/
-#define WFX_RSI_BUF_SZ (1024 * 10)              /* May need tweak 			*/
-// TODO: Default values are usually in minutes, but this is in ms. Confirm if this is correct
+#define WFX_RSI_WLAN_TASK_SZ (1024 + 512 + 256) /* Stack for the WLAN task	 	*/ // TODO: For rs9116
+#define WFX_RSI_BUF_SZ (1024 * 10)
 #define WFX_RSI_DHCP_POLL_INTERVAL (250) /* Poll interval in ms for DHCP		*/
 #define WFX_RSI_NUM_TIMERS (2)           /* Number of RSI timers to alloc	*/
 
@@ -71,14 +71,6 @@
 
 typedef struct wfx_rsi_s
 {
-    // TODO: Change tp WfxEventType_e once the event queue is implemented
-    EventGroupHandle_t events;
-    TaskHandle_t drv_task;
-    TaskHandle_t wlan_task;
-    TaskHandle_t init_task;
-#ifdef RSI_BLE_ENABLE
-    TaskHandle_t ble_task;
-#endif
     uint16_t dev_state;
     uint16_t ap_chan; /* The chan our STA is using	*/
     wfx_wifi_provision_t sec;
diff --git a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.cpp b/examples/platform/silabs/wifi/wfx_rsi_host.cpp
similarity index 89%
rename from examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.cpp
rename to examples/platform/silabs/wifi/wfx_rsi_host.cpp
index 83c3a95..921ec82 100644
--- a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.cpp
+++ b/examples/platform/silabs/wifi/wfx_rsi_host.cpp
@@ -28,11 +28,20 @@
 #include "wfx_host_events.h"
 #include "wfx_rsi.h"
 
-/* wfxRsi Task will use as its stack */
-StackType_t wfxRsiTaskStack[WFX_RSI_TASK_SZ] = { 0 };
+#include <platform/CHIPDeviceLayer.h>
 
-/* Structure that will hold the TCB of the wfxRsi Task being created. */
-StaticTask_t wfxRsiTaskBuffer;
+// Thread for the WLAN RSI
+static osThreadId_t sWlanThread;
+constexpr uint32_t kWlanTaskSize = 2048;
+static uint8_t wlanStack[kWlanTaskSize];
+static osThread_t sWlanTaskControlBlock;
+constexpr osThreadAttr_t kWlanTaskAttr = { .name       = "wlan_rsi",
+                                           .attr_bits  = osThreadDetached,
+                                           .cb_mem     = &sWlanTaskControlBlock,
+                                           .cb_size    = osThreadCbSize,
+                                           .stack_mem  = wlanStack,
+                                           .stack_size = kWlanTaskSize,
+                                           .priority   = osPriorityAboveNormal7 };
 
 /*********************************************************************
  * @fn  sl_status_t wfx_wifi_start(void)
@@ -47,22 +56,20 @@
 {
     if (wfx_rsi.dev_state & WFX_RSI_ST_STARTED)
     {
-        SILABS_LOG("%s: already started.", __func__);
         return SL_STATUS_OK;
     }
+
     wfx_rsi.dev_state |= WFX_RSI_ST_STARTED;
     SILABS_LOG("%s: starting..", __func__);
+
     /*
      * Create the Wifi driver task
      */
-    wfx_rsi.wlan_task = xTaskCreateStatic(wfx_rsi_task, "wfx_rsi", WFX_RSI_TASK_SZ, NULL, WLAN_DRIVER_TASK_PRIORITY,
-                                          wfxRsiTaskStack, &wfxRsiTaskBuffer);
+    // Creating a Wi-Fi driver thread
+    sWlanThread = osThreadNew(wfx_rsi_task, NULL, &kWlanTaskAttr);
 
-    if (NULL == wfx_rsi.wlan_task)
-    {
-        SILABS_LOG("%s: error: failed to create task.", __func__);
-        return SL_STATUS_FAIL;
-    }
+    VerifyOrReturnError(sWlanThread != NULL, SL_STATUS_FAIL);
+
     return SL_STATUS_OK;
 }
 
@@ -191,6 +198,7 @@
 }
 
 #if SL_ICD_ENABLED
+#if SLI_SI917
 /*********************************************************************
  * @fn  sl_status_t wfx_power_save()
  * @brief
@@ -202,12 +210,22 @@
  ***********************************************************************/
 sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t sl_si91x_wifi_state)
 {
-    if (wfx_rsi_power_save(sl_si91x_ble_state, sl_si91x_wifi_state) != SL_STATUS_OK)
-    {
-        return SL_STATUS_FAIL;
-    }
-    return SL_STATUS_OK;
+    return (wfx_rsi_power_save(sl_si91x_ble_state, sl_si91x_wifi_state) ? SL_STATUS_FAIL : SL_STATUS_OK);
 }
+#else  // For RS9116
+/*********************************************************************
+ * @fn  sl_status_t wfx_power_save()
+ * @brief
+ *      Implements the power save in sleepy application
+ * @param[in]  None
+ * @return  SL_STATUS_OK if successful,
+ *          SL_STATUS_FAIL otherwise
+ ***********************************************************************/
+sl_status_t wfx_power_save()
+{
+    return (wfx_rsi_power_save() ? SL_STATUS_FAIL : SL_STATUS_OK);
+}
+#endif /* SLI_SI917 */
 #endif /* SL_ICD_ENABLED */
 
 /*********************************************************************
diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h
index 86d1b05..4ff6d9d 100644
--- a/src/platform/silabs/BLEManagerImpl.h
+++ b/src/platform/silabs/BLEManagerImpl.h
@@ -196,7 +196,7 @@
     void CancelBleAdvTimeoutTimer(void);
     CHIPoBLEConState * GetConnectionState(uint8_t conId, bool allocate = false);
     static void DriveBLEState(intptr_t arg);
-    static void BleAdvTimeoutHandler(TimerHandle_t xTimer);
+    static void BleAdvTimeoutHandler(void * arg);
     uint8_t GetTimerHandle(uint8_t connectionHandle, bool allocate);
 
 #if (SLI_SI91X_ENABLE_BLE || RSI_BLE_ENABLE)
diff --git a/src/platform/silabs/efr32/BLEManagerImpl.cpp b/src/platform/silabs/efr32/BLEManagerImpl.cpp
index 2fcceef..e29e34e 100644
--- a/src/platform/silabs/efr32/BLEManagerImpl.cpp
+++ b/src/platform/silabs/efr32/BLEManagerImpl.cpp
@@ -101,7 +101,7 @@
 #define BLE_CONFIG_MIN_CE_LENGTH (0)      // Leave to min value
 #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value
 
-TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer.
+osTimerId_t sbleAdvTimeoutTimer; // SW timer
 
 const uint8_t UUID_CHIPoBLEService[]      = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
                                               0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 };
@@ -122,13 +122,8 @@
     memset(mIndConfId, kUnusedIndex, sizeof(mIndConfId));
     mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled;
 
-    // Create FreeRTOS sw timer for BLE timeouts and interval change.
-    sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer",       // Just a text name, not used by the RTOS kernel
-                                       pdMS_TO_TICKS(1),    // == default timer period
-                                       false,               // no timer reload (==one-shot)
-                                       (void *) this,       // init timer id = ble obj context
-                                       BleAdvTimeoutHandler // timer callback handler
-    );
+    // SW timer for BLE timeouts and interval change.
+    sbleAdvTimeoutTimer = osTimerNew(BleAdvTimeoutHandler, osTimerOnce, NULL, NULL);
 
     mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART);
     mFlags.Set(Flags::kFastAdvertisingEnabled, true);
@@ -991,7 +986,7 @@
     return freeIndex;
 }
 
-void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer)
+void BLEManagerImpl::BleAdvTimeoutHandler(void * arg)
 {
     if (BLEMgrImpl().mFlags.Has(Flags::kFastAdvertisingEnabled))
     {
@@ -1016,7 +1011,7 @@
 
 void BLEManagerImpl::CancelBleAdvTimeoutTimer(void)
 {
-    if (xTimerStop(sbleAdvTimeoutTimer, pdMS_TO_TICKS(0)) == pdFAIL)
+    if (osTimerStop(sbleAdvTimeoutTimer) != osOK)
     {
         ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer");
     }
@@ -1024,15 +1019,7 @@
 
 void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs)
 {
-    if (xTimerIsTimerActive(sbleAdvTimeoutTimer))
-    {
-        CancelBleAdvTimeoutTimer();
-    }
-
-    // timer is not active, change its period to required value (== restart).
-    // FreeRTOS- Block for a maximum of 100 ticks if the change period command
-    // cannot immediately be sent to the timer command queue.
-    if (xTimerChangePeriod(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(100)) != pdPASS)
+    if (osTimerStart(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs)) != osOK)
     {
         ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer");
     }
diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp
index 75853c8..6fea061 100644
--- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp
+++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp
@@ -71,13 +71,22 @@
 
 extern sl_wfx_msg_t event_msg;
 
-StaticTask_t rsiBLETaskStruct;
-
 osSemaphoreId_t sl_ble_event_sem;
 osSemaphoreId_t sl_rs_ble_init_sem;
 
-/* wfxRsi Task will use as its stack */
-StackType_t wfxBLETaskStack[WFX_RSI_TASK_SZ] = { 0 };
+osTimerId_t sbleAdvTimeoutTimer;
+
+static osThreadId_t sBleThread;
+constexpr uint32_t kBleTaskSize = 2048;
+static uint8_t bleStack[kBleTaskSize];
+static osThread_t sBleTaskControlBlock;
+constexpr osThreadAttr_t kBleTaskAttr = { .name       = "rsi_ble",
+                                          .attr_bits  = osThreadDetached,
+                                          .cb_mem     = &sBleTaskControlBlock,
+                                          .cb_size    = osThreadCbSize,
+                                          .stack_mem  = bleStack,
+                                          .stack_size = kBleTaskSize,
+                                          .priority   = osPriorityHigh };
 
 using namespace ::chip;
 using namespace ::chip::Ble;
@@ -110,7 +119,7 @@
     chip::DeviceLayer::Internal::BLEMgrImpl().HandleBootEvent();
 }
 
-void sl_ble_event_handling_task(void)
+void sl_ble_event_handling_task(void * args)
 {
     int32_t event_id;
 
@@ -236,8 +245,6 @@
 #define BLE_CONFIG_MIN_CE_LENGTH (0)      // Leave to min value
 #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value
 
-TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer.
-
 const uint8_t UUID_CHIPoBLEService[]      = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
                                               0x00, 0x10, 0x00, 0x00, 0xF6, 0xFF, 0x00, 0x00 };
 const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF };
@@ -253,13 +260,9 @@
     sl_rs_ble_init_sem = osSemaphoreNew(1, 0, NULL);
     sl_ble_event_sem   = osSemaphoreNew(1, 0, NULL);
 
-    wfx_rsi.ble_task = xTaskCreateStatic((TaskFunction_t) sl_ble_event_handling_task, "rsi_ble", WFX_RSI_TASK_SZ, NULL,
-                                         BLE_DRIVER_TASK_PRIORITY, wfxBLETaskStack, &rsiBLETaskStruct);
+    sBleThread = osThreadNew(sl_ble_event_handling_task, NULL, &kBleTaskAttr);
 
-    if (wfx_rsi.ble_task == NULL)
-    {
-        ChipLogError(DeviceLayer, "%s: error: failed to create ble task.", __func__);
-    }
+    VerifyOrReturnError(sBleThread != nullptr, CHIP_ERROR_INCORRECT_STATE);
 
     // Initialize the CHIP BleLayer.
     err = BleLayer::Init(this, this, &DeviceLayer::SystemLayer());
@@ -269,13 +272,8 @@
     memset(mIndConfId, kUnusedIndex, sizeof(mIndConfId));
     mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled;
 
-    // Create FreeRTOS sw timer for BLE timeouts and interval change.
-    sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer",                              // Just a text name, not used by the RTOS kernel
-                                       pdMS_TO_TICKS(BLE_DEFAULT_TIMER_PERIOD_MS), // == default timer period
-                                       false,                                      // no timer reload (==one-shot)
-                                       (void *) this,                              // init timer id = ble obj context
-                                       BleAdvTimeoutHandler                        // timer callback handler
-    );
+    // SW timer for BLE timeouts and interval change.
+    sbleAdvTimeoutTimer = osTimerNew(BleAdvTimeoutHandler, osTimerOnce, NULL, NULL);
 
     mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART);
     mFlags.Set(Flags::kFastAdvertisingEnabled, true);
@@ -1070,7 +1068,7 @@
     return freeIndex;
 }
 
-void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer)
+void BLEManagerImpl::BleAdvTimeoutHandler(void * arg)
 {
     if (BLEMgrImpl().mFlags.Has(Flags::kFastAdvertisingEnabled))
     {
@@ -1081,7 +1079,7 @@
 
 void BLEManagerImpl::CancelBleAdvTimeoutTimer(void)
 {
-    if (xTimerStop(sbleAdvTimeoutTimer, pdMS_TO_TICKS(0)) == pdFAIL)
+    if (osTimerStop(sbleAdvTimeoutTimer) != osOK)
     {
         ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer");
     }
@@ -1089,15 +1087,7 @@
 
 void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs)
 {
-    if (xTimerIsTimerActive(sbleAdvTimeoutTimer))
-    {
-        CancelBleAdvTimeoutTimer();
-    }
-
-    // timer is not active, change its period to required value (== restart).
-    // FreeRTOS- Block for a maximum of 100 ticks if the change period command
-    // cannot immediately be sent to the timer command queue.
-    if (xTimerChangePeriod(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(100)) != pdPASS)
+    if (osTimerStart(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs)) != osOK)
     {
         ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer");
     }
