Skip to content

Commit 8ba371a

Browse files
Martin-NXPChin-Ran Lodinabenamar
authored
[NXP] rw61x openthread and BT updates (#33898)
* [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>
1 parent 5217353 commit 8ba371a

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

examples/platform/nxp/rt/rw61x/app/project_include/openthread/OpenThreadConfig.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,9 @@
6565
#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1
6666
#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1
6767

68-
// Temporary workaround till we can enable this via the gn
69-
#ifdef SPINEL_INTERFACE_RPMSG
70-
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 1
71-
#else
68+
#ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE
7269
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 0
73-
#endif /* SPINEL_INTERFACE_RPMSG */
70+
#endif /* OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE */
7471

7572
/*
7673
* "ot-nxp/src/rw/rw612/platform/radio.c" has a dependency on

src/platform/nxp/rt/rw61x/PlatformManagerImpl.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
#endif
5151

5252
extern "C" void BOARD_InitHardware(void);
53+
extern "C" void otPlatSetResetFunction(void (*fp)(void));
54+
extern "C" void initiateResetInIdle(void);
5355

5456
#if CHIP_DEVICE_CONFIG_ENABLE_WPA
5557

@@ -205,6 +207,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
205207
*/
206208
otPlatLogInit();
207209
otPlatRadioInit();
210+
otPlatSetResetFunction(initiateResetInIdle);
208211
#endif
209212

210213
#if CHIP_DEVICE_CONFIG_ENABLE_WPA
@@ -307,6 +310,22 @@ bool PlatformManagerImpl::GetResetInIdleValue(void)
307310
return resetInIdle;
308311
}
309312

313+
extern "C" void initiateResetInIdle(void)
314+
{
315+
PlatformMgr().Shutdown();
316+
PlatformMgrImpl().ScheduleResetInIdle();
317+
}
318+
319+
extern "C" void scheduleResetInIdle(void)
320+
{
321+
PlatformMgrImpl().ScheduleResetInIdle();
322+
}
323+
324+
extern "C" bool getResetInIdleValue(void)
325+
{
326+
return PlatformMgrImpl().GetResetInIdleValue();
327+
}
328+
310329
void PlatformManagerImpl::StopBLEConnectivity(void) {}
311330

312331
void PlatformManagerImpl::_Shutdown()

third_party/nxp/rt_sdk/transceiver/app_transceiver_config.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
#endif /* WIFI_TRANSCEIVER_SUPPORT */
4242

4343
#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
44+
#define CONFIG_BT_DEVICE_NAME "NXP BLE test"
4445
#include "edgefast_bluetooth_config.h"
4546
#endif /* CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE */

third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn

+6-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import("${nxp_sdk_build_root}/${nxp_sdk_name}/${nxp_sdk_name}.gni")
2626
openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp"
2727

2828
config("openthread_rw61x_config") {
29+
defines = []
2930
include_dirs = [
3031
"${openthread_nxp_root}/src/common",
3132
"${openthread_nxp_root}/src/common/br",
@@ -38,7 +39,7 @@ config("openthread_rw61x_config") {
3839
include_dirs += [ "${openthread_nxp_root}/src/common/spinel" ]
3940
}
4041
if (chip_enable_wifi && chip_enable_openthread) {
41-
defines = [
42+
defines += [
4243
"OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1",
4344
"OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1",
4445
"OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE=1",
@@ -53,6 +54,10 @@ config("openthread_rw61x_config") {
5354
"OPENTHREAD_CONFIG_GENERIC_TASKLET_ENABLE=1",
5455
]
5556
}
57+
# ot cli configs
58+
defines += [
59+
"OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1"
60+
]
5661
}
5762

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

0 commit comments

Comments
 (0)