Skip to content

Commit

Permalink
[NXP] rw61x openthread and BT updates (#33898)
Browse files Browse the repository at this point in the history
* [NXP][config][common] Change the BLE name for TC-DD-2.1

Signed-off-by: Chin-Ran Lo <nxf57500@lsv051039.swis.nl-cdc01.nxp.com>

* [NXP][platform][rw61x] Enabling otcli ping command in the matter-cli

* [NXP][examples][rw61x] Defining OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE as 0 by default
* OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE was defined as 1 in the past as a temporary workaround due to some ot files depending on ot coex api when spinel/rpmsg was enabled
* this is no longer needed, so redefining OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE as 0 to avoid having unuseful commands within the otcli/matter-cli

* [NXP][platform][rw61x] Expose API to get or set reset in idle and add call to otPlatSetResetFunction to set reset function in OT to application function

---------

Signed-off-by: Chin-Ran Lo <nxf57500@lsv051039.swis.nl-cdc01.nxp.com>
Co-authored-by: Chin-Ran Lo <nxf57500@lsv051039.swis.nl-cdc01.nxp.com>
Co-authored-by: Dina Benamar <dina.benamarelmaaroufi@nxp.com>
  • Loading branch information
3 people authored Jun 17, 2024
1 parent 5217353 commit 8ba371a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@
#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1
#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1

// Temporary workaround till we can enable this via the gn
#ifdef SPINEL_INTERFACE_RPMSG
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 1
#else
#ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 0
#endif /* SPINEL_INTERFACE_RPMSG */
#endif /* OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE */

/*
* "ot-nxp/src/rw/rw612/platform/radio.c" has a dependency on
Expand Down
19 changes: 19 additions & 0 deletions src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#endif

extern "C" void BOARD_InitHardware(void);
extern "C" void otPlatSetResetFunction(void (*fp)(void));
extern "C" void initiateResetInIdle(void);

#if CHIP_DEVICE_CONFIG_ENABLE_WPA

Expand Down Expand Up @@ -205,6 +207,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
*/
otPlatLogInit();
otPlatRadioInit();
otPlatSetResetFunction(initiateResetInIdle);
#endif

#if CHIP_DEVICE_CONFIG_ENABLE_WPA
Expand Down Expand Up @@ -307,6 +310,22 @@ bool PlatformManagerImpl::GetResetInIdleValue(void)
return resetInIdle;
}

extern "C" void initiateResetInIdle(void)
{
PlatformMgr().Shutdown();
PlatformMgrImpl().ScheduleResetInIdle();
}

extern "C" void scheduleResetInIdle(void)
{
PlatformMgrImpl().ScheduleResetInIdle();
}

extern "C" bool getResetInIdleValue(void)
{
return PlatformMgrImpl().GetResetInIdleValue();
}

void PlatformManagerImpl::StopBLEConnectivity(void) {}

void PlatformManagerImpl::_Shutdown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
#endif /* WIFI_TRANSCEIVER_SUPPORT */

#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
#define CONFIG_BT_DEVICE_NAME "NXP BLE test"
#include "edgefast_bluetooth_config.h"
#endif /* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE */
7 changes: 6 additions & 1 deletion third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp"

config("openthread_rw61x_config") {
defines = []
include_dirs = [
"${openthread_nxp_root}/src/common",
"${openthread_nxp_root}/src/common/br",
Expand All @@ -38,7 +39,7 @@ config("openthread_rw61x_config") {
include_dirs += [ "${openthread_nxp_root}/src/common/spinel" ]
}
if (chip_enable_wifi && chip_enable_openthread) {
defines = [
defines += [
"OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1",
"OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1",
"OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE=1",
Expand All @@ -53,6 +54,10 @@ config("openthread_rw61x_config") {
"OPENTHREAD_CONFIG_GENERIC_TASKLET_ENABLE=1",
]
}
# ot cli configs
defines += [
"OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1"
]
}

#Config used by the openthread stack to get the path to OpenthreadConfig.h
Expand Down

0 comments on commit 8ba371a

Please sign in to comment.