-
Notifications
You must be signed in to change notification settings - Fork 652
/
firmware.patch
2071 lines (2001 loc) · 76.9 KB
/
firmware.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 8b29db11d4c46aa11532153fb3a349971e97ec90 Mon Sep 17 00:00:00 2001
From: Koen Kanters <[email protected]>
Date: Wed, 5 Jun 2024 22:25:56 +0200
Subject: [PATCH] Changes
---
.../cc13x2_cc26x2_tirtos7_ticlang.cmd | 8 +-
.../cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd | 8 +-
source/ti/zstack/mt/mt.h | 4 +
source/ti/zstack/mt/mt_util.c | 119 +++++-
source/ti/zstack/mt/mt_version.c | 6 +-
source/ti/zstack/mt/mt_zdo.c | 5 +
source/ti/zstack/npi/npi_tl_uart.c | 49 ++-
source/ti/zstack/stack/Config/preinclude.h | 109 +++++
source/ti/zstack/stack/af/af.c | 18 +-
source/ti/zstack/stack/nwk/nwk_globals.c | 8 +-
source/ti/zstack/stack/nwk/nwk_util.c | 49 +++
source/ti/zstack/stack/nwk/nwk_util.h | 4 +
source/ti/zstack/stack/sys/zglobals.c | 2 +-
source/ti/zstack/stack/zdo/zd_app.c | 8 +
source/ti/zstack/stack/zdo/zd_object.c | 14 +
source/ti/zstack/stack/zdo/zd_sec_mgr.c | 23 ++
source/ti/zstack/stack/zdo/zd_sec_mgr.h | 5 +
source/ti/zstack/startup/zstackstartup.c | 8 +
.../.project | 10 +
.../Stack/Config/znp_cnf.opts | 2 +
.../ti_devices_config.c | 108 +++++
.../ti_drivers_config.h | 274 +++++++++++++
.../ti_radio_config.c | 385 ++++++++++++++++++
.../ti_radio_config.h | 83 ++++
.../znp.syscfg | 10 +-
.../.project | 10 +
.../Stack/Config/znp_cnf.opts | 2 +
.../znp.syscfg | 6 +-
.../.project | 10 +
.../Stack/Config/znp_cnf.opts | 2 +
.../znp.syscfg | 6 +-
.../znp_LP_CC2652R7_tirtos7_ticlang/.project | 10 +
.../Stack/Config/znp_cnf.opts | 2 +
.../znp.syscfg | 6 +-
.../znp_LP_CC2652RB_tirtos7_ticlang/.project | 10 +
.../Stack/Config/znp_cnf.opts | 2 +
.../znp.syscfg | 6 +-
37 files changed, 1341 insertions(+), 50 deletions(-)
create mode 100644 source/ti/zstack/stack/Config/preinclude.h
create mode 100644 source/ti/zstack/stack/nwk/nwk_util.c
create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c
create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h
create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.c
create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.h
diff --git a/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd b/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd
index 54806e395..89a8b8291 100755
--- a/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd
+++ b/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd
@@ -60,7 +60,7 @@
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
---stack_size=1024
+--stack_size=4096
/* --library=rtsv7M3_T_le_eabi.lib */
/* The starting address of the application. Normally the interrupt vectors */
@@ -71,9 +71,9 @@
#endif
#define FLASH_BASE 0x00000000
-#define FLASH_SIZE (0x56000 - (NVOCMP_NVPAGES * 0x2000))
-#define FLASH_NV_BASE (0x56000 - (NVOCMP_NVPAGES * 0x2000))
-#define FLASH_NV_SIZE (NVOCMP_NVPAGES * 0x2000)
+#define FLASH_SIZE 0x50000
+#define FLASH_NV_BASE 0x50000
+#define FLASH_NV_SIZE 0x6000
#define FLASH_LAST_BASE 0x56000
#define FLASH_LAST_SIZE 0x2000
diff --git a/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd b/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd
index 1e5777c21..ababb2c7f 100755
--- a/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd
+++ b/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd
@@ -60,16 +60,16 @@
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
---stack_size=1024
+--stack_size=4096
/* --library=rtsv7M3_T_le_eabi.lib */
/* The starting address of the application. Normally the interrupt vectors */
/* must be located at the beginning of the application. */
#define FLASH_BASE 0x00000000
-#define FLASH_SIZE 0xAA000
-#define FLASH_NV_BASE 0xAA000
-#define FLASH_NV_SIZE 0x4000
+#define FLASH_SIZE 0xA6000
+#define FLASH_NV_BASE 0xA6000
+#define FLASH_NV_SIZE 0x8000
#define FLASH_LAST_BASE 0xAE000
#define FLASH_LAST_SIZE 0x2000
diff --git a/source/ti/zstack/mt/mt.h b/source/ti/zstack/mt/mt.h
index 0435d72c6..28d9e61ff 100644
--- a/source/ti/zstack/mt/mt.h
+++ b/source/ti/zstack/mt/mt.h
@@ -441,6 +441,8 @@ extern "C"
#define MT_UTIL_CALLBACK_SUB_CMD 0x06
#define MT_UTIL_TIME_ALIVE 0x09
+#define MT_UTIL_LED_CONTROL 0x0A
+
#define MT_UTIL_TEST_LOOPBACK 0x10
#define MT_UTIL_DATA_REQ 0x11
@@ -467,6 +469,8 @@ extern "C"
#define MT_UTIL_SRNG_GENERATE 0x4C
#endif
#define MT_UTIL_BIND_ADD_ENTRY 0x4D
+#define MT_UTIL_ASSOC_REMOVE 0x63 // Custom command
+#define MT_UTIL_ASSOC_ADD 0x64 // Custom command
#define MT_UTIL_ZCL_KEY_EST_INIT_EST 0x80
#define MT_UTIL_ZCL_KEY_EST_SIGN 0x81
diff --git a/source/ti/zstack/mt/mt_util.c b/source/ti/zstack/mt/mt_util.c
index 54cecc0d6..12d4ea6db 100644
--- a/source/ti/zstack/mt/mt_util.c
+++ b/source/ti/zstack/mt/mt_util.c
@@ -79,6 +79,9 @@
#include "mt_zdo.h"
#include "ssp.h"
+#include <ti/drivers/apps/LED.h>
+#include "ti_drivers_config.h"
+
#if !defined NONWK
#include "mt_nwk.h"
@@ -154,6 +157,9 @@ static void MT_UtilAPSME_LinkKeyNvIdGet(uint8_t *pBuf);
#endif //MT_SYS_KEY_MANAGEMENT
static void MT_UtilAPSME_RequestKeyCmd(uint8_t *pBuf);
static void MT_UtilAssocCount(uint8_t *pBuf);
+static void MT_UtilLedControl(uint8_t *pBuf);
+static void MT_UtilAssocRemove(uint8_t *pBuf);
+static void MT_UtilAssocAdd(uint8_t *pBuf);
static void MT_UtilAssocFindDevice(uint8_t *pBuf);
static void MT_UtilAssocGetWithAddress(uint8_t *pBuf);
static void MT_UtilBindAddEntry(uint8_t *pBuf);
@@ -286,6 +292,10 @@ uint8_t MT_UtilCommandProcessing(uint8_t *pBuf)
MT_UtilAssocCount(pBuf);
break;
+ case MT_UTIL_LED_CONTROL:
+ MT_UtilLedControl(pBuf);
+ break;
+
case MT_UTIL_ASSOC_FIND_DEVICE:
MT_UtilAssocFindDevice(pBuf);
break;
@@ -298,6 +308,14 @@ uint8_t MT_UtilCommandProcessing(uint8_t *pBuf)
MT_UtilBindAddEntry(pBuf);
break;
+ case MT_UTIL_ASSOC_REMOVE:
+ MT_UtilAssocRemove(pBuf);
+ break;
+
+ case MT_UTIL_ASSOC_ADD:
+ MT_UtilAssocAdd(pBuf);
+ break;
+
case MT_UTIL_SYNC_REQ:
MT_UtilSync();
break;
@@ -1401,6 +1419,95 @@ static void MT_UtilAssocCount(uint8_t *pBuf)
MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 2, pBuf);
}
+/***************************************************************************************************
+ * @fn MT_UtilLedControl
+ *
+ * @brief Proxy the LedControl() function.
+ *
+ * @param pBuf - pointer to the received buffer
+ *
+ * @return void
+ ***************************************************************************************************/
+static void MT_UtilLedControl(uint8_t *pBuf)
+{
+ uint8_t cmdId = pBuf[MT_RPC_POS_CMD1];
+ pBuf += MT_RPC_FRAME_HDR_SZ;
+
+ uint8_t mode = pBuf[1];
+
+ if (gLedHandle == NULL) {
+ LED_Params ledParams;
+ LED_Params_init(&ledParams);
+ gLedHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
+ }
+
+ if (mode==0) {
+ LED_setOff(gLedHandle);
+ } else if (mode == 5) {
+ gLedsDisabled = TRUE;
+ LED_setOff(gLedHandle);
+ } else {
+ LED_setOn(gLedHandle, LED_BRIGHTNESS_MAX);
+ }
+
+ uint8_t retValue = 0;
+ MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue);
+}
+
+/***************************************************************************************************
+ * @fn MT_UtilAssocRemove
+ *
+ * @brief Proxy the AssocRemove() function.
+ *
+ * @param pBuf - pointer to the received buffer
+ *
+ * @return void
+ ***************************************************************************************************/
+static void MT_UtilAssocRemove(uint8_t *pBuf)
+{
+ uint8_t cmdId;
+ uint8_t ieeeAddr[Z_EXTADDR_LEN];
+ uint8_t retValue = 0;
+
+ // parse header
+ cmdId = pBuf[MT_RPC_POS_CMD1];
+ pBuf += MT_RPC_FRAME_HDR_SZ;
+
+ /* IeeAddress */
+ OsalPort_memcpy(ieeeAddr, pBuf, Z_EXTADDR_LEN);
+
+ AssocRemove(ieeeAddr);
+
+ MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue);
+}
+
+/***************************************************************************************************
+ * @fn MT_UtilAssocAdd
+ *
+ * @brief Proxy the AssocAdd() function.
+ *
+ * @param pBuf - pointer to the received buffer
+ *
+ * @return void
+ ***************************************************************************************************/
+static void MT_UtilAssocAdd(uint8_t *pBuf)
+{
+ uint8_t cmdId;
+ uint8_t retValue = 0;
+
+ // parse header
+ cmdId = pBuf[MT_RPC_POS_CMD1];
+ pBuf += MT_RPC_FRAME_HDR_SZ;
+
+ AssocAddNew(
+ BUILD_UINT16(pBuf[Z_EXTADDR_LEN], pBuf[Z_EXTADDR_LEN + 1]),
+ pBuf,
+ pBuf[Z_EXTADDR_LEN + 2]
+ );
+
+ MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue);
+}
+
/***************************************************************************************************
* @fn MT_UtilAssocFindDevice
*
@@ -1525,6 +1632,9 @@ static void MT_UtilBindAddEntry(uint8_t *pBuf)
***************************************************************************************************/
static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev)
{
+ // Applied some fixes here, see https://github.com/Koenkk/zigbee2mqtt/issues/13478#issuecomment-1501085509
+ memset(pBuf, 0, sizeof(associated_devices_t));
+
if (NULL == pDev)
{
uint16_t rtrn = INVALID_NODE_ADDR;
@@ -1546,9 +1656,16 @@ static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev)
*pBuf++ = pDev->linkInfo.rxLqi;
*pBuf++ = pDev->linkInfo.inKeySeqNum;
OsalPort_bufferUint32( pBuf, pDev->linkInfo.inFrmCntr );
- *pBuf += 4;
+ pBuf += 4;
*pBuf++ = LO_UINT16(pDev->linkInfo.txFailure);
*pBuf++ = HI_UINT16(pDev->linkInfo.txFailure);
+ *pBuf++ = pDev->endDev.endDevCfg;
+ OsalPort_bufferUint32( pBuf, pDev->endDev.deviceTimeout);
+ pBuf += 4;
+ OsalPort_bufferUint32( pBuf, pDev->timeoutCounter);
+ pBuf += 4;
+ *pBuf++ = pDev->keepaliveRcv;
+ *pBuf++ = pDev->ctrl;
}
}
diff --git a/source/ti/zstack/mt/mt_version.c b/source/ti/zstack/mt/mt_version.c
index 831aeb699..f5559fc79 100644
--- a/source/ti/zstack/mt/mt_version.c
+++ b/source/ti/zstack/mt/mt_version.c
@@ -74,10 +74,14 @@
*****************************************************************************/
const uint8_t MTVersionString[] = {
2, /* Transport protocol revision */
- 0, /* Product ID */
+ 1, /* Product ID */
2, /* Software major release number */
7, /* Software minor release number */
1, /* Software maintenance release number */
+ ((CODE_REVISION_NUMBER >> 0) & 0xFF),
+ ((CODE_REVISION_NUMBER >> 8) & 0xFF),
+ ((CODE_REVISION_NUMBER >> 16) & 0xFF),
+ ((CODE_REVISION_NUMBER >> 24) & 0xFF),
};
/******************************************************************************
diff --git a/source/ti/zstack/mt/mt_zdo.c b/source/ti/zstack/mt/mt_zdo.c
index f43df5cbf..f0bc7faaa 100644
--- a/source/ti/zstack/mt/mt_zdo.c
+++ b/source/ti/zstack/mt/mt_zdo.c
@@ -1684,6 +1684,11 @@ static void MT_ZdoMgmtPermitJoinRequest(uint8_t *pBuf)
ignoreIndication = TRUE;
retValue = (uint8_t)ZDP_MgmtPermitJoinReq( &destAddr, duration, tcSignificance, 0);
ignoreIndication = FALSE;
+
+ // If joining is enabled via a router, ZDO_ProcessMgmtPermitJoinReq is never triggered thus
+ // ZDSecMgrPermitJoining is never called. Joining via a router would always fail now since
+ // ZDSecMgrPermitJoiningEnabled in zd_sec_mgr.c stays FALSE
+ ZDSecMgrPermitJoining(duration);
MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_ZDO), cmdId, 1, &retValue);
}
diff --git a/source/ti/zstack/npi/npi_tl_uart.c b/source/ti/zstack/npi/npi_tl_uart.c
index bfea71ca3..3c90f6757 100644
--- a/source/ti/zstack/npi/npi_tl_uart.c
+++ b/source/ti/zstack/npi/npi_tl_uart.c
@@ -1,5 +1,7 @@
/******************************************************************************
+******************************************************************************
+
@file npi_tl_uart.c
@brief NPI Transport Layer Module for UART
@@ -8,7 +10,7 @@
Target Device: cc13xx_cc26xx
******************************************************************************
-
+
Copyright (c) 2015-2024, Texas Instruments Incorporated
All rights reserved.
@@ -38,10 +40,6 @@
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- ******************************************************************************
-
-
*****************************************************************************/
// ****************************************************************************
@@ -114,6 +112,8 @@ static uint16 NPITLUART_readIsrBuf(size_t size);
//! \brief UART Callback invoked after UART write completion
static void NPITLUART_writeCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status);
+static void NPITLUART_eventCallBack(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg);
+
//! \brief UART Callback invoked after readsize has been read or timeout
static void NPITLUART_readCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status);
@@ -152,6 +152,8 @@ void NPITLUART_initializeTransport(uint8_t *tRxBuf, uint8_t *tTxBuf, npiCB_t npi
params.readCallback = NPITLUART_readCallBack;
params.writeCallback = NPITLUART_writeCallBack;
+ params.eventCallback = NPITLUART_eventCallBack;
+ params.eventMask |= UART2_EVENT_TX_FINISHED;
// Open / power on the UART.
uartHandle = UART2_open(CONFIG_DISPLAY_UART, ¶ms);
@@ -253,29 +255,34 @@ void NPITLUART_handleMrdyEvent(void)
//! \return void
// -----------------------------------------------------------------------------
static void NPITLUART_writeCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status)
+{}
+static void NPITLUART_eventCallBack(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg)
{
- uint32_t key;
- key = OsalPort_enterCS();
-
-#if (NPI_FLOW_CTRL == 1)
- if ( !RxActive )
+ if (event == UART2_EVENT_TX_FINISHED)
{
- UART2_readCancel(uartHandle);
+ uint32_t key;
+ key = OsalPort_enterCS();
+
+ #if (NPI_FLOW_CTRL == 1)
+ if ( !RxActive )
+ {
+ UART2_readCancel(uartHandle);
+ if ( npiTransmitCB )
+ {
+ npiTransmitCB(TransportRxLen,TransportTxLen);
+ }
+ }
+
+ TxActive = FALSE;
+ #else
if ( npiTransmitCB )
{
- npiTransmitCB(TransportRxLen,TransportTxLen);
+ npiTransmitCB(0,TransportTxLen);
}
- }
+ #endif // NPI_FLOW_CTRL = 1
- TxActive = FALSE;
-#else
- if ( npiTransmitCB )
- {
- npiTransmitCB(0,TransportTxLen);
+ OsalPort_leaveCS(key);
}
-#endif // NPI_FLOW_CTRL = 1
-
- OsalPort_leaveCS(key);
}
// -----------------------------------------------------------------------------
diff --git a/source/ti/zstack/stack/Config/preinclude.h b/source/ti/zstack/stack/Config/preinclude.h
new file mode 100644
index 000000000..0602c98c0
--- /dev/null
+++ b/source/ti/zstack/stack/Config/preinclude.h
@@ -0,0 +1,109 @@
+// Firmware version, used in mt_version.c
+#define CODE_REVISION_NUMBER 20240710
+
+// Required, otherwise firmware crashes after some uptime in some cases.
+#define NVOCMP_RECOVER_FROM_COMPACT_FAILURE
+
+// Required in order to use the extended MT API commands.
+#define FEATURE_NVEXID 1
+
+// Grants access to the security key data
+#define MT_SYS_KEY_MANAGEMENT 1
+
+// Increase by 1 to compensate for lag (default is 7)
+#define NWK_INDIRECT_MSG_TIMEOUT 8
+
+// Increase frame retries
+#define ZMAC_MAX_FRAME_RETRIES 7
+#define NWK_MAX_DATA_RETRIES 4
+
+// Increase MAC buffers, multiplied default value by 10
+#undef MAC_CFG_TX_DATA_MAX
+#define MAC_CFG_TX_DATA_MAX 50
+#undef MAC_CFG_TX_MAX
+#define MAC_CFG_TX_MAX 80
+#undef MAC_CFG_RX_MAX
+#define MAC_CFG_RX_MAX 50
+
+// From https://www.ti.com/lit/an/swra650b/swra650b.pdf
+#define LINK_DOWN_TRIGGER 12
+#define NWK_ROUTE_AGE_LIMIT 5
+#define DEF_NWK_RADIUS 15
+#define DEFAULT_ROUTE_REQUEST_RADIUS 8
+#define ZDNWKMGR_MIN_TRANSMISSIONS 0
+#define ROUTE_DISCOVERY_TIME 13
+#define MTO_RREQ_LIMIT_TIME 5000
+
+// Save memory (tables are not used)
+#undef NWK_MAX_BINDING_ENTRIES
+#define NWK_MAX_BINDING_ENTRIES 1
+#undef APS_MAX_GROUPS
+#define APS_MAX_GROUPS 1
+
+// Increase NV pages to allow for bigger device tables
+#undef NVOCMP_NVPAGES
+#define NVOCMP_NVPAGES 3
+
+// Disabling MULTICAST is required in order for proper group support.
+// If MULTICAST is not disabled, the group adress is not included in the APS header
+#define MULTICAST_ENABLED FALSE
+
+// Increase the max number of boardcasts, the default broadcast delivery time is 3 seconds
+// with the value below this will allow for 1 broadcast every 0.15 second
+#define MAX_BCAST 30
+
+// Reduce the APS ack wait duration from 6000 ms to 1000 ms (value * 2 = value in ms).
+// This will make requests timeout quicker, in pratice the default timeout of 6000ms is too long.
+#define APSC_ACK_WAIT_DURATION_POLLED 500
+
+// Enable MTO routing
+// MTO Routing will be used in addition to the standard AODV routing to provide additional route discovery opportunities.
+// Especially useful for larger networks with multiple hops.
+#define CONCENTRATOR_ENABLE TRUE
+#define CONCENTRATOR_ROUTE_CACHE TRUE
+#define CONCENTRATOR_DISCOVERY_TIME 60
+#define MAX_RTG_SRC_ENTRIES 250
+#define SRC_RTG_EXPIRY_TIME 10
+
+// The number of simultaneous route discoveries in network
+#define MAX_RREQ_ENTRIES 40
+
+// Size of the conflicted address table
+#define CONFLICTED_ADDR_TABLE_SIZE 15
+
+// Number of devices which have associated directly through the coordinator
+// This does not determine the upper limit in the number of nodes in the network,
+// just the upper limit for number of nodes directly connected to a certain routing node
+#define NWK_MAX_DEVICE_LIST 50
+
+// Determines the maximum number of devices in the Neighbor Table.
+#define MAX_NEIGHBOR_ENTRIES 25
+
+// Number of devices in the standard Routing Table, which is used for AODV routing.
+// Only stores information for 1-hop routes, so this table does not need to be as big as the Source Route table.
+#define MAX_RTG_ENTRIES 100
+#define ROUTE_EXPIRY_TIME 2
+
+// Determines the maximum number of “secure partners” that the network Trust Center (ZC) can support.
+// This value will be the upper limit of Zigbee 3.0 devices which are allowed in the network
+#define ZDSECMGR_TC_DEVICE_MAX 200
+
+// Set default transmit power to 9 for PA devices
+#if defined(CC1352P_2) || defined(DeviceFamily_CC13X2X7)
+ #define TXPOWER 9
+#endif
+
+// CC1352P2 specific
+#if defined(CC1352P_2)
+ // Different configs, comment `LAUNCHPAD_CONFIG` for "other" firmware
+ #define LAUNCHPAD_CONFIG 1
+ #ifdef LAUNCHPAD_CONFIG
+ #define CONFIG_RF_24GHZ 0x0000001c
+ #define CONFIG_RF_HIGH_PA 0x0000001d
+ #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xc1
+ #else
+ #define CONFIG_RF_24GHZ 0x0000006
+ #define CONFIG_RF_HIGH_PA 0x0000005
+ #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xfa
+ #endif
+#endif
diff --git a/source/ti/zstack/stack/af/af.c b/source/ti/zstack/stack/af/af.c
index d1de1d45c..1f791c719
--- a/source/ti/zstack/stack/af/af.c
+++ b/source/ti/zstack/stack/af/af.c
@@ -433,10 +433,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S
#if !defined ( APS_NO_GROUPS )
// Find the first endpoint for this group
grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST );
- if ( grpEp == APS_GROUPS_EP_NOT_FOUND )
- return; // No endpoint found
+ if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) {
+ // No endpoint found, default to endpoint 1.
+ // In the original source code there is a return here.
+ // This prevent the messags from being forwarded.
+ // For our use-case we want to capture all messages.
+ // Even if the coordinator is not in the group.
+ epDesc = afFindEndPointDesc( 1 );
+ }
+ else {
+ epDesc = afFindEndPointDesc( grpEp );
+ }
- epDesc = afFindEndPointDesc( grpEp );
if ( epDesc == NULL )
return; // Endpoint descriptor not found
@@ -483,7 +491,9 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S
// if the Wildcard ProfileID is received the message should not be sent to ZDO endpoint
if ( (aff->ProfileID == epProfileID) ||
((epDesc->endPoint == ZDO_EP) && (aff->ProfileID == ZDO_PROFILE_ID)) ||
- ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) )
+ ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) ||
+ // Forward messages to endpoint even with profileID mismatches
+ ((aff->ProfileID >= 0x100) && (aff->ProfileID <= 0xFC01)) )
{
// Save original endpoint
uint8_t endpoint = aff->DstEndPoint;
diff --git a/source/ti/zstack/stack/nwk/nwk_globals.c b/source/ti/zstack/stack/nwk/nwk_globals.c
index f90e3164f..cb57e8868
--- a/source/ti/zstack/stack/nwk/nwk_globals.c
+++ b/source/ti/zstack/stack/nwk/nwk_globals.c
@@ -91,10 +91,10 @@
* CONSTANTS
*/
// Maximums for the data buffer queue
-#define NWK_MAX_DATABUFS_WAITING 8 // Waiting to be sent to MAC
-#define NWK_MAX_DATABUFS_SCHEDULED 5 // Timed messages to be sent
-#define NWK_MAX_DATABUFS_CONFIRMED 5 // Held after MAC confirms
-#define NWK_MAX_DATABUFS_TOTAL 12 // Total number of buffers
+#define NWK_MAX_DATABUFS_WAITING 48 // Waiting to be sent to MAC
+#define NWK_MAX_DATABUFS_SCHEDULED 30 // Timed messages to be sent
+#define NWK_MAX_DATABUFS_CONFIRMED 30 // Held after MAC confirms
+#define NWK_MAX_DATABUFS_TOTAL 72 // Total number of buffers
// 1-255 (0 -> 256) X RTG_TIMER_INTERVAL
// A known shortcoming is that when a message is enqueued as "hold" for a
diff --git a/source/ti/zstack/stack/nwk/nwk_util.c b/source/ti/zstack/stack/nwk/nwk_util.c
new file mode 100644
index 000000000..da24c0388
--- /dev/null
+++ b/source/ti/zstack/stack/nwk/nwk_util.c
@@ -0,0 +1,49 @@
+#include "nwk_util.h"
+#include "aps_mede.h"
+
+#ifndef NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES
+#define NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES 50
+#endif
+
+typedef struct
+{
+ uint8_t extAddr[Z_EXTADDR_LEN];
+ uint8_t numBytesToMatch;
+} child_aging_leave_disabled_entry_t;
+
+child_aging_leave_disabled_entry_t childAgingLeaveDisabledList[NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES];
+uint8_t chidlAgingLeaveDisabledCnt = 0;
+
+uint8_t NwkDisableChildAgingLeaveAdd(uint8_t* extAddr, uint8_t numBytesToMatch)
+{
+ if (chidlAgingLeaveDisabledCnt == NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES) {
+ return 1;
+ }
+
+ memcpy(childAgingLeaveDisabledList[chidlAgingLeaveDisabledCnt].extAddr, extAddr, Z_EXTADDR_LEN);
+ childAgingLeaveDisabledList[chidlAgingLeaveDisabledCnt].numBytesToMatch = numBytesToMatch;
+ ++chidlAgingLeaveDisabledCnt;
+
+ return 0;
+}
+
+void NwkNotMyChildSendLeaveCustom (uint16_t dstAddr)
+{
+ uint8_t extAddr[Z_EXTADDR_LEN];
+ uint8_t idx;
+
+ if (!APSME_LookupExtAddr(dstAddr, extAddr)) {
+ return;
+ }
+
+ // Do not send leave request to devices where it is disabled for
+ for (idx = 0; idx < chidlAgingLeaveDisabledCnt; ++idx)
+ {
+ uint8_t offset = Z_EXTADDR_LEN - childAgingLeaveDisabledList[idx].numBytesToMatch;
+ if (memcmp(childAgingLeaveDisabledList[idx].extAddr + offset, extAddr + offset, childAgingLeaveDisabledList[idx].numBytesToMatch) == 0) {
+ return;
+ }
+ }
+
+ NwkNotMyChildSendLeave (dstAddr);
+};
diff --git a/source/ti/zstack/stack/nwk/nwk_util.h b/source/ti/zstack/stack/nwk/nwk_util.h
index 468227b32..4075d50df 100644
--- a/source/ti/zstack/stack/nwk/nwk_util.h
+++ b/source/ti/zstack/stack/nwk/nwk_util.h
@@ -638,6 +638,10 @@ extern uint8_t (*pNwkNotMyChildListAdd)( uint16_t devAddr, uint32_t timeoutValue
extern void (*pNwkNotMyChildListDelete)( uint16_t devAddr );
extern void (*pNwkNotMyChildSendLeave)( uint16_t dstAddr );
+// Custom functions
+void NwkNotMyChildSendLeaveCustom (uint16_t dstAddr);
+uint8_t NwkDisableChildAgingLeaveAdd(uint8_t* extAddr, uint8_t numBytesToMatch);
+
/****************************************************************************
* Utility function to copy NV items
****************************************************************************/
diff --git a/source/ti/zstack/stack/sys/zglobals.c b/source/ti/zstack/stack/sys/zglobals.c
index 0a1d7d2a6..37a0a7bf7 100644
--- a/source/ti/zstack/stack/sys/zglobals.c
+++ b/source/ti/zstack/stack/sys/zglobals.c
@@ -131,7 +131,7 @@ uint8_t zgSecurePermitJoin = TRUE;
// TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will
// encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09).
// If this flag is FALSE (default), the Trust Center will not send the NWK Key at all.
-uint8_t zgAllowRejoinsWithWellKnownKey = FALSE;
+uint8_t zgAllowRejoinsWithWellKnownKey = TRUE; // https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311#3265311
//allowInstallCodes
uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED;
diff --git a/source/ti/zstack/stack/zdo/zd_app.c b/source/ti/zstack/stack/zdo/zd_app.c
index d67a7798a..c769641dc 100644
--- a/source/ti/zstack/stack/zdo/zd_app.c
+++ b/source/ti/zstack/stack/zdo/zd_app.c
@@ -3163,6 +3163,14 @@ void ZDO_NetworkStatusCB( uint16_t nwkDstAddr, uint8_t statusCode, uint16_t dstA
// Routing error for dstAddr, this is informational and a Route
// Request should happen automatically.
}
+
+ if ( (nwkDstAddr == NLME_GetShortAddr())
+ && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) )
+ {
+ // Received a source route failure, remove route and rediscover.
+ RTG_RemoveRtgEntry( dstAddr, 0 );
+ NLME_RouteDiscoveryRequest( dstAddr, 0, 30 );
+ }
}
/******************************************************************************
diff --git a/source/ti/zstack/stack/zdo/zd_object.c b/source/ti/zstack/stack/zdo/zd_object.c
index 0c62d58d6..d1f899cec 100644
--- a/source/ti/zstack/stack/zdo/zd_object.c
+++ b/source/ti/zstack/stack/zdo/zd_object.c
@@ -676,6 +676,20 @@ void ZDO_ProcessNodeDescReq( zdoIncomingMsg_t *inMsg )
if ( desc != NULL )
{
+ uint8_t extAddr[Z_EXTADDR_LEN];
+ // Respond with Xiaomi manufacturer code when ieeAddr is withing Xiaomi address space
+ // Otherwise some devices don't work
+ // https://github.com/Koenkk/zigbee2mqtt/issues/9274
+ if (APSME_LookupExtAddr(inMsg->srcAddr.addr.shortAddr, extAddr) == TRUE &&
+ ((extAddr[7] == 0x04 && extAddr[6] == 0xcf && extAddr[5] == 0x8c) ||
+ (extAddr[7] == 0x54 && extAddr[6] == 0xef && extAddr[5] == 0x44))) {
+ desc->ManufacturerCode[0] = 0x5f;
+ desc->ManufacturerCode[1] = 0x11;
+ } else {
+ desc->ManufacturerCode[0] = 0x0;
+ desc->ManufacturerCode[1] = 0x0;
+ }
+
ZDP_NodeDescMsg( inMsg, aoi, desc );
}
else
diff --git a/source/ti/zstack/stack/zdo/zd_sec_mgr.c b/source/ti/zstack/stack/zdo/zd_sec_mgr.c
index 65d7857cc..3ae6825da 100644
--- a/source/ti/zstack/stack/zdo/zd_sec_mgr.c
+++ b/source/ti/zstack/stack/zdo/zd_sec_mgr.c
@@ -88,6 +88,7 @@ extern "C"
#include <ti/drivers/TRNG.h>
#include <ti/drivers/cryptoutils/cryptokey/CryptoKeyPlaintext.h>
+#include "ti_drivers_config.h"
/******************************************************************************
* CONSTANTS
@@ -145,6 +146,8 @@ typedef struct
*/
extern CONST uint8_t gMAX_NWK_SEC_MATERIAL_TABLE_ENTRIES;
extern pfnZdoCb zdoCBFunc[MAX_ZDO_CB_FUNC];
+bool gLedsDisabled = FALSE;
+LED_Handle gLedHandle;
/******************************************************************************
* EXTERNAL FUNCTIONS
@@ -1545,6 +1548,23 @@ void ZDSecMgrConfig( void )
}
}
+void updateLED( void )
+{
+ if (gLedHandle == NULL) {
+ LED_Params ledParams;
+ LED_Params_init(&ledParams);
+ gLedHandle = LED_open(CONFIG_LED_GREEN, &ledParams);
+ }
+
+ if (gLedsDisabled == FALSE && gLedHandle != NULL) {
+ if (ZDSecMgrPermitJoiningEnabled == TRUE) {
+ LED_setOn(gLedHandle, LED_BRIGHTNESS_MAX);
+ } else {
+ LED_setOff(gLedHandle);
+ }
+ }
+}
+
/******************************************************************************
* @fn ZDSecMgrPermitJoining
*
@@ -1573,6 +1593,7 @@ uint8_t ZDSecMgrPermitJoining( uint8_t duration )
ZDSecMgrPermitJoiningEnabled = FALSE;
}
+ updateLED();
accept = TRUE;
return accept;
@@ -1594,6 +1615,8 @@ void ZDSecMgrPermitJoiningTimeout( void )
ZDSecMgrPermitJoiningEnabled = FALSE;
ZDSecMgrPermitJoiningTimed = FALSE;
}
+
+ updateLED();
}
/******************************************************************************
diff --git a/source/ti/zstack/stack/zdo/zd_sec_mgr.h b/source/ti/zstack/stack/zdo/zd_sec_mgr.h
index b1ab5fcf4..a85f0ca08 100644
--- a/source/ti/zstack/stack/zdo/zd_sec_mgr.h
+++ b/source/ti/zstack/stack/zdo/zd_sec_mgr.h
@@ -77,6 +77,8 @@ extern "C"
#include "zcomdef.h"
#include "zd_app.h"
+#include <ti/drivers/apps/LED.h>
+
/******************************************************************************
* TYPEDEFS
*/
@@ -121,6 +123,9 @@ extern CONST uint16_t gZDSECMGR_TC_DEVICE_MAX;
extern CONST uint16_t gZDSECMGR_TC_DEVICE_IC_MAX;
extern uint8_t gZDSECMGR_TC_ATTEMPT_DEFAULT_KEY;
+extern bool gLedsDisabled;
+extern LED_Handle gLedHandle;
+
typedef struct
{
uint32_t FrameCounter;
diff --git a/source/ti/zstack/startup/zstackstartup.c b/source/ti/zstack/startup/zstackstartup.c
index 72073f7a9..47b2f1b4f 100644
--- a/source/ti/zstack/startup/zstackstartup.c
+++ b/source/ti/zstack/startup/zstackstartup.c
@@ -701,6 +701,14 @@ static void stackInit(void)
//Initialize default poll rates
nwk_InitializeDefaultPollRates();
+ // Use custom function for child aging leave requests
+ pNwkNotMyChildSendLeave = &NwkNotMyChildSendLeaveCustom;
+
+ // Disable child aging leave for Xiaomi/Aqara extAddr range to prevent them from being kicekd out of the network.
+ // They do not support child aging.
+ uint8_t extAddrXiaomi [] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x15, 0x00};
+ NwkDisableChildAgingLeaveAdd(extAddrXiaomi, 3);
+
/* Initialize MAC buffer */
macLowLevelBufferInit();
diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project
index 9a0c4b5ab..0732ecdb6 100644
--- a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project
+++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project
@@ -450,6 +450,11 @@
<type>1</type>
<locationURI>COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h</locationURI>
</link>
+ <link>
+ <name>Stack/Config/preinclude.h</name>
+ <type>1</type>
+ <locationURI>COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h</locationURI>
+ </link>
<link>
<name>Stack/MAC/mac_api.h</name>
<type>1</type>
@@ -715,6 +720,11 @@
<type>1</type>
<locationURI>COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h</locationURI>
</link>
+ <link>
+ <name>Stack/nwk/nwk_util.c</name>
+ <type>1</type>
+ <locationURI>COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c</locationURI>
+ </link>
<link>
<name>Stack/nwk/reflecttrack.h</name>
<type>1</type>
diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts
index 2a7704196..2e9e7ac6e 100644
--- a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts
+++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts
@@ -32,3 +32,5 @@
-DMT_GP_CB_FUNC
-DMT_APP_CNF_FUNC
+
+-include ../../../source/ti/zstack/stack/Config/preinclude.h
diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c
new file mode 100644
index 000000000..c80aafd91
--- /dev/null
+++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c
@@ -0,0 +1,108 @@
+/*
+ * ======== ti_devices_config.c ========
+ * Customer Configuration for CC26XX and CC13XX devices.
+ *
+ * DO NOT EDIT - This file is generated by the SysConfig tool.
+ *
+ */
+
+//#####################################
+// Force VDDR high setting (Higher output power but also higher power consumption)
+// This is also called "boost mode"
+//#####################################
+
+// Force VDDR voltage to the factory HH setting (FCFG1..VDDR_TRIM_HH)
+#define CCFG_FORCE_VDDR_HH 0x1
+
+
+//#####################################
+// Power settings
+//#####################################
+
+// Do not use the DC/DC during recharge in powerdown
+#define SET_CCFG_MODE_CONF_DCDC_RECHARGE 0x1
+
+// Do not use the DC/DC during active mode
+#define SET_CCFG_MODE_CONF_DCDC_ACTIVE 0x1
+
+
+//#####################################
+// Clock settings
+//#####################################
+
+// LF XOSC
+#define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x2
+
+// Apply cap-array delta
+#define SET_CCFG_MODE_CONF_XOSC_CAP_MOD 0x0
+// CUSTOM: set in preinclude.h
+// #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xc1
+
+//#####################################
+// Special HF clock source setting
+//#####################################
+
+// HF source is a 48 MHz xtal
+#define SET_CCFG_MODE_CONF_XOSC_FREQ 0x2
+
+//#####################################
+// Bootloader settings
+//#####################################
+
+// Enable ROM boot loader
+#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
+
+// Enabled boot loader backdoor
+#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
+
+// DIO number for boot loader backdoor
+#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xf
+
+// Active low to open boot loader backdoor
+#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x0
+
+
+// Default address in IMAGE_VALID_CONF register
+#define SET_CCFG_IMAGE_VALID_CONF_IMAGE_VALID 0x00000000
+
+//#####################################
+// Debug access settings
+//#####################################
+
+// Disable unlocking of TI Failure Analysis option
+#define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00
+
+// Disable customer key CKEY0-3 to be XOR'ed with TI FA option unlock key
+#define SET_CCFG_CCFG_TI_OPTIONS_C_FA_DIS 0xC5
+
+// Access enabled if also enabled in FCFG
+#define SET_CCFG_CCFG_TAP_DAP_0_CPU_DAP_ENABLE 0xC5
+
+// Access enabled if also enabled in FCFG
+#define SET_CCFG_CCFG_TAP_DAP_0_PWRPROF_TAP_ENABLE 0xC5
+
+// Access disabled
+#define SET_CCFG_CCFG_TAP_DAP_0_TEST_TAP_ENABLE 0x00
+
+// Access disabled
+#define SET_CCFG_CCFG_TAP_DAP_1_PBIST2_TAP_ENABLE 0x00
+
+// Access disabled
+#define SET_CCFG_CCFG_TAP_DAP_1_PBIST1_TAP_ENABLE 0x00
+
+// Access disabled
+#define SET_CCFG_CCFG_TAP_DAP_1_AON_TAP_ENABLE 0x00
+
+//#####################################
+// Select between cache or GPRAM
+//#####################################
+
+// Cache is enabled and GPRAM is disabled (unavailable)
+#define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x1
+
+/*
+ * ======== Include Base Settings for device ========
+ */
+
+#include <ti/devices/DeviceFamily.h>
+#include DeviceFamily_constructPath(startup_files/ccfg.c)
diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h
new file mode 100644
index 000000000..91923e3a1
--- /dev/null
+++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h
@@ -0,0 +1,274 @@
+/*
+ * ======== ti_drivers_config.h ========
+ * Configured TI-Drivers module declarations
+ *
+ * The macros defines herein are intended for use by applications which