diff --git a/LICENSE b/LICENSE
index 971caa5..2052862 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018 Koen Kanters
+Copyright (c) 2018-2021 Koen Kanters
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 53c35d6..e92f115 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,2 @@
# Z-Stack-firmware
-This reposistory contains:
-- Compiled Z-Stack firmwares (`.hex` files)
- - If you want to use these to flash to your CC253X (using the [Flash Programmer (not v2)](http://www.ti.com/tool/FLASH-PROGRAMMER) for example).
- - If you want to use these to flash to your CC2652R (using the [Flash Programmer v2](http://www.ti.com/tool/FLASH-PROGRAMMER) for example).
-- Instructions on how to compile them
+This repository contains compilation instructions and compiled Z-Stack firmwares for the Texas Instruments CC2530, CC2531, CC2538, CC1352P, CC2652R and CC2652RB.
diff --git a/coordinator/README.md b/coordinator/README.md
index 7c30f41..925722c 100644
--- a/coordinator/README.md
+++ b/coordinator/README.md
@@ -1,5 +1,5 @@
# Z-Stack coordinator firmwares
-This repository contains various Z-Stack coordinator firmwares.
+This directory contains various Z-Stack coordinator firmwares.
## Overiew
@@ -70,7 +70,7 @@ This repository contains various Z-Stack coordinator firmwares.
Z-Stack_3.x.0 |
- CC26X2R1, CC1352P_2 |
+ CC2652R, CC2652RB, CC1352P-2 |
3.0 |
50 |
100/200 |
@@ -82,11 +82,11 @@ This repository contains various Z-Stack coordinator firmwares.
-### I'm a Zigbee2MQTT user, which one should I use?
+### I'm using a CC2530 or CC2531, which firmware should I use?
This depends:
-- Zigbee 3.0 coordinators are only recommended for CC26X2R1 and CC1352P_2 (other devices might not be powerful enough)
-- If you have a network of 1 - 30 devices, the Z-Stack_Home_1.2 **default** firmware is recommended.
-- If you have a network of 30+ devices, the Z-Stack_Home_1.2 **source routing** firmware is recommended.
+- Zigbee 3.0 firmwares are **not** recommended for the CC2530 and CC2531 (since those are not powerful enough)
+- If you have a network of 1 - 15 devices, the Z-Stack_Home_1.2 **default** firmware is recommended.
+- If you have a network of 15+ devices, the Z-Stack_Home_1.2 **source routing** firmware is recommended.
- Note that the **source routing** firmware only supports 5 direct children, therefore you need to have routers in range of the coordinator.
### Legend
diff --git a/coordinator/Z-Stack_3.x.0/CHANGELOG.md b/coordinator/Z-Stack_3.x.0/CHANGELOG.md
index 46cde18..96f2dbe 100644
--- a/coordinator/Z-Stack_3.x.0/CHANGELOG.md
+++ b/coordinator/Z-Stack_3.x.0/CHANGELOG.md
@@ -1,3 +1,9 @@
+# 20210120
+- Optimize network parameters (according to https://www.ti.com/lit/an/swra650b/swra650b.pdf)
+- Change default CC2652R/CC2652RB/CC1352P-2/CC2652P transmit power from 0dBm to 5dBm
+- Potential fix for Hue end devices disconnecting
+- SimpleLink SDK 4.40.00.44 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.40.00.44/exports/changelog.html))
+
# 20201026
- SimpleLink SDK 4.30.00.54 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.30.00.54/exports/changelog.html))
- Expose `AssocAdd` function
diff --git a/coordinator/Z-Stack_3.x.0/COMPILE.md b/coordinator/Z-Stack_3.x.0/COMPILE.md
index a4d349e..ff6b4b7 100644
--- a/coordinator/Z-Stack_3.x.0/COMPILE.md
+++ b/coordinator/Z-Stack_3.x.0/COMPILE.md
@@ -1,14 +1,24 @@
# Compiling the firmware
## Setup development environment
-1. Download and install [SIMPLELINK-CC13X2-26X2-SDK_4.30.00.54](http://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK).
-1. Download and install [Code Composer Studio 10.1.1.00004](http://www.ti.com/tool/CCSTUDIO).
+1. Download and install [SIMPLELINK-CC13X2-26X2-SDK_4.40.00.44](http://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK).
+1. Download and install [Code Composer Studio 10.2.0.00009](http://www.ti.com/tool/CCSTUDIO).
## Compiling
1. Start Code Composer Studio
-1. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13x2_26x2_sdk_4_20_00_35/examples/rtos`. Select `znp_CC26X2R1_LAUNCHXL_tirtos_css`, `znp_CC1352P_2_LAUNCHXL_tirtos_css` and `znp_CC2652RB_LAUNCHXL_tirtos_css`. Press *Finish*.
+1. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13x2_26x2_sdk_4_40_00_44/examples/rtos`. Select `znp_CC26X2R1_LAUNCHXL_tirtos_css`, `znp_CC1352P_2_LAUNCHXL_tirtos_css` and `znp_CC2652RB_LAUNCHXL_tirtos_css`. Press *Finish*.
1. In Code Composer Studio, expand the 3 projects and for each open `znp.syscfg`, change `Minimal Poll Period (ms)` to `1000`, change it back to `100` immediately and save the file.
1. Go to your CCS workspace and copy `firmware.patch` to the root.
1. Open Git Bash, go to your CCS root and apply the patch using `git apply firmware.patch --ignore-space-change`.
-1. Build both projects; right click -> *Build project*.
-1. Once finished, the firmware can be found under `znp_[CC26X2R1/CC1352P_2/CC2652RB]_LAUNCHXL_tirtos_ccs/default/znp_[CC26X2R1/CC1352P_2]_LAUNCHXL_tirtos_ccs.hex`
+1. **Only** for `znp_CC1352P_2_LAUNCHXL_tirtos_css`:
+ - Right click on `znp.syscfg` -> *Delete*
+ - Right click on `znp_CC1352P_2_LAUNCHXL_tirtos_css` -> *Properties*.
+ - Go to *(CCS) Build* - *ARM Compiler* - *Include Options* -> Under *Add dir to #include search path (--include_path, -l)* add `${PROJECT_ROOT}/syscfg` as the **last** entry.
+ - Go to *(CCS) Build* - *ARM Linker* - *File Search Path* -> Under *Include library file or command file as input (--library, -l)* change `${PROJECT_BUILD_DIR}/syscfg/ti_utils_build_linker.cmd.genlibs` to `${PROJECT_ROOT}/syscfg/ti_utils_build_linker.cmd.genlibs`
+1. Build the 3 projects; right click -> *Build project*.
+ - **Important:** by default the **launchpad** variant of the CC1352P2_CC2652P (= `znp_CC1352P_2_LAUNCHXL_tirtos_ccs`) is build. To build the **other** variant comment `#define LAUNCHPAD_CONFIG 1` in `preinclude.h` (located under `Stack/Config/`), don't forget to save.
+1. Once finished, the firmware can be found under `znp_[CC26X2R1/CC1352P_2/CC2652RB]_LAUNCHXL_tirtos_ccs/default/znp_[CC26X2R1/CC2652RB/CC1352P_2]_LAUNCHXL_tirtos_ccs.hex`
+ - `znp_CC26X2R1_LAUNCHXL_tirtos_ccs.hex` -> CC2652R
+ - `znp_CC2652RB_LAUNCHXL_tirtos_ccs.hex` -> CC2652RB
+ - `znp_CC1352P_2_LAUNCHXL_tirtos_ccs.hex` -> CC1352P-2 and CC2652P
+
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210120.zip b/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210120.zip
new file mode 100644
index 0000000..f4769cd
Binary files /dev/null and b/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210120.zip differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210120.zip b/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210120.zip
new file mode 100644
index 0000000..99603de
Binary files /dev/null and b/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210120.zip differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC1352P_2_20201026.zip b/coordinator/Z-Stack_3.x.0/bin/CC1352P_2_20201026.zip
deleted file mode 100644
index c93cefa..0000000
Binary files a/coordinator/Z-Stack_3.x.0/bin/CC1352P_2_20201026.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20201026.zip b/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20201026.zip
deleted file mode 100644
index 9787a76..0000000
Binary files a/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20201026.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20210120.zip b/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20210120.zip
new file mode 100644
index 0000000..3d55eed
Binary files /dev/null and b/coordinator/Z-Stack_3.x.0/bin/CC2652RB_20210120.zip differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC2652R_20210120.zip b/coordinator/Z-Stack_3.x.0/bin/CC2652R_20210120.zip
new file mode 100644
index 0000000..1a4d71d
Binary files /dev/null and b/coordinator/Z-Stack_3.x.0/bin/CC2652R_20210120.zip differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/CC26X2R1_20201026.zip b/coordinator/Z-Stack_3.x.0/bin/CC26X2R1_20201026.zip
deleted file mode 100644
index ed45214..0000000
Binary files a/coordinator/Z-Stack_3.x.0/bin/CC26X2R1_20201026.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_3.x.0/bin/README.md b/coordinator/Z-Stack_3.x.0/bin/README.md
new file mode 100644
index 0000000..a5b4cce
--- /dev/null
+++ b/coordinator/Z-Stack_3.x.0/bin/README.md
@@ -0,0 +1,101 @@
+# Tested adapters
+
+**WARNING:** Make sure you flash the correct firmware! Flashing the **wrong** firmware might lock your bootloader preventing future flashing. If you are a Zigbee2MQTT user and don't know what to pick click the **Coordinator firmware** link of your adapter on: https://www.zigbee2mqtt.io/information/supported_adapters.html.
+
+
+
+
+ Adapter |
+ TI Chip/Module Used |
+ Firmware to Flash |
+ BSL Trigger Pin (1) |
+ Auto-BSL (2) |
+ RF Switch Control Pins (3) |
+ LED(s) |
+
+
+
+
+ TI LAUNCHXL-CC26xR1 |
+ CC2652R |
+ CC2652R_*.zip
|
+ DIO_13 |
+ No |
+ N/A |
+ DIO_6 (Red) DIO_7 (Green)
|
+
+
+ TI LAUNCHXL-CC1352P-2 |
+ CC1352P |
+ CC1352P2_CC2652P_launchpad_*.zip |
+ DIO_15 |
+ No |
+ DIO_28: 2.4Ghz DIO_29: 20dBm PA DIO_30: Sub-1GHz |
+ DIO_6 (Red) DIO_7 (Green)
|
+
+
+ Electrolama zzh |
+ CC2652R |
+ CC2652R_*.zip |
+ DIO_13 |
+ No |
+ N/A |
+ DIO_7 (Pink) |
+
+
+ Electrolama zzhp-lite |
+ CC2652P (Ebyte E72)
|
+ CC1352P2_CC2652P_other_*.zip |
+ DIO_15 |
+ Yes |
+ DIO_5: 20dBm PA ?? DIO_6: 2.4GHz ??
|
+ DIO_7 (Pink) |
+
+
+ Electrolama zzhp |
+ CC2652P |
+ CC1352P2_CC2652P_other_*.zip |
+ DIO_15 |
+ Yes |
+ DIO_5: 20dBm PA ?? DIO_6: 2.4GHz ?? |
+ DIO_7 (Pink) |
+
+
+ Electrolama zoe2 |
+ CC1352P (Ebyte E79)
|
+ CC1352P2_CC2652P_other_*.zip |
+ DIO_15 |
+ No |
+ DIO_5: 20dBm PA ?? DIO_6: 2.4GHz ?? |
+ DIO_7 (Pink) |
+
+
+ slaesh's CC2652RB stick |
+ CC2652RB |
+ CC2652RB_*.zip |
+ DIO_13 |
+ Yes |
+ N/A |
+ DIO_7 |
+
+
+ ZigStar
|
+ CC2652P (RFSTAR RF-BM-2652P2)
|
+ CC1352P2_CC2652P_launchpad_*.zip |
+ DIO_15 |
+ Only for CH340C ver. |
+ DIO_28: 2.4Ghz DIO_29: 20dBm PA |
+ DIO_6 (Green) DIO_7 (Red)
|
+
+
+ Zigbeer E72 by Egony |
+ CC2652P (Ebyte E72) |
+ CC1352P2_CC2652P_other_*.zip |
+ DIO_15 |
+ No |
+ DIO_5: 20dBm PA DIO_6: 2.4GHz |
+ DIO_8 (Green) DIO_7 (Red)
|
+
+
+
+
diff --git a/coordinator/Z-Stack_3.x.0/firmware.patch b/coordinator/Z-Stack_3.x.0/firmware.patch
index dc9ae70..3bfc270 100644
--- a/coordinator/Z-Stack_3.x.0/firmware.patch
+++ b/coordinator/Z-Stack_3.x.0/firmware.patch
@@ -1,41 +1,57 @@
-From c9e8956a44680858cc7ceaef25621d564b190fa8 Mon Sep 17 00:00:00 2001
+From fad3180b73f7c8a913ca9473100395c05718bc27 Mon Sep 17 00:00:00 2001
From: Koen Kanters
-Date: Mon, 31 Aug 2020 16:45:20 +0200
+Date: Fri, 13 Nov 2020 14:36:02 +0100
Subject: [PATCH 1/1] Own changes
---
- .../Application/mt/mt.h | 2 +
- .../Application/mt/mt_util.c | 64 +++++++++++++++++++
- .../Application/mt/mt_version.c | 8 ++-
- .../Stack/Config/preinclude.h | 37 +++++++++++
- .../Stack/Config/znp_cnf.opts | 2 +
- .../Stack/af/af.c | 18 ++++--
- .../Stack/sys/zglobals.c | 6 +-
- .../Stack/zdo/zd_app.c | 22 +++----
- .../cc13x2lp.cmd | 6 +-
- znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 +-
- .../Application/mt/mt.h | 2 +
- .../Application/mt/mt_util.c | 64 +++++++++++++++++++
- .../Application/mt/mt_version.c | 8 ++-
- .../Stack/Config/preinclude.h | 37 +++++++++++
- .../Stack/Config/znp_cnf.opts | 2 +
- .../Stack/af/af.c | 18 ++++--
- .../Stack/sys/zglobals.c | 6 +-
- .../Stack/zdo/zd_app.c | 22 +++----
- znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd | 12 +---
- znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 +-
- .../Application/mt/mt.h | 2 +
- .../Application/mt/mt_util.c | 64 +++++++++++++++++++
- .../Application/mt/mt_version.c | 8 ++-
- .../Stack/Config/preinclude.h | 37 +++++++++++
- .../Stack/Config/znp_cnf.opts | 2 +
- .../Stack/af/af.c | 18 ++++--
- .../Stack/sys/zglobals.c | 6 +-
- .../Stack/zdo/zd_app.c | 22 +++----
- znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd | 6 +-
- znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg | 5 +-
- 30 files changed, 438 insertions(+), 78 deletions(-)
+ .../Application/mt/mt.h | 2 +
+ .../Application/mt/mt_util.c | 64 +
+ .../Application/mt/mt_version.c | 8 +-
+ .../Stack/Config/preinclude.h | 65 +
+ .../Stack/Config/znp_cnf.opts | 2 +
+ .../Stack/af/af.c | 18 +-
+ .../Stack/nwk/nwk_globals.c | 8 +-
+ .../Stack/sys/zglobals.c | 6 +-
+ .../Stack/zdo/zd_app.c | 30 +-
+ .../cc13x2_cc26x2.cmd | 6 +-
+ .../syscfg/ti_devices_config.c | 103 ++
+ .../syscfg/ti_drivers_config.c | 1060 +++++++++++++++++
+ .../syscfg/ti_drivers_config.h | 283 +++++
+ .../syscfg/ti_radio_config.c | 340 ++++++
+ .../syscfg/ti_radio_config.h | 77 ++
+ .../syscfg/ti_utils_build_linker.cmd.genlibs | 35 +
+ .../syscfg/ti_zstack_config.h | 226 ++++
+ .../Application/mt/mt.h | 2 +
+ .../Application/mt/mt_util.c | 64 +
+ .../Application/mt/mt_version.c | 8 +-
+ .../Stack/Config/preinclude.h | 52 +
+ .../Stack/Config/znp_cnf.opts | 2 +
+ .../Stack/af/af.c | 18 +-
+ .../Stack/nwk/nwk_globals.c | 8 +-
+ .../Stack/sys/zglobals.c | 6 +-
+ .../Stack/zdo/zd_app.c | 30 +-
+ .../cc13x2_cc26x2.cmd | 6 +-
+ znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg | 31 +-
+ .../Application/mt/mt.h | 2 +
+ .../Application/mt/mt_util.c | 64 +
+ .../Application/mt/mt_version.c | 8 +-
+ .../Stack/Config/preinclude.h | 52 +
+ .../Stack/Config/znp_cnf.opts | 2 +
+ .../Stack/af/af.c | 18 +-
+ .../Stack/nwk/nwk_globals.c | 8 +-
+ .../Stack/sys/zglobals.c | 6 +-
+ .../Stack/zdo/zd_app.c | 30 +-
+ .../cc13x2_cc26x2.cmd | 6 +-
+ znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg | 31 +-
+ 39 files changed, 2681 insertions(+), 106 deletions(-)
create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+ create mode 100644 znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
create mode 100644 znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
create mode 100644 znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
@@ -142,14 +158,14 @@ index 90d6d4a..4d50083 100644
* @fn MT_UtilAssocFindDevice
*
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
-index 63c143b..fc3895f 100644
+index 63c143b..11325fd 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@@ -43,15 +43,21 @@
#include "zcomdef.h"
#include "mt_version.h"
-+#define CODE_REVISION_NUMBER 20201026
++#define CODE_REVISION_NUMBER 20210120
+
/******************************************************************************
* CONSTANTS
@@ -170,10 +186,10 @@ index 63c143b..fc3895f 100644
/******************************************************************************
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
-index 0000000..18ec8d6
+index 0000000..3332194
--- /dev/null
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
-@@ -0,0 +1,37 @@
+@@ -0,0 +1,65 @@
+#define MT_SYS_KEY_MANAGEMENT 1
+#define FEATURE_NVEXID 1
+
@@ -199,10 +215,10 @@ index 0000000..18ec8d6
+ * Enable MTO routing
+ */
+#define CONCENTRATOR_ENABLE TRUE
-+#define CONCENTRATOR_DISCOVERY_TIME 120
++#define CONCENTRATOR_DISCOVERY_TIME 100
+#define CONCENTRATOR_ROUTE_CACHE TRUE
+#define MAX_RTG_SRC_ENTRIES 200
-+#define SRC_RTG_EXPIRY_TIME 255
++#define SRC_RTG_EXPIRY_TIME 2
+
+/**
+ * Scale other device tables appropriately
@@ -211,6 +227,34 @@ index 0000000..18ec8d6
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
++
++/**
++ * 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
++
++// 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
++
++// Different configs, uncomment for for launchpad 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
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index 6e3cb6a..1f90cc6 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@@ -259,8 +303,27 @@ index 3a7afa3..e3a2706 100644
{
// Save original endpoint
uint8_t endpoint = aff->DstEndPoint;
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+index a78ad3c..bfe7884 100644
+--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+@@ -65,10 +65,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 16 // Waiting to be sent to MAC
++#define NWK_MAX_DATABUFS_SCHEDULED 10 // Timed messages to be sent
++#define NWK_MAX_DATABUFS_CONFIRMED 10 // Held after MAC confirms
++#define NWK_MAX_DATABUFS_TOTAL 24 // 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/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
-index e716024..f8d8404 100644
+index 8ea2ac3..4879330 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -104,7 +104,7 @@ uint8_t zgSecurePermitJoin = TRUE;
@@ -284,7 +347,7 @@ index e716024..f8d8404 100644
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
-index 17ac2f5..9c0021b 100644
+index 1f807ca..b935b6a 100644
--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -419,12 +419,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
@@ -305,7 +368,7 @@ index 17ac2f5..9c0021b 100644
}
else
{
-@@ -882,12 +881,11 @@ void ZDApp_NetworkStartEvt( void )
+@@ -885,12 +884,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
@@ -323,10 +386,25 @@ index 17ac2f5..9c0021b 100644
}
else
{
-diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd
-index 2b5d2ae..c12e296 100755
---- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd
-+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2lp.cmd
+@@ -3132,6 +3130,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/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
+index 2dcc711..2c23e66 100755
+--- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
@@ -70,9 +70,9 @@
/* must be located at the beginning of the application. */
@@ -340,29 +418,2172 @@ index 2b5d2ae..c12e296 100755
#define FLASH_LAST_BASE 0x56000
#define FLASH_LAST_SIZE 0x2000
-diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
-index 9680070..9ba7dae 100644
---- a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
-+++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/znp.syscfg
-@@ -52,6 +52,7 @@ CCFG.enableBootloaderBackdoor = true;
- CCFG.dioBootloaderBackdoor = 15;
- CCFG.levelBootloaderBackdoor = "Active low";
- CCFG.forceVddr = true;
-+CCFG.enableDCDC = false;
- CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0";
-
- rfdesign.rfDesign = "LAUNCHXL-CC1352P-2";
-@@ -72,8 +73,8 @@ ECJPAKE1.$name = "CONFIG_ECJPAKE_0";
-
- NVS1.$name = "CONFIG_NVSINTERNAL";
- NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0";
--NVS1.internalFlash.regionBase = 0x52000;
--NVS1.internalFlash.regionSize = 0x4000;
-+NVS1.internalFlash.regionBase = 0x50000;
-+NVS1.internalFlash.regionSize = 0x6000;
-
- NVS2.$name = "CONFIG_NVSEXTERNAL";
- NVS2.nvsType = "External";
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+new file mode 100644
+index 0000000..b66a3f9
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+@@ -0,0 +1,103 @@
++/*
++ * ======== 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
++// #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
++
++
++//#####################################
++// Debug access settings
++//#####################################
++
++// Disable unlocking of TI FA option.
++#define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00
++
++// 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
++#include DeviceFamily_constructPath(startup_files/ccfg.c)
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+new file mode 100644
+index 0000000..db9821f
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+@@ -0,0 +1,1060 @@
++/*
++ * ======== ti_drivers_config.c ========
++ * Configured TI-Drivers module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P_2_LAUNCHXL
++ * by the SysConfig tool.
++ */
++
++#include
++#include
++
++#ifndef DeviceFamily_CC13X2
++#define DeviceFamily_CC13X2
++#endif
++
++#include
++
++#include "ti_drivers_config.h"
++
++/*
++ * =============================== AESCBC ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESCBC_COUNT 1
++AESCBCCC26XX_Object aescbcCC26XXObjects[CONFIG_AESCBC_COUNT];
++
++/*
++ * ======== aescbcCC26XXHWAttrs ========
++ */
++const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CONFIG_AESCBC_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const AESCBC_Config AESCBC_config[CONFIG_AESCBC_COUNT] = {
++ { /* CONFIG_AESCBC_0 */
++ .object = &aescbcCC26XXObjects[CONFIG_AESCBC_0],
++ .hwAttrs = &aescbcCC26XXHWAttrs[CONFIG_AESCBC_0]
++ },
++};
++
++const uint_least8_t CONFIG_AESCBC_0_CONST = CONFIG_AESCBC_0;
++const uint_least8_t AESCBC_count = CONFIG_AESCBC_COUNT;
++
++/*
++ * =============================== AESCCM ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESCCM_COUNT 1
++AESCCMCC26XX_Object aesccmCC26XXObjects[CONFIG_AESCCM_COUNT];
++
++/*
++ * ======== aesccmCC26XXHWAttrs ========
++ */
++const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CONFIG_AESCCM_COUNT] = {
++ {
++ .intPriority = 0x40,
++ },
++};
++
++const AESCCM_Config AESCCM_config[CONFIG_AESCCM_COUNT] = {
++ { /* CONFIG_AESCCM_0 */
++ .object = &aesccmCC26XXObjects[CONFIG_AESCCM_0],
++ .hwAttrs = &aesccmCC26XXHWAttrs[CONFIG_AESCCM_0]
++ },
++};
++
++const uint_least8_t CONFIG_AESCCM_0_CONST = CONFIG_AESCCM_0;
++const uint_least8_t AESCCM_count = CONFIG_AESCCM_COUNT;
++
++/*
++ * =============================== AESECB ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESECB_COUNT 1
++AESECBCC26XX_Object aesecbCC26XXObjects[CONFIG_AESECB_COUNT];
++
++/*
++ * ======== aesecbCC26XXHWAttrs ========
++ */
++const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CONFIG_AESECB_COUNT] = {
++ {
++ .intPriority = 0x20,
++ },
++};
++
++const AESECB_Config AESECB_config[CONFIG_AESECB_COUNT] = {
++ { /* CONFIG_AESECB_0 */
++ .object = &aesecbCC26XXObjects[CONFIG_AESECB_0],
++ .hwAttrs = &aesecbCC26XXHWAttrs[CONFIG_AESECB_0]
++ },
++};
++
++
++const uint_least8_t CONFIG_AESECB_0_CONST = CONFIG_AESECB_0;
++const uint_least8_t AESECB_count = CONFIG_AESECB_COUNT;
++
++/*
++ * =============================== DMA ===============================
++ */
++
++#include
++#include
++#include
++
++UDMACC26XX_Object udmaCC26XXObject;
++
++const UDMACC26XX_HWAttrs udmaCC26XXHWAttrs = {
++ .baseAddr = UDMA0_BASE,
++ .powerMngrId = PowerCC26XX_PERIPH_UDMA,
++ .intNum = INT_DMA_ERR,
++ .intPriority = (~0)
++};
++
++const UDMACC26XX_Config UDMACC26XX_config[1] = {
++ {
++ .object = &udmaCC26XXObject,
++ .hwAttrs = &udmaCC26XXHWAttrs,
++ },
++};
++
++/*
++ * =============================== ECDH ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECDH_COUNT 1
++
++ECDHCC26X2_Object ecdhCC26X2Objects[CONFIG_ECDH_COUNT];
++
++/*
++ * ======== ecdhCC26X2HWAttrs ========
++ */
++const ECDHCC26X2_HWAttrs ecdhCC26X2HWAttrs[CONFIG_ECDH_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const ECDH_Config ECDH_config[CONFIG_ECDH_COUNT] = {
++ { /* CONFIG_ECDH_0 */
++ .object = &ecdhCC26X2Objects[CONFIG_ECDH_0],
++ .hwAttrs = &ecdhCC26X2HWAttrs[CONFIG_ECDH_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECDH_0_CONST = CONFIG_ECDH_0;
++const uint_least8_t ECDH_count = CONFIG_ECDH_COUNT;
++
++/*
++ * =============================== ECDSA ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECDSA_COUNT 1
++ECDSACC26X2_Object ecdsaCC26X2Objects[CONFIG_ECDSA_COUNT];
++
++/*
++ * ======== ecdsaCC26X2HWAttrs ========
++ */
++const ECDSACC26X2_HWAttrs ecdsaCC26X2HWAttrs[CONFIG_ECDSA_COUNT] = {
++ {
++ .intPriority = (~0),
++ .trngIntPriority = (~0),
++ },
++};
++
++const ECDSA_Config ECDSA_config[CONFIG_ECDSA_COUNT] = {
++ { /* CONFIG_ECDSA_0 */
++ .object = &ecdsaCC26X2Objects[CONFIG_ECDSA_0],
++ .hwAttrs = &ecdsaCC26X2HWAttrs[CONFIG_ECDSA_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECDSA_0_CONST = CONFIG_ECDSA_0;
++const uint_least8_t ECDSA_count = CONFIG_ECDSA_COUNT;
++
++/*
++ * =============================== ECJPAKE ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECJPAKE_COUNT 1
++ECJPAKECC26X2_Object ecjpakeCC26X2Objects[CONFIG_ECJPAKE_COUNT];
++
++/*
++ * ======== ecjpakeCC26X2HWAttrs ========
++ */
++const ECJPAKECC26X2_HWAttrs ecjpakeCC26X2HWAttrs[CONFIG_ECJPAKE_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const ECJPAKE_Config ECJPAKE_config[CONFIG_ECJPAKE_COUNT] = {
++ { /* CONFIG_ECJPAKE_0 */
++ .object = &ecjpakeCC26X2Objects[CONFIG_ECJPAKE_0],
++ .hwAttrs = &ecjpakeCC26X2HWAttrs[CONFIG_ECJPAKE_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECJPAKE_0_CONST = CONFIG_ECJPAKE_0;
++const uint_least8_t ECJPAKE_count = CONFIG_ECJPAKE_COUNT;
++
++/*
++ * =============================== GPIO ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_GPIO_COUNT 5
++
++/*
++ * ======== gpioPinConfigs ========
++ * Array of Pin configurations
++ */
++GPIO_PinConfig gpioPinConfigs[] = {
++ /* CONFIG_GPIO_BTN1 : LaunchPad Button BTN-1 (Left) */
++ GPIOCC26XX_DIO_15 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
++ /* CONFIG_GPIO_BTN2 : LaunchPad Button BTN-2 (Right) */
++ GPIOCC26XX_DIO_14 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
++ /* CONFIG_GPIO_RLED : LaunchPad LED Red */
++ GPIOCC26XX_DIO_06 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
++ /* CONFIG_GPIO_GLED : LaunchPad LED Green */
++ GPIOCC26XX_DIO_07 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
++ /* SPI Flash Slave Select GPIO Instance */
++ GPIOCC26XX_DIO_20 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH,
++};
++
++/*
++ * ======== gpioCallbackFunctions ========
++ * Array of callback function pointers
++ *
++ * NOTE: Unused callback entries can be omitted from the callbacks array to
++ * reduce memory usage by enabling callback table optimization
++ * (GPIO.optimizeCallbackTableSize = true)
++ */
++GPIO_CallbackFxn gpioCallbackFunctions[] = {
++ /* CONFIG_GPIO_BTN1 : LaunchPad Button BTN-1 (Left) */
++ NULL,
++ /* CONFIG_GPIO_BTN2 : LaunchPad Button BTN-2 (Right) */
++ NULL,
++ /* CONFIG_GPIO_RLED : LaunchPad LED Red */
++ NULL,
++ /* CONFIG_GPIO_GLED : LaunchPad LED Green */
++ NULL,
++ /* SPI Flash Slave Select GPIO Instance */
++ NULL,
++};
++
++const uint_least8_t CONFIG_GPIO_BTN1_CONST = CONFIG_GPIO_BTN1;
++const uint_least8_t CONFIG_GPIO_BTN2_CONST = CONFIG_GPIO_BTN2;
++const uint_least8_t CONFIG_GPIO_RLED_CONST = CONFIG_GPIO_RLED;
++const uint_least8_t CONFIG_GPIO_GLED_CONST = CONFIG_GPIO_GLED;
++const uint_least8_t CONFIG_GPIO_0_CONST = CONFIG_GPIO_0;
++
++/*
++ * ======== GPIOCC26XX_config ========
++ */
++const GPIOCC26XX_Config GPIOCC26XX_config = {
++ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
++ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
++ .numberOfPinConfigs = 5,
++ .numberOfCallbacks = 5,
++ .intPriority = (~0)
++};
++
++/*
++ * =============================== NVS ===============================
++ */
++
++#include
++#include
++
++/*
++ * NVSCC26XX Internal NVS flash region definitions
++ *
++ * Place uninitialized char arrays at addresses
++ * corresponding to the 'regionBase' addresses defined in
++ * the configured NVS regions. These arrays are used as
++ * place holders so that the linker will not place other
++ * content there.
++ *
++ * For GCC targets, the char arrays are each placed into
++ * the shared ".nvs" section. The user must add content to
++ * their GCC linker command file to place the .nvs section
++ * at the lowest 'regionBase' address specified in their NVS
++ * regions.
++ */
++
++#if defined(__TI_COMPILER_VERSION__) || defined(__clang__)
++
++static char flashBuf0[0x6000] __attribute__ ((retain, noinit, location(0x50000)));
++
++#elif defined(__IAR_SYSTEMS_ICC__)
++
++__no_init static char flashBuf0[0x6000] @ 0x50000;
++
++#elif defined(__GNUC__)
++
++__attribute__ ((section (".nvs")))
++static char flashBuf0[0x6000];
++
++#endif
++
++NVSCC26XX_Object nvsCC26XXObjects[1];
++
++static const NVSCC26XX_HWAttrs nvsCC26XXHWAttrs[1] = {
++ /* CONFIG_NVSINTERNAL */
++ {
++ .regionBase = (void *) flashBuf0,
++ .regionSize = 0x6000
++ },
++};
++
++#include
++
++/*
++ * NVSSPI25X External NVS flash region definitions
++ */
++
++/*
++ * Provide write verification buffer whose size is
++ * the largest specified Verification Buffer Size
++ */
++
++static uint8_t verifyBuf[64];
++
++NVSSPI25X_Object nvsSPI25XObjects[1];
++
++static const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
++ /* CONFIG_NVSEXTERNAL */
++ /* MX25R8035F SPI Flash */
++ {
++ .regionBaseOffset = 0x0,
++ .regionSize = 0x256000,
++ .sectorSize = 0x1000,
++ .verifyBuf = verifyBuf,
++ .verifyBufSize = 64,
++ /* NVS opens SPI */
++ .spiHandle = NULL,
++ /* SPI driver index */
++ .spiIndex = CONFIG_SPI_0,
++ .spiBitRate = 4000000,
++ /* GPIO driver pin index */
++ .spiCsnGpioIndex = CONFIG_GPIO_0,
++ .statusPollDelayUs = 100
++ },
++};
++
++#define CONFIG_NVS_COUNT 2
++
++const NVS_Config NVS_config[CONFIG_NVS_COUNT] = {
++ /* CONFIG_NVSINTERNAL */
++ {
++ .fxnTablePtr = &NVSCC26XX_fxnTable,
++ .object = &nvsCC26XXObjects[0],
++ .hwAttrs = &nvsCC26XXHWAttrs[0],
++ },
++ /* CONFIG_NVSEXTERNAL */
++ /* MX25R8035F SPI Flash */
++ {
++ .fxnTablePtr = &NVSSPI25X_fxnTable,
++ .object = &nvsSPI25XObjects[0],
++ .hwAttrs = &nvsSPI25XHWAttrs[0],
++ },
++};
++
++const uint_least8_t CONFIG_NVSINTERNAL_CONST = CONFIG_NVSINTERNAL;
++const uint_least8_t CONFIG_NVSEXTERNAL_CONST = CONFIG_NVSEXTERNAL;
++const uint_least8_t NVS_count = CONFIG_NVS_COUNT;
++
++/*
++ * =============================== PIN ===============================
++ */
++#include
++#include
++
++#define CONFIG_PIN_COUNT 13
++
++const PIN_Config BoardGpioInitTable[CONFIG_PIN_COUNT + 1] = {
++ /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO13) */
++ CONFIG_PIN_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO12) */
++ CONFIG_PIN_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 0, (DIO28) */
++ CONFIG_RF_24GHZ | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 1, (DIO29) */
++ CONFIG_RF_HIGH_PA | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 2, (DIO30) */
++ CONFIG_RF_SUB1GHZ | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO15) */
++ CONFIG_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
++ /* LaunchPad Button BTN-2 (Right), Parent Signal: CONFIG_GPIO_BTN2 GPIO Pin, (DIO14) */
++ CONFIG_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
++ /* LaunchPad LED Red, Parent Signal: CONFIG_GPIO_RLED GPIO Pin, (DIO6) */
++ CONFIG_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad LED Green, Parent Signal: CONFIG_GPIO_GLED GPIO Pin, (DIO7) */
++ CONFIG_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* MX25R8035F SPI Flash Slave Select, Parent Signal: CONFIG_GPIO_0 GPIO Pin, (DIO20) */
++ CONFIG_PIN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 SCLK, (DIO10) */
++ CONFIG_PIN_SPI_SCLK | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MISO, (DIO8) */
++ CONFIG_PIN_SPI_MISO | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MOSI, (DIO9) */
++ CONFIG_PIN_SPI_MOSI | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++
++ PIN_TERMINATE
++};
++
++const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
++ .intPriority = (~0),
++ .swiPriority = 0
++};
++
++/*
++ * =============================== Power ===============================
++ */
++#include
++#include
++#include "ti_drivers_config.h"
++
++extern void PowerCC26XX_standbyPolicy(void);
++extern bool PowerCC26XX_calibrate(unsigned int);
++
++const PowerCC26X2_Config PowerCC26X2_config = {
++ .enablePolicy = true,
++ .policyInitFxn = NULL,
++ .policyFxn = PowerCC26XX_standbyPolicy,
++ .calibrateFxn = PowerCC26XX_calibrate,
++ .calibrateRCOSC_LF = true,
++ .calibrateRCOSC_HF = true,
++ .enableTCXOFxn = NULL
++};
++
++
++/*
++ * =============================== RF Driver ===============================
++ */
++#include
++
++/*
++ * RF driver callback function, called by the driver on global driver events.
++ */
++static void RF_globalCallbackFunction (RF_Handle client, RF_GlobalEvent events, void* arg);
++
++/*
++ * Callback function to handle custom / application specific behavior
++ */
++extern void __attribute__((weak)) rfDriverCallback (RF_Handle client, RF_GlobalEvent events, void *arg);
++
++/*
++ * Callback function to handle antenna switching
++ */
++extern void __attribute__((weak)) rfDriverCallbackAntennaSwitching (RF_Handle client, RF_GlobalEvent events, void *arg);
++
++/*
++ * Platform-specific driver configuration
++ */
++const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
++ .hwiPriority = (~0),
++ .swiPriority = (uint8_t)0,
++ .xoscHfAlwaysNeeded = true,
++ .globalCallback = &RF_globalCallbackFunction,
++ .globalEventMask = RF_GlobalEventInit | RF_GlobalEventRadioPowerDown | RF_GlobalEventRadioSetup
++};
++
++/*
++ * ======== RF_globalCallbackFunction ========
++ * This function is called by the driver on global driver events.
++ * It will call specific callback functions to further handle the triggering events.
++ */
++static void RF_globalCallbackFunction(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ rfDriverCallback(client, events, arg);
++ rfDriverCallbackAntennaSwitching(client, events, arg);
++}
++
++/*
++ * ======== rfDriverCallback ========
++ * Handle events triggered by the RF driver for custom / application specific behavior.
++ */
++void __attribute__((weak)) rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ /* ======== PLEASE READ THIS ========
++ *
++ * This function is declared weak for the application to override it.
++ * A new definition of 'rfDriverCallback' is required if you want to
++ * handle the events listed in '.globalEventMask'.
++ *
++ * Please copy this function definition to create your own, but make
++ * sure to remove '__attribute__((weak))' for your definition.
++ *
++ * According to '.globalEventMask', this function will be triggered by:
++ * - RF_GlobalEventInit
++ * - RF_GlobalEventRadioPowerDown
++ * - RF_GlobalEventRadioSetup
++ *
++ * An example of how to handle these events would be:
++ *
++ * --- Code snippet begin ---
++ *
++ * if(events & RF_GlobalEventInit) {
++ * // Perform action for this event
++ * }
++ * else if (events & RF_GlobalEventRadioPowerDown) {
++ * // Perform action for this event
++ * }
++ * else if (events & RF_GlobalEventRadioSetup) {
++ * // Perform action for this event
++ * }
++ *
++ * --- Code snippet end ---
++ */
++}
++
++
++/*
++ * ======== Antenna switching ========
++ */
++static PIN_Handle antennaPins;
++static PIN_State antennaState;
++
++static void initAntennaSwitch()
++{
++ PIN_Config antennaConfig[] = {
++ CONFIG_RF_24GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ CONFIG_RF_HIGH_PA | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ CONFIG_RF_SUB1GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ PIN_TERMINATE
++ };
++ antennaPins = PIN_open(&antennaState, antennaConfig);
++}
++
++/*
++ * ======== rfDriverCallbackAntennaSwitching ========
++ * Sets up the antenna switch depending on the current PHY configuration.
++ *
++ * Truth table:
++ *
++ * Path DIO28 DIO29 DIO30
++ * =========== ===== ===== =====
++ * Off 0 0 0
++ * Sub-1 GHz 0 0 1
++ * 2.4 GHz 1 0 0
++ * 20 dBm TX 0 1 0
++ */
++void __attribute__((weak)) rfDriverCallbackAntennaSwitching(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ /* Protect against repeated RF_init */
++ static bool initialized = false;
++
++ /* Local variable. */
++ bool sub1GHz = false;
++ uint8_t loDivider = 0;
++
++ if (!initialized && events & RF_GlobalEventInit) {
++ /* Don't do it again */
++ initialized = true;
++ initAntennaSwitch();
++ }
++ else if (events & RF_GlobalEventRadioSetup) {
++ /* Switch off all paths. */
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_HIGH_PA, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 0);
++
++ /* Decode the current PA configuration. */
++ RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType)RF_getTxPower(client).paType;
++
++ /* Decode the generic argument as a setup command. */
++ RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
++
++ switch (setupCommand->common.commandNo) {
++ case (CMD_RADIO_SETUP):
++ case (CMD_BLE5_RADIO_SETUP):
++ loDivider = RF_LODIVIDER_MASK & setupCommand->common.loDivider;
++
++ /* Sub-1GHz front-end. */
++ if (loDivider != 0) {
++ sub1GHz = true;
++ }
++ break;
++ case (CMD_PROP_RADIO_DIV_SETUP):
++ loDivider = RF_LODIVIDER_MASK & setupCommand->prop_div.loDivider;
++
++ /* Sub-1GHz front-end. */
++ if (loDivider != 0) {
++ sub1GHz = true;
++ }
++ break;
++ default:break;
++ }
++
++ if (sub1GHz) {
++ /* Sub-1 GHz */
++ if (paType == RF_TxPowerTable_HighPA) {
++ /* PA enable --> HIGH PA
++ * LNA enable --> Sub-1 GHz
++ */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ /* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
++ de-asserted on CC1352 Rev A. */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
++ } else {
++ /* RF core active --> Sub-1 GHz */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 1);
++ }
++ } else {
++ /* 2.4 GHz */
++ if (paType == RF_TxPowerTable_HighPA)
++ {
++ /* PA enable --> HIGH PA
++ * LNA enable --> 2.4 GHz
++ */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_RFC_GPO0);
++ /* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
++ de-asserted on CC1352 Rev A. */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ } else {
++ /* RF core active --> 2.4 GHz */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 1);
++ }
++ }
++ }
++ else if (events & RF_GlobalEventRadioPowerDown) {
++ /* Switch off all paths. */
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_HIGH_PA, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 0);
++
++ /* Reset the IO multiplexer to GPIO functionality */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ }
++}
++
++/*
++ * =============================== SHA2 ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_SHA2_COUNT 1
++
++SHA2CC26X2_Object sha2CC26X2Objects[CONFIG_SHA2_COUNT];
++
++/*
++ * ======== sha2CC26X2HWAttrs ========
++ */
++const SHA2CC26X2_HWAttrs sha2CC26X2HWAttrs[CONFIG_SHA2_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const SHA2_Config SHA2_config[CONFIG_SHA2_COUNT] = {
++ { /* CONFIG_SHA2_0 */
++ .object = &sha2CC26X2Objects[CONFIG_SHA2_0],
++ .hwAttrs = &sha2CC26X2HWAttrs[CONFIG_SHA2_0]
++ },
++};
++
++const uint_least8_t CONFIG_SHA2_0_CONST = CONFIG_SHA2_0;
++const uint_least8_t SHA2_count = CONFIG_SHA2_COUNT;
++
++/*
++ * =============================== SPI DMA ===============================
++ */
++#include
++#include
++
++#define CONFIG_SPI_COUNT 1
++
++/*
++ * ======== spiCC26X2DMAObjects ========
++ */
++SPICC26X2DMA_Object spiCC26X2DMAObjects[CONFIG_SPI_COUNT];
++
++/*
++ * ======== spiCC26X2DMAHWAttrs ========
++ */
++const SPICC26X2DMA_HWAttrs spiCC26X2DMAHWAttrs[CONFIG_SPI_COUNT] = {
++ /* CONFIG_SPI_0 */
++ /* LaunchPad SPI Bus */
++ {
++ .baseAddr = SSI0_BASE,
++ .intNum = INT_SSI0_COMB,
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .powerMngrId = PowerCC26XX_PERIPH_SSI0,
++ .defaultTxBufValue = ~0,
++ .rxChannelBitMask = 1<
++#include
++
++#define CONFIG_TRNG_COUNT 1
++
++TRNGCC26XX_Object trngCC26XXObjects[CONFIG_TRNG_COUNT];
++
++/*
++ * ======== trngCC26XXHWAttrs ========
++ */
++static const TRNGCC26XX_HWAttrs trngCC26XXHWAttrs[CONFIG_TRNG_COUNT] = {
++ {
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .samplesPerCycle = 240000
++ },
++};
++
++const TRNG_Config TRNG_config[CONFIG_TRNG_COUNT] = {
++ { /* CONFIG_TRNG_0 */
++ .object = &trngCC26XXObjects[CONFIG_TRNG_0],
++ .hwAttrs = &trngCC26XXHWAttrs[CONFIG_TRNG_0]
++ },
++};
++
++const uint_least8_t CONFIG_TRNG_0_CONST = CONFIG_TRNG_0;
++const uint_least8_t TRNG_count = CONFIG_TRNG_COUNT;
++
++/*
++ * =============================== Temperature ===============================
++ */
++#include
++#include
++
++const TemperatureCC26X2_Config TemperatureCC26X2_config = {
++ .intPriority = (~0),
++};
++
++/*
++ * =============================== UART ===============================
++ */
++
++#include
++#include
++#include
++#include
++#include
++#include
++
++#define CONFIG_UART_COUNT 1
++
++UARTCC26XX_Object uartCC26XXObjects[CONFIG_UART_COUNT];
++
++static unsigned char uartCC26XXRingBuffer0[32];
++
++static const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CONFIG_UART_COUNT] = {
++ {
++ .baseAddr = UART0_BASE,
++ .intNum = INT_UART0_COMB,
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .powerMngrId = PowerCC26XX_PERIPH_UART0,
++ .ringBufPtr = uartCC26XXRingBuffer0,
++ .ringBufSize = sizeof(uartCC26XXRingBuffer0),
++ .rxPin = IOID_12,
++ .txPin = IOID_13,
++ .ctsPin = PIN_UNASSIGNED,
++ .rtsPin = PIN_UNASSIGNED,
++ .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
++ .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
++ .errorFxn = NULL
++ },
++};
++
++const UART_Config UART_config[CONFIG_UART_COUNT] = {
++ { /* CONFIG_DISPLAY_UART */
++ .fxnTablePtr = &UARTCC26XX_fxnTable,
++ .object = &uartCC26XXObjects[CONFIG_DISPLAY_UART],
++ .hwAttrs = &uartCC26XXHWAttrs[CONFIG_DISPLAY_UART]
++ },
++};
++
++const uint_least8_t CONFIG_DISPLAY_UART_CONST = CONFIG_DISPLAY_UART;
++const uint_least8_t UART_count = CONFIG_UART_COUNT;
++
++/*
++ * =============================== Button ===============================
++ */
++#include
++
++#define CONFIG_BUTTON_COUNT 2
++Button_Object ButtonObjects[CONFIG_BUTTON_COUNT];
++
++static const Button_HWAttrs ButtonHWAttrs[CONFIG_BUTTON_COUNT] = {
++ /* CONFIG_BTN_LEFT */
++ /* LaunchPad Button BTN-1 (Left) */
++ {
++ .gpioIndex = CONFIG_GPIO_BTN1
++ },
++ /* CONFIG_BTN_RIGHT */
++ /* LaunchPad Button BTN-2 (Right) */
++ {
++ .gpioIndex = CONFIG_GPIO_BTN2
++ },
++};
++
++const Button_Config Button_config[CONFIG_BUTTON_COUNT] = {
++ /* CONFIG_BTN_LEFT */
++ /* LaunchPad Button BTN-1 (Left) */
++ {
++ .object = &ButtonObjects[CONFIG_BTN_LEFT],
++ .hwAttrs = &ButtonHWAttrs[CONFIG_BTN_LEFT]
++ },
++ /* CONFIG_BTN_RIGHT */
++ /* LaunchPad Button BTN-2 (Right) */
++ {
++ .object = &ButtonObjects[CONFIG_BTN_RIGHT],
++ .hwAttrs = &ButtonHWAttrs[CONFIG_BTN_RIGHT]
++ },
++};
++
++const uint_least8_t CONFIG_BTN_LEFT_CONST = CONFIG_BTN_LEFT;
++const uint_least8_t CONFIG_BTN_RIGHT_CONST = CONFIG_BTN_RIGHT;
++const uint_least8_t Button_count = CONFIG_BUTTON_COUNT;
++
++/*
++ * =============================== LED ===============================
++ */
++#include
++
++#define CONFIG_LED_COUNT 2
++LED_Object LEDObjects[CONFIG_LED_COUNT];
++
++static const LED_HWAttrs LEDHWAttrs[CONFIG_LED_COUNT] = {
++ /* CONFIG_LED_RED */
++ /* LaunchPad LED Red */
++ {
++ .type = LED_GPIO_CONTROLLED,
++ .index = CONFIG_GPIO_RLED,
++ },
++ /* CONFIG_LED_GREEN */
++ /* LaunchPad LED Green */
++ {
++ .type = LED_GPIO_CONTROLLED,
++ .index = CONFIG_GPIO_GLED,
++ },
++};
++
++const LED_Config LED_config[CONFIG_LED_COUNT] = {
++ /* CONFIG_LED_RED */
++ /* LaunchPad LED Red */
++ {
++ .object = &LEDObjects[CONFIG_LED_RED],
++ .hwAttrs = &LEDHWAttrs[CONFIG_LED_RED]
++ },
++ /* CONFIG_LED_GREEN */
++ /* LaunchPad LED Green */
++ {
++ .object = &LEDObjects[CONFIG_LED_GREEN],
++ .hwAttrs = &LEDHWAttrs[CONFIG_LED_GREEN]
++ },
++};
++
++const uint_least8_t CONFIG_LED_RED_CONST = CONFIG_LED_RED;
++const uint_least8_t CONFIG_LED_GREEN_CONST = CONFIG_LED_GREEN;
++const uint_least8_t LED_count = CONFIG_LED_COUNT;
++
++#include
++
++#include
++#include
++
++#include
++
++/*
++ * ======== Board_sendExtFlashByte ========
++ */
++void Board_sendExtFlashByte(PIN_Handle pinHandle, uint8_t byte)
++{
++ uint8_t i;
++
++ /* SPI Flash CS */
++ PIN_setOutputValue(pinHandle, IOID_20, 0);
++
++ for (i = 0; i < 8; i++) {
++ PIN_setOutputValue(pinHandle, IOID_10, 0); /* SPI Flash CLK */
++
++ /* SPI Flash MOSI */
++ PIN_setOutputValue(pinHandle, IOID_9, (byte >> (7 - i)) & 0x01);
++ PIN_setOutputValue(pinHandle, IOID_10, 1); /* SPI Flash CLK */
++
++ /*
++ * Waste a few cycles to keep the CLK high for at
++ * least 45% of the period.
++ * 3 cycles per loop: 8 loops @ 48 Mhz = 0.5 us.
++ */
++ CPUdelay(8);
++ }
++
++ PIN_setOutputValue(pinHandle, IOID_10, 0); /* CLK */
++ PIN_setOutputValue(pinHandle, IOID_20, 1); /* CS */
++
++ /*
++ * Keep CS high at least 40 us
++ * 3 cycles per loop: 700 loops @ 48 Mhz ~= 44 us
++ */
++ CPUdelay(700);
++}
++
++/*
++ * ======== Board_wakeUpExtFlash ========
++ */
++void Board_wakeUpExtFlash(void)
++{
++ PIN_Config extFlashPinTable[] = {
++ /* SPI Flash CS */
++ IOID_20 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ PIN_TERMINATE
++ };
++ PIN_State extFlashPinState;
++ PIN_Handle extFlashPinHandle = PIN_open(&extFlashPinState, extFlashPinTable);
++
++ /*
++ * To wake up we need to toggle the chip select at
++ * least 20 ns and ten wait at least 35 us.
++ */
++
++ /* Toggle chip select for ~20ns to wake ext. flash */
++ PIN_setOutputValue(extFlashPinHandle, IOID_20, 0);
++ /* 3 cycles per loop: 1 loop @ 48 Mhz ~= 62 ns */
++ CPUdelay(1);
++ PIN_setOutputValue(extFlashPinHandle, IOID_20, 1);
++ /* 3 cycles per loop: 560 loops @ 48 Mhz ~= 35 us */
++ CPUdelay(560);
++
++ PIN_close(extFlashPinHandle);
++}
++
++/*
++ * ======== Board_shutDownExtFlash ========
++ */
++void Board_shutDownExtFlash(void)
++{
++ /*
++ * To be sure we are putting the flash into sleep and not waking it,
++ * we first have to make a wake up call
++ */
++ Board_wakeUpExtFlash();
++
++ PIN_Config extFlashPinTable[] = {
++ /* SPI Flash CS*/
++ IOID_20 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash CLK */
++ IOID_10 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash MOSI */
++ IOID_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash MISO */
++ IOID_8 | PIN_INPUT_EN | PIN_PULLDOWN,
++ PIN_TERMINATE
++ };
++ PIN_State extFlashPinState;
++ PIN_Handle extFlashPinHandle = PIN_open(&extFlashPinState, extFlashPinTable);
++
++ uint8_t extFlashShutdown = 0xB9;
++
++ Board_sendExtFlashByte(extFlashPinHandle, extFlashShutdown);
++
++ PIN_close(extFlashPinHandle);
++}
++
++
++#include
++
++/*
++ * ======== Board_initHook ========
++ * Perform any board-specific initialization needed at startup. This
++ * function is declared weak to allow applications to override it if needed.
++ */
++void __attribute__((weak)) Board_initHook(void)
++{
++}
++
++/*
++ * ======== Board_init ========
++ * Perform any initialization needed before using any board APIs
++ */
++void Board_init(void)
++{
++ /* ==== /ti/drivers/Power initialization ==== */
++ Power_init();
++
++ /* ==== /ti/devices/CCFGTemplate initialization ==== */
++
++ /* ==== /ti/drivers/PIN initialization ==== */
++ if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
++ /* Error with PIN_init */
++ while (1);
++ }
++ /* ==== /ti/drivers/RF initialization ==== */
++
++
++ Board_shutDownExtFlash();
++
++ Board_initHook();
++}
++
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+new file mode 100644
+index 0000000..abf128f
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+@@ -0,0 +1,283 @@
++/*
++ * ======== ti_drivers_config.h ========
++ * Configured TI-Drivers module declarations
++ *
++ * The macros defines herein are intended for use by applications which
++ * directly include this header. These macros should NOT be hard coded or
++ * copied into library source code.
++ *
++ * Symbols declared as const are intended for use with libraries.
++ * Library source code must extern the correct symbol--which is resolved
++ * when the application is linked.
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P_2_LAUNCHXL
++ * by the SysConfig tool.
++ */
++#ifndef ti_drivers_config_h
++#define ti_drivers_config_h
++
++#define CONFIG_SYSCONFIG_PREVIEW
++
++#define CONFIG_CC1352P_2_LAUNCHXL
++#ifndef DeviceFamily_CC13X2
++#define DeviceFamily_CC13X2
++#endif
++
++#include
++
++#include
++
++/* support C++ sources */
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/*
++ * ======== CCFG ========
++ */
++
++
++/*
++ * ======== AESCBC ========
++ */
++
++extern const uint_least8_t CONFIG_AESCBC_0_CONST;
++#define CONFIG_AESCBC_0 0
++#define CONFIG_TI_DRIVERS_AESCBC_COUNT 1
++
++
++/*
++ * ======== AESCCM ========
++ */
++
++extern const uint_least8_t CONFIG_AESCCM_0_CONST;
++#define CONFIG_AESCCM_0 0
++#define CONFIG_TI_DRIVERS_AESCCM_COUNT 1
++
++
++/*
++ * ======== AESECB ========
++ */
++
++extern const uint_least8_t CONFIG_AESECB_0_CONST;
++#define CONFIG_AESECB_0 0
++#define CONFIG_TI_DRIVERS_AESECB_COUNT 1
++
++
++/*
++ * ======== ECDH ========
++ */
++
++extern const uint_least8_t CONFIG_ECDH_0_CONST;
++#define CONFIG_ECDH_0 0
++#define CONFIG_TI_DRIVERS_ECDH_COUNT 1
++
++
++/*
++ * ======== ECDSA ========
++ */
++
++extern const uint_least8_t CONFIG_ECDSA_0_CONST;
++#define CONFIG_ECDSA_0 0
++#define CONFIG_TI_DRIVERS_ECDSA_COUNT 1
++
++
++/*
++ * ======== ECJPAKE ========
++ */
++
++extern const uint_least8_t CONFIG_ECJPAKE_0_CONST;
++#define CONFIG_ECJPAKE_0 0
++#define CONFIG_TI_DRIVERS_ECJPAKE_COUNT 1
++
++
++/*
++ * ======== GPIO ========
++ */
++
++/* DIO15, LaunchPad Button BTN-1 (Left) */
++extern const uint_least8_t CONFIG_GPIO_BTN1_CONST;
++#define CONFIG_GPIO_BTN1 0
++/* DIO14, LaunchPad Button BTN-2 (Right) */
++extern const uint_least8_t CONFIG_GPIO_BTN2_CONST;
++#define CONFIG_GPIO_BTN2 1
++/* DIO6, LaunchPad LED Red */
++extern const uint_least8_t CONFIG_GPIO_RLED_CONST;
++#define CONFIG_GPIO_RLED 2
++/* DIO7, LaunchPad LED Green */
++extern const uint_least8_t CONFIG_GPIO_GLED_CONST;
++#define CONFIG_GPIO_GLED 3
++/* DIO20, MX25R8035F SPI Flash Slave Select */
++extern const uint_least8_t CONFIG_GPIO_0_CONST;
++#define CONFIG_GPIO_0 4
++#define CONFIG_TI_DRIVERS_GPIO_COUNT 5
++
++/* LEDs are active high */
++#define CONFIG_GPIO_LED_ON (1)
++#define CONFIG_GPIO_LED_OFF (0)
++
++#define CONFIG_LED_ON (CONFIG_GPIO_LED_ON)
++#define CONFIG_LED_OFF (CONFIG_GPIO_LED_OFF)
++
++
++/*
++ * ======== NVS ========
++ */
++
++extern const uint_least8_t CONFIG_NVSINTERNAL_CONST;
++#define CONFIG_NVSINTERNAL 0
++/*
++ * MOSI: DIO9
++ * MISO: DIO8
++ * SCLK: DIO10
++ * LaunchPad SPI Bus
++ * SS: DIO20, MX25R8035F SPI Flash Slave Select
++ */
++extern const uint_least8_t CONFIG_NVSEXTERNAL_CONST;
++#define CONFIG_NVSEXTERNAL 1
++#define CONFIG_TI_DRIVERS_NVS_COUNT 2
++
++
++/*
++ * ======== PIN ========
++ */
++#include
++
++extern const PIN_Config BoardGpioInitTable[];
++
++/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO13) */
++#define CONFIG_PIN_UART_TX 0x0000000d
++/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO12) */
++#define CONFIG_PIN_UART_RX 0x0000000c
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 0, (DIO28) */
++// #define CONFIG_RF_24GHZ 0x0000001c
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 1, (DIO29) */
++// #define CONFIG_RF_HIGH_PA 0x0000001d
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 2, (DIO30) */
++#define CONFIG_RF_SUB1GHZ 0x0000001e
++/* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO15) */
++#define CONFIG_PIN_BTN1 0x0000000f
++/* LaunchPad Button BTN-2 (Right), Parent Signal: CONFIG_GPIO_BTN2 GPIO Pin, (DIO14) */
++#define CONFIG_PIN_BTN2 0x0000000e
++/* LaunchPad LED Red, Parent Signal: CONFIG_GPIO_RLED GPIO Pin, (DIO6) */
++#define CONFIG_PIN_RLED 0x00000006
++/* LaunchPad LED Green, Parent Signal: CONFIG_GPIO_GLED GPIO Pin, (DIO7) */
++#define CONFIG_PIN_GLED 0x00000007
++/* MX25R8035F SPI Flash Slave Select, Parent Signal: CONFIG_GPIO_0 GPIO Pin, (DIO20) */
++#define CONFIG_PIN_0 0x00000014
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 SCLK, (DIO10) */
++#define CONFIG_PIN_SPI_SCLK 0x0000000a
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MISO, (DIO8) */
++#define CONFIG_PIN_SPI_MISO 0x00000008
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MOSI, (DIO9) */
++#define CONFIG_PIN_SPI_MOSI 0x00000009
++#define CONFIG_TI_DRIVERS_PIN_COUNT 13
++
++
++/*
++ * ======== RF ========
++ */
++#define Board_DIO_30_RFSW 0x0000001e
++
++
++/*
++ * ======== SHA2 ========
++ */
++
++extern const uint_least8_t CONFIG_SHA2_0_CONST;
++#define CONFIG_SHA2_0 0
++#define CONFIG_TI_DRIVERS_SHA2_COUNT 1
++
++
++/*
++ * ======== SPI ========
++ */
++
++/*
++ * MOSI: DIO9
++ * MISO: DIO8
++ * SCLK: DIO10
++ * LaunchPad SPI Bus
++ */
++extern const uint_least8_t CONFIG_SPI_0_CONST;
++#define CONFIG_SPI_0 0
++#define CONFIG_TI_DRIVERS_SPI_COUNT 1
++
++
++/*
++ * ======== TRNG ========
++ */
++
++extern const uint_least8_t CONFIG_TRNG_0_CONST;
++#define CONFIG_TRNG_0 0
++#define CONFIG_TI_DRIVERS_TRNG_COUNT 1
++
++
++/*
++ * ======== UART ========
++ */
++
++/*
++ * TX: DIO13
++ * RX: DIO12
++ * XDS110 UART
++ */
++extern const uint_least8_t CONFIG_DISPLAY_UART_CONST;
++#define CONFIG_DISPLAY_UART 0
++#define CONFIG_TI_DRIVERS_UART_COUNT 1
++
++
++/*
++ * ======== Button ========
++ */
++
++/* DIO15, LaunchPad Button BTN-1 (Left) */
++extern const uint_least8_t CONFIG_BTN_LEFT_CONST;
++#define CONFIG_BTN_LEFT 0
++/* DIO14, LaunchPad Button BTN-2 (Right) */
++extern const uint_least8_t CONFIG_BTN_RIGHT_CONST;
++#define CONFIG_BTN_RIGHT 1
++#define CONFIG_TI_DRIVERS_BUTTON_COUNT 2
++
++
++/*
++ * ======== LED ========
++ */
++
++/* DIO6, LaunchPad LED Red */
++extern const uint_least8_t CONFIG_LED_RED_CONST;
++#define CONFIG_LED_RED 0
++/* DIO7, LaunchPad LED Green */
++extern const uint_least8_t CONFIG_LED_GREEN_CONST;
++#define CONFIG_LED_GREEN 1
++#define CONFIG_TI_DRIVERS_LED_COUNT 2
++
++
++/*
++ * ======== Board_init ========
++ * Perform all required TI-Drivers initialization
++ *
++ * This function should be called once at a point before any use of
++ * TI-Drivers.
++ */
++extern void Board_init(void);
++
++/*
++ * ======== Board_initGeneral ========
++ * (deprecated)
++ *
++ * Board_initGeneral() is defined purely for backward compatibility.
++ *
++ * All new code should use Board_init() to do any required TI-Drivers
++ * initialization _and_ use _init() for only where specific drivers
++ * are explicitly referenced by the application. _init() functions
++ * are idempotent.
++ */
++#define Board_initGeneral Board_init
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* include guard */
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+new file mode 100644
+index 0000000..ac1e16f
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+@@ -0,0 +1,340 @@
++/*
++ * ======== ti_radio_config.c ========
++ * Configured RadioConfig module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ
++ * by the SysConfig tool.
++ *
++ * Radio Config module version : 1.8
++ * SmartRF Studio data version : 2.20.0
++ */
++
++#include
++#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
++#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
++#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
++#include
++#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
++#include "ti_radio_config.h"
++
++
++// *********************************************************************************
++// RF Frontend configuration
++// *********************************************************************************
++// RF design based on: LAUNCHXL-CC1352P-2 (CC1352PEM-XD4251-XD24-PA24_10dBm)
++
++// TX Power tables
++// The RF_TxPowerTable_DEFAULT_PA_ENTRY and RF_TxPowerTable_HIGH_PA_ENTRY macros are defined in RF.h.
++// The following arguments are required:
++// RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost, coefficient)
++// RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
++// See the Technical Reference Manual for further details about the "txPower" Command field.
++// The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
++
++// 868 MHz, 13 dBm
++RF_TxPowerTable_Entry txPowerTable_868_pa13[TXPOWERTABLE_868_PA13_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 3) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 5) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 8) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 9) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 10) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 11) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 14) },
++ {6, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 3, 0, 16) },
++ {7, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 19) },
++ {8, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 3, 0, 22) },
++ {9, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 3, 0, 31) },
++ {10, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 2, 0, 31) },
++ {11, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 2, 0, 51) },
++ {12, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 0, 0, 82) },
++ // The original PA value (12.5 dBm) has been rounded to an integer value.
++ {13, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 0, 89) },
++ // This setting requires CCFG_FORCE_VDDR_HH = 1.
++ {14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++
++// 2400 MHz, 5 dBm
++RF_TxPowerTable_Entry txPowerTable_2400_pa5[TXPOWERTABLE_2400_PA5_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) },
++ {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) },
++ {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) },
++ {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) },
++ {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) },
++ {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++// 2400 MHz, 5 + 20 dBm
++RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[TXPOWERTABLE_2400_PA5_20_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) },
++ {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) },
++ {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) },
++ {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) },
++ {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) },
++ {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) },
++ {14, RF_TxPowerTable_HIGH_PA_ENTRY(22, 3, 1, 19, 27) },
++ {15, RF_TxPowerTable_HIGH_PA_ENTRY(26, 3, 1, 23, 27) },
++ {16, RF_TxPowerTable_HIGH_PA_ENTRY(30, 3, 1, 28, 27) },
++ {17, RF_TxPowerTable_HIGH_PA_ENTRY(37, 3, 1, 39, 27) },
++ {18, RF_TxPowerTable_HIGH_PA_ENTRY(32, 3, 1, 35, 48) },
++ {19, RF_TxPowerTable_HIGH_PA_ENTRY(34, 3, 1, 48, 63) },
++ {20, RF_TxPowerTable_HIGH_PA_ENTRY(53, 3, 1, 58, 63) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++
++
++//*********************************************************************************
++// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8
++//
++// PHY: ieee154
++// Setting file: setting_ieee_802_15_4.json
++//*********************************************************************************
++
++// PARAMETER SUMMARY
++// Channel - Frequency (MHz): 2405
++// TX Power (dBm): 5
++
++// TI-RTOS RF Mode Object
++RF_Mode RF_prop_ieee154 =
++{
++ .rfMode = RF_MODE_AUTO,
++ .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
++ .mcePatchFxn = 0,
++ .rfePatchFxn = 0
++};
++
++// Overrides for CMD_RADIO_SETUP_PA
++uint32_t pOverrides_ieee154[] =
++{
++ // override_ieee_802_15_4.json
++ // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
++ (uint32_t)0x000F8883,
++ // Tx: Set DCDC settings IPEAK=3, dither = off
++ (uint32_t)0x00F388D3,
++ (uint32_t)0xFFFFFFFF
++};
++
++
++
++// CMD_RADIO_SETUP_PA
++// Radio Setup Command for Pre-Defined Schemes
++const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154 =
++{
++ .commandNo = 0x0802,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .mode = 0x01,
++ .loDivider = 0x00,
++ .config.frontEndMode = 0x0,
++ .config.biasMode = 0x1,
++ .config.analogCfgMode = 0x0,
++ .config.bNoFsPowerUp = 0x0,
++ .txPower = 0x7217,
++ .pRegOverride = pOverrides_ieee154,
++ .pRegOverrideTxStd = 0,
++ .pRegOverrideTx20 = 0
++};
++
++// CMD_FS
++// Frequency Synthesizer Programming Command
++const rfc_CMD_FS_t RF_cmdFs_ieee154 =
++{
++ .commandNo = 0x0803,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .frequency = 0x0965,
++ .fractFreq = 0x0000,
++ .synthConf.bTxMode = 0x0,
++ .synthConf.refFreq = 0x0,
++ .__dummy0 = 0x00,
++ .__dummy1 = 0x00,
++ .__dummy2 = 0x00,
++ .__dummy3 = 0x0000
++};
++
++// CMD_IEEE_TX
++// IEEE 802.15.4 Transmit Command
++const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154 =
++{
++ .commandNo = 0x2C01,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .txOpt.bIncludePhyHdr = 0x0,
++ .txOpt.bIncludeCrc = 0x0,
++ .txOpt.payloadLenMsb = 0x0,
++ .payloadLen = 0x1E,
++ .pPayload = 0,
++ .timeStamp = 0x00000000
++};
++
++// CMD_IEEE_RX
++// IEEE 802.15.4 Receive Command
++const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154 =
++{
++ .commandNo = 0x2801,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .channel = 0x00,
++ .rxConfig.bAutoFlushCrc = 0x0,
++ .rxConfig.bAutoFlushIgn = 0x0,
++ .rxConfig.bIncludePhyHdr = 0x0,
++ .rxConfig.bIncludeCrc = 0x0,
++ .rxConfig.bAppendRssi = 0x1,
++ .rxConfig.bAppendCorrCrc = 0x1,
++ .rxConfig.bAppendSrcInd = 0x0,
++ .rxConfig.bAppendTimestamp = 0x0,
++ .pRxQ = 0,
++ .pOutput = 0,
++ .frameFiltOpt.frameFiltEn = 0x0,
++ .frameFiltOpt.frameFiltStop = 0x0,
++ .frameFiltOpt.autoAckEn = 0x0,
++ .frameFiltOpt.slottedAckEn = 0x0,
++ .frameFiltOpt.autoPendEn = 0x0,
++ .frameFiltOpt.defaultPend = 0x0,
++ .frameFiltOpt.bPendDataReqOnly = 0x0,
++ .frameFiltOpt.bPanCoord = 0x0,
++ .frameFiltOpt.maxFrameVersion = 0x3,
++ .frameFiltOpt.fcfReservedMask = 0x0,
++ .frameFiltOpt.modifyFtFilter = 0x0,
++ .frameFiltOpt.bStrictLenFilter = 0x0,
++ .frameTypes.bAcceptFt0Beacon = 0x1,
++ .frameTypes.bAcceptFt1Data = 0x1,
++ .frameTypes.bAcceptFt2Ack = 0x1,
++ .frameTypes.bAcceptFt3MacCmd = 0x1,
++ .frameTypes.bAcceptFt4Reserved = 0x1,
++ .frameTypes.bAcceptFt5Reserved = 0x1,
++ .frameTypes.bAcceptFt6Reserved = 0x1,
++ .frameTypes.bAcceptFt7Reserved = 0x1,
++ .ccaOpt.ccaEnEnergy = 0x0,
++ .ccaOpt.ccaEnCorr = 0x0,
++ .ccaOpt.ccaEnSync = 0x0,
++ .ccaOpt.ccaCorrOp = 0x1,
++ .ccaOpt.ccaSyncOp = 0x1,
++ .ccaOpt.ccaCorrThr = 0x0,
++ .ccaRssiThr = 0x64,
++ .__dummy0 = 0x00,
++ .numExtEntries = 0x00,
++ .numShortEntries = 0x00,
++ .pExtEntryList = 0,
++ .pShortEntryList = 0,
++ .localExtAddr = 0x12345678,
++ .localShortAddr = 0xABBA,
++ .localPanID = 0x0000,
++ .__dummy1 = 0x000000,
++ .endTrigger.triggerType = 0x1,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .endTime = 0x00000000
++};
++
++// CMD_IEEE_CSMA
++// IEEE 802.15.4 CSMA-CA Command
++const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154 =
++{
++ .commandNo = 0x2C02,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x0,
++ .condition.nSkip = 0x0,
++ .randomState = 0x0000,
++ .macMaxBE = 0x00,
++ .macMaxCSMABackoffs = 0x00,
++ .csmaConfig.initCW = 0x0,
++ .csmaConfig.bSlotted = 0x0,
++ .csmaConfig.rxOffMode = 0x0,
++ .NB = 0x00,
++ .BE = 0x00,
++ .remainingPeriods = 0x00,
++ .lastRssi = 0x00,
++ .endTrigger.triggerType = 0x0,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .lastTimeStamp = 0x00000000,
++ .endTime = 0x00000000
++};
++
++// CMD_IEEE_RX_ACK
++// IEEE 802.15.4 Receive Acknowledgement Command
++const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154 =
++{
++ .commandNo = 0x2C03,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x0,
++ .condition.nSkip = 0x0,
++ .seqNo = 0x00,
++ .endTrigger.triggerType = 0x0,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .endTime = 0x00000000
++};
++
++
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+new file mode 100644
+index 0000000..1e63c91
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+@@ -0,0 +1,77 @@
++/*
++ * ======== ti_radio_config.h ========
++ * Configured RadioConfig module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ
++ * by the SysConfig tool.
++ *
++ * Radio Config module version : 1.8
++ * SmartRF Studio data version : 2.20.0
++ */
++#ifndef _TI_RADIO_CONFIG_H_
++#define _TI_RADIO_CONFIG_H_
++
++#include
++#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
++#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
++#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
++#include
++
++// *********************************************************************************
++// RF Frontend configuration
++// *********************************************************************************
++// RF design based on: LAUNCHXL-CC1352P-2 (CC1352PEM-XD4251-XD24-PA24_10dBm)
++#define LAUNCHXL_CC1352P_2
++
++// High-Power Amplifier supported
++#define SUPPORT_HIGH_PA
++
++// RF frontend configuration
++#define FRONTEND_SUB1G_DIFF_RF
++#define FRONTEND_SUB1G_EXT_BIAS
++#define FRONTEND_24G_DIFF_RF
++#define FRONTEND_24G_EXT_BIAS
++
++// Supported frequency bands
++#define SUPPORT_FREQBAND_868
++#define SUPPORT_FREQBAND_2400
++
++// TX power table size definitions
++#define TXPOWERTABLE_868_PA13_SIZE 20 // 868 MHz, 13 dBm
++#define TXPOWERTABLE_2400_PA5_SIZE 16 // 2400 MHz, 5 dBm
++#define TXPOWERTABLE_2400_PA5_20_SIZE 23 // 2400 MHz, 5 + 20 dBm
++
++// TX power tables
++extern RF_TxPowerTable_Entry txPowerTable_868_pa13[]; // 868 MHz, 13 dBm
++extern RF_TxPowerTable_Entry txPowerTable_2400_pa5[]; // 2400 MHz, 5 dBm
++extern RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[]; // 2400 MHz, 5 + 20 dBm
++
++
++
++//*********************************************************************************
++// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8
++//
++// PHY: ieee154
++// Setting file: setting_ieee_802_15_4.json
++//*********************************************************************************
++
++// PA table usage
++#define TX_POWER_TABLE_SIZE_ieee154 TXPOWERTABLE_2400_PA5_SIZE
++
++#define txPowerTable_ieee154 txPowerTable_2400_pa5
++
++// TI-RTOS RF Mode object
++extern RF_Mode RF_prop_ieee154;
++
++// RF Core API commands
++extern const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154;
++extern const rfc_CMD_FS_t RF_cmdFs_ieee154;
++extern const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154;
++extern const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154;
++extern const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154;
++extern const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154;
++
++// RF Core API overrides
++extern uint32_t pOverrides_ieee154[];
++
++#endif // _TI_RADIO_CONFIG_H_
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+new file mode 100644
+index 0000000..fa697e6
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+@@ -0,0 +1,35 @@
++/*
++ * ======== ti_utils_build_linker.cmd.genlibs ========
++ * Libraries needed to link this application's configuration
++ *
++ * NOTE, this feature requires software components configured in your
++ * system to correctly indicate their dependencies and report the
++ * libraries needed for your specific configuration. If you find
++ * errors, please report them on TI's E2E forums
++ * (https://e2e.ti.com/) so they can be addressed in a future
++ * release.
++ *
++ * This file allows one to portably link applications that use SysConfig
++ * _without_ having to make changes to build rules when moving to a new
++ * device OR when upgrading to a new version of a SysConfig enabled
++ * product.
++ *
++ * DO NOT EDIT - This file is generated by the SysConfig tool for the
++ * TI C/C++ toolchain
++ */
++
++/* libraries required for /third_party/spiffs */
++-l"third_party/spiffs/lib/ccs/m4f/spiffs.a"
++
++/* libraries required for /ti/drivers/RF */
++-l"ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f"
++
++/* libraries required for /ti/drivers */
++-l"ti/drivers/lib/ccs/m4f/drivers_cc13x2.a"
++-l"ti/grlib/lib/ccs/m4f/grlib.a"
++-l"ti/dpl/lib/ccs/m4f/dpl_cc13x2.a"
++
++/* libraries required for /ti/zstack */
++-l"ti/ti154stack/library/tirtos/ccs/bin/maclib_nosecure_cc13x2_2_4g.a"
++-l"ti/zstack/lib/ccs/libZStack_nwk_all_ccs.a"
++
+diff --git a/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
+new file mode 100644
+index 0000000..69447c1
+--- /dev/null
++++ b/znp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
+@@ -0,0 +1,226 @@
++/*
++ * Copyright (c) 2018, Texas Instruments Incorporated
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * * Neither the name of Texas Instruments Incorporated nor the names of
++ * its contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
++ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * 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.
++ *
++ */
++
++/*
++ * ti_zstack_config.h
++ *
++ * DO NOT EDIT - This file was generated by the SysConfig tool.
++ *
++ * Macros used to define a TI Z-Stack ZigBee device. New user defined
++ * options may be added to this file, as necessary.
++ *
++ */
++
++#ifndef TI_ZSTACK_CONFIG_H
++#define TI_ZSTACK_CONFIG_H
++
++/* Default (primary) and secondary channel masks. Secondary mask is used when the
++ * default channels fail.
++ * Channels are defined in the following:
++ * 11 - 26 : 2.4 GHz 0x07FFF800
++ */
++#ifndef DEFAULT_CHANLIST
++#define DEFAULT_CHANLIST 0x00000800
++#endif
++
++#ifndef SECONDARY_CHANLIST
++#define SECONDARY_CHANLIST 0x00000000
++#endif
++
++/* Define the default PAN ID.
++ *
++ * Setting this to a value other than 0xFFFF causes
++ * ZDO_COORD to use this value as its PAN ID and
++ * Routers and end devices to join PAN with this ID
++ */
++#ifndef ZDAPP_CONFIG_PAN_ID
++#define ZDAPP_CONFIG_PAN_ID 0xFFFF
++#endif
++
++/* Specifiy whether to set the EPID to the Extended Address, or to use the
++ * custom Extended Pan ID (EPID) defined by ZDAPP_CONFIG_EPID
++ */
++#ifndef SET_EPID_AS_EXT_ADDR
++#define SET_EPID_AS_EXT_ADDR TRUE
++#endif
++
++/* Define the default Extended Pan ID (EPID)
++ * ZDAPP_CONFIG_EPID is only used if SET_EPID_AS_EXT_ADDR is FALSE. Otherwise,
++ * the EPID is set to the Extended Address.
++ */
++#ifndef ZDAPP_CONFIG_EPID
++#define ZDAPP_CONFIG_EPID {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF}
++#endif
++
++/* in seconds; set to 255 to turn off route expiry */
++#ifndef ROUTE_EXPIRY_TIME
++#define ROUTE_EXPIRY_TIME 30
++#endif
++
++/* Default indirect message holding timeout value:
++ * 1-65535 (0 -> 65536) X CNT_RTG_TIMER X RTG_TIMER_INTERVAL
++ */
++#ifndef NWK_INDIRECT_MSG_TIMEOUT
++#define NWK_INDIRECT_MSG_TIMEOUT 7
++#endif
++
++/* The number of simultaneous route discoveries in network */
++#ifndef MAX_RREQ_ENTRIES
++#define MAX_RREQ_ENTRIES 8
++#endif
++
++/* The maximum number of MAC frame transmission attempts allowed */
++#ifndef ZMAC_MAX_FRAME_RETRIES
++#define ZMAC_MAX_FRAME_RETRIES 3
++#endif
++
++/* Max number of times attempts looking for the next hop address of a message */
++#ifndef NWK_MAX_DATA_RETRIES
++#define NWK_MAX_DATA_RETRIES 2
++#endif
++
++/* The maximum number of times APS frames are retried after not receiving an APS ACK */
++#ifndef APSC_MAX_FRAME_RETRIES
++#define APSC_MAX_FRAME_RETRIES 3
++#endif
++
++/* This number is used by polled devices, since the spec'd formula
++ * doesn't work for sleeping end devices. For non-polled devices,
++ * a formula is used. Value is in 2 milliseconds periods
++ */
++#ifndef APSC_ACK_WAIT_DURATION_POLLED
++#define APSC_ACK_WAIT_DURATION_POLLED 3000
++#endif
++
++/* The maximum number of groups in the groups table */
++#ifndef APS_MAX_GROUPS
++#define APS_MAX_GROUPS 16
++#endif
++
++/* Number of entries in the regular routing table plus additional
++ * entries for route repair
++ */
++#ifndef MAX_RTG_ENTRIES
++#define MAX_RTG_ENTRIES 40
++#endif
++
++/* Maximum number of entries in the Binding table. */
++#ifndef NWK_MAX_BINDING_ENTRIES
++#define NWK_MAX_BINDING_ENTRIES 4
++#endif
++
++/* Default security key. */
++#ifndef DEFAULT_KEY
++#define DEFAULT_KEY {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
++#endif
++
++/* ZigBee Alliance Pre-configured Distributed Link Key (for Distributed networks) */
++#ifndef DISTRIBUTED_GLOBAL_LINK_KEY
++#define DISTRIBUTED_GLOBAL_LINK_KEY {0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
++#endif
++
++/* ZigBee Alliance Pre-configured TC Link Key - 'ZigBeeAlliance09' (for Centralized networks) */
++#ifndef DEFAULT_TC_LINK_KEY
++#define DEFAULT_TC_LINK_KEY {0x5a,0x69,0x67,0x42,0x65,0x65,0x41,0x6c,0x6c,0x69,0x61,0x6e,0x63,0x65,0x30,0x39}
++#endif
++
++/* The number of milliseconds to wait between data request polls to the coordinator. */
++#ifndef TXPOWER
++#define TXPOWER 5
++#endif
++
++/****************************************
++ * The following are for End Devices only
++ ***************************************/
++
++/* Determine whether the radio on an End Device is always on */
++#ifndef RFD_RX_ALWAYS_ON_CAPABLE
++#define RFD_RX_ALWAYS_ON_CAPABLE TRUE
++#endif
++
++#ifndef RFD_RX_ALWAYS_ON
++#define RFD_RX_ALWAYS_ON FALSE
++#endif
++
++/* The minimum poll rate. */
++#ifndef MINIMUM_APP_POLL_RATE
++#define MINIMUM_APP_POLL_RATE 100
++#endif
++
++/* The number of milliseconds to wait between data request polls to the coordinator. */
++#ifndef POLL_RATE
++#define POLL_RATE 3000
++#endif
++
++/* This is used after receiving a data indication to poll immediately
++ * for queued messages...in milliseconds.
++ */
++#ifndef QUEUED_POLL_RATE
++#define QUEUED_POLL_RATE 100
++#endif
++
++/* This is used after receiving a data confirmation to poll immediately
++ * for response messages...in milliseconds
++ */
++#ifndef RESPONSE_POLL_RATE
++#define RESPONSE_POLL_RATE 100
++#endif
++
++/* This is used as an alternate response poll rate only for rejoin request.
++ * This rate is determined by the response time of the parent that the device
++ * is trying to join.
++ */
++#ifndef REJOIN_POLL_RATE
++#define REJOIN_POLL_RATE 440
++#endif
++
++/* Maximum number of devices in the Assoc/Device list. */
++#ifndef NWK_MAX_DEVICE_LIST
++#define NWK_MAX_DEVICE_LIST 20
++#endif
++
++/* Total Number of APS keys that a TC can manage. This is equal to the number of devices a ZC can allow to join the network */
++#ifndef ZDSECMGR_TC_DEVICE_MAX
++#define ZDSECMGR_TC_DEVICE_MAX 40
++#endif
++
++/* Value used by end device when sending End Device Timeout Request */
++/* This is an index into table timeoutValue[] defined in nwk_globals.c */
++#ifndef END_DEV_TIMEOUT_VALUE
++#define END_DEV_TIMEOUT_VALUE 8
++#endif
++
++
++
++
++#endif /* TI_ZSTACK_CONFIG_H */
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt.h b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt.h
index 2c5073c..8732c65 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt.h
@@ -466,14 +2687,14 @@ index 90d6d4a..4d50083 100644
* @fn MT_UtilAssocFindDevice
*
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
-index 63c143b..fc3895f 100644
+index 63c143b..11325fd 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@@ -43,15 +43,21 @@
#include "zcomdef.h"
#include "mt_version.h"
-+#define CODE_REVISION_NUMBER 20201026
++#define CODE_REVISION_NUMBER 20210120
+
/******************************************************************************
* CONSTANTS
@@ -494,10 +2715,10 @@ index 63c143b..fc3895f 100644
/******************************************************************************
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
-index 0000000..18ec8d6
+index 0000000..7017d6f
--- /dev/null
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
-@@ -0,0 +1,37 @@
+@@ -0,0 +1,52 @@
+#define MT_SYS_KEY_MANAGEMENT 1
+#define FEATURE_NVEXID 1
+
@@ -523,10 +2744,10 @@ index 0000000..18ec8d6
+ * Enable MTO routing
+ */
+#define CONCENTRATOR_ENABLE TRUE
-+#define CONCENTRATOR_DISCOVERY_TIME 120
++#define CONCENTRATOR_DISCOVERY_TIME 100
+#define CONCENTRATOR_ROUTE_CACHE TRUE
+#define MAX_RTG_SRC_ENTRIES 200
-+#define SRC_RTG_EXPIRY_TIME 255
++#define SRC_RTG_EXPIRY_TIME 2
+
+/**
+ * Scale other device tables appropriately
@@ -535,6 +2756,21 @@ index 0000000..18ec8d6
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
++
++/**
++ * 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
++
++// 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
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index 6e3cb6a..1f90cc6 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@@ -583,8 +2819,27 @@ index 3a7afa3..e3a2706 100644
{
// Save original endpoint
uint8_t endpoint = aff->DstEndPoint;
+diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+index a78ad3c..bfe7884 100644
+--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
++++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+@@ -65,10 +65,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 16 // Waiting to be sent to MAC
++#define NWK_MAX_DATABUFS_SCHEDULED 10 // Timed messages to be sent
++#define NWK_MAX_DATABUFS_CONFIRMED 10 // Held after MAC confirms
++#define NWK_MAX_DATABUFS_TOTAL 24 // 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/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
-index e716024..f8d8404 100644
+index 8ea2ac3..4879330 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -104,7 +104,7 @@ uint8_t zgSecurePermitJoin = TRUE;
@@ -608,7 +2863,7 @@ index e716024..f8d8404 100644
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
-index 17ac2f5..9c0021b 100644
+index 1f807ca..b935b6a 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -419,12 +419,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
@@ -629,7 +2884,7 @@ index 17ac2f5..9c0021b 100644
}
else
{
-@@ -882,12 +881,11 @@ void ZDApp_NetworkStartEvt( void )
+@@ -885,12 +884,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
@@ -647,23 +2902,32 @@ index 17ac2f5..9c0021b 100644
}
else
{
-diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
-index 2b19342..b448752 100755
---- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
-+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
-@@ -70,15 +70,9 @@
+@@ -3132,6 +3130,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/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
+index 2dcc711..2c23e66 100755
+--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
++++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
+@@ -70,9 +70,9 @@
/* must be located at the beginning of the application. */
#define FLASH_BASE 0x00000000
--#ifdef ONE_PAGE_NV
--#define FLASH_SIZE 0x54000
--#define FLASH_NV_BASE 0x54000
--#define FLASH_NV_SIZE 0x2000
--#else
-#define FLASH_SIZE 0x52000
-#define FLASH_NV_BASE 0x52000
-#define FLASH_NV_SIZE 0x4000
--#endif
+#define FLASH_SIZE 0x50000
+#define FLASH_NV_BASE 0x50000
+#define FLASH_NV_SIZE 0x6000
@@ -671,7 +2935,7 @@ index 2b19342..b448752 100755
#define FLASH_LAST_SIZE 0x2000
diff --git a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
-index 58838a8..19219e0 100644
+index 6c98f84..d43aefe 100644
--- a/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
+++ b/znp_CC2652RB_LAUNCHXL_tirtos_ccs/znp.syscfg
@@ -50,6 +50,7 @@ CCFG.enableBootloaderBackdoor = true;
@@ -693,6 +2957,39 @@ index 58838a8..19219e0 100644
NVS2.$name = "CONFIG_NVSEXTERNAL";
NVS2.nvsType = "External";
+@@ -122,18 +123,20 @@ SPI1.sclkPinInstance.$name = "CONFIG_PIN_SPI_SCLK";
+ SPI1.misoPinInstance.$name = "CONFIG_PIN_SPI_MISO";
+ SPI1.mosiPinInstance.$name = "CONFIG_PIN_SPI_MOSI";
+
+-zstack.deviceType = "znp";
+-zstack.deviceTypeReadOnly = true;
+-zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
+-zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
+-zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
+-zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
+-zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
+-zstack.network.$name = "ti_zstack_network_zstack_network0";
+-zstack.advanced.$name = "ti_zstack_advanced_zstack_advanced0";
+-zstack.advanced.routing.$name = "ti_zstack_advanced_zstack_routing0";
+-zstack.advanced.packetSending.$name = "ti_zstack_advanced_zstack_packet_sending0";
+-zstack.advanced.tableSize.$name = "ti_zstack_advanced_zstack_table_size0";
++zstack.deviceType = "znp";
++zstack.deviceTypeReadOnly = true;
++zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
++zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
++zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
++zstack.rf.txPower = "5";
++zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
++zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
++zstack.network.$name = "ti_zstack_network_zstack_network0";
++zstack.advanced.$name = "ti_zstack_advanced_zstack_advanced0";
++zstack.advanced.routing.$name = "ti_zstack_advanced_zstack_routing0";
++zstack.advanced.packetSending.$name = "ti_zstack_advanced_zstack_packet_sending0";
++zstack.advanced.packetSending.apsAckWaitDurationPolled = 1000;
++zstack.advanced.tableSize.$name = "ti_zstack_advanced_zstack_table_size0";
+
+ /**
+ * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt.h b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt.h
index 2c5073c..8732c65 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt.h
@@ -796,14 +3093,14 @@ index 90d6d4a..4d50083 100644
* @fn MT_UtilAssocFindDevice
*
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
-index 63c143b..fc3895f 100644
+index 63c143b..11325fd 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/mt/mt_version.c
@@ -43,15 +43,21 @@
#include "zcomdef.h"
#include "mt_version.h"
-+#define CODE_REVISION_NUMBER 20201026
++#define CODE_REVISION_NUMBER 20210120
+
/******************************************************************************
* CONSTANTS
@@ -824,10 +3121,10 @@ index 63c143b..fc3895f 100644
/******************************************************************************
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
new file mode 100644
-index 0000000..18ec8d6
+index 0000000..7017d6f
--- /dev/null
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
-@@ -0,0 +1,37 @@
+@@ -0,0 +1,52 @@
+#define MT_SYS_KEY_MANAGEMENT 1
+#define FEATURE_NVEXID 1
+
@@ -853,10 +3150,10 @@ index 0000000..18ec8d6
+ * Enable MTO routing
+ */
+#define CONCENTRATOR_ENABLE TRUE
-+#define CONCENTRATOR_DISCOVERY_TIME 120
++#define CONCENTRATOR_DISCOVERY_TIME 100
+#define CONCENTRATOR_ROUTE_CACHE TRUE
+#define MAX_RTG_SRC_ENTRIES 200
-+#define SRC_RTG_EXPIRY_TIME 255
++#define SRC_RTG_EXPIRY_TIME 2
+
+/**
+ * Scale other device tables appropriately
@@ -865,6 +3162,21 @@ index 0000000..18ec8d6
+#define ZDSECMGR_TC_DEVICE_MAX 200
+#define MAX_NEIGHBOR_ENTRIES 20
+#define MAX_RTG_ENTRIES 100
++
++/**
++ * 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
++
++// 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
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
index 6e3cb6a..1f90cc6 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/znp_cnf.opts
@@ -913,8 +3225,27 @@ index 3a7afa3..e3a2706 100644
{
// Save original endpoint
uint8_t endpoint = aff->DstEndPoint;
+diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+index a78ad3c..bfe7884 100644
+--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
++++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/nwk/nwk_globals.c
+@@ -65,10 +65,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 16 // Waiting to be sent to MAC
++#define NWK_MAX_DATABUFS_SCHEDULED 10 // Timed messages to be sent
++#define NWK_MAX_DATABUFS_CONFIRMED 10 // Held after MAC confirms
++#define NWK_MAX_DATABUFS_TOTAL 24 // 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/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
-index e716024..f8d8404 100644
+index 8ea2ac3..4879330 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/sys/zglobals.c
@@ -104,7 +104,7 @@ uint8_t zgSecurePermitJoin = TRUE;
@@ -938,7 +3269,7 @@ index e716024..f8d8404 100644
//========== TouchLink NWK configuration ===============
// Values used by Router when starts a network as initiator
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
-index 17ac2f5..9c0021b 100644
+index 1f807ca..b935b6a 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/zdo/zd_app.c
@@ -419,12 +419,11 @@ uint32_t ZDApp_event_loop( uint8_t task_id, uint32_t events )
@@ -959,7 +3290,7 @@ index 17ac2f5..9c0021b 100644
}
else
{
-@@ -882,12 +881,11 @@ void ZDApp_NetworkStartEvt( void )
+@@ -885,12 +884,11 @@ void ZDApp_NetworkStartEvt( void )
bdb_reportCommissioningState(BDB_INITIALIZATION,TRUE);
}
@@ -977,10 +3308,25 @@ index 17ac2f5..9c0021b 100644
}
else
{
-diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
-index e3fea91..b448752 100755
---- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
-+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc26x2lp.cmd
+@@ -3132,6 +3130,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/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
+index 2dcc711..2c23e66 100755
+--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
++++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/cc13x2_cc26x2.cmd
@@ -70,9 +70,9 @@
/* must be located at the beginning of the application. */
@@ -995,7 +3341,7 @@ index e3fea91..b448752 100755
#define FLASH_LAST_SIZE 0x2000
diff --git a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
-index a44107b..5d645ba 100644
+index e7dd877..2b49fcc 100644
--- a/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
+++ b/znp_CC26X2R1_LAUNCHXL_tirtos_ccs/znp.syscfg
@@ -49,6 +49,7 @@ CCFG.enableBootloader = true;
@@ -1017,6 +3363,39 @@ index a44107b..5d645ba 100644
NVS2.$name = "CONFIG_NVSEXTERNAL";
NVS2.nvsType = "External";
+@@ -121,18 +122,20 @@ SPI1.sclkPinInstance.$name = "CONFIG_PIN_SPI_SCLK";
+ SPI1.misoPinInstance.$name = "CONFIG_PIN_SPI_MISO";
+ SPI1.mosiPinInstance.$name = "CONFIG_PIN_SPI_MOSI";
+
+-zstack.deviceType = "znp";
+-zstack.deviceTypeReadOnly = true;
+-zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
+-zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
+-zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
+-zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
+-zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
+-zstack.network.$name = "ti_zstack_network_zstack_network0";
+-zstack.advanced.$name = "ti_zstack_advanced_zstack_advanced0";
+-zstack.advanced.routing.$name = "ti_zstack_advanced_zstack_routing0";
+-zstack.advanced.packetSending.$name = "ti_zstack_advanced_zstack_packet_sending0";
+-zstack.advanced.tableSize.$name = "ti_zstack_advanced_zstack_table_size0";
++zstack.deviceType = "znp";
++zstack.deviceTypeReadOnly = true;
++zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
++zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
++zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
++zstack.rf.txPower = "5";
++zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
++zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
++zstack.network.$name = "ti_zstack_network_zstack_network0";
++zstack.advanced.$name = "ti_zstack_advanced_zstack_advanced0";
++zstack.advanced.routing.$name = "ti_zstack_advanced_zstack_routing0";
++zstack.advanced.packetSending.$name = "ti_zstack_advanced_zstack_packet_sending0";
++zstack.advanced.packetSending.apsAckWaitDurationPolled = 1000;
++zstack.advanced.tableSize.$name = "ti_zstack_advanced_zstack_table_size0";
+
+ /**
+ * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
--
2.24.3 (Apple Git-128)
diff --git a/coordinator/Z-Stack_Home_1.2/CHANGELOG.md b/coordinator/Z-Stack_Home_1.2/CHANGELOG.md
index ff7bbff..d45b6ed 100644
--- a/coordinator/Z-Stack_Home_1.2/CHANGELOG.md
+++ b/coordinator/Z-Stack_Home_1.2/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 20201127/20201128
+- Fix join failing after some uptime
+- Support PGC410EU
+- Fix incorrect route usage with source routing firmware
+
# 20190619
- Make source routing firmware identical to 20190315 MAX_STABILITY
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20190608.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20190608.zip
deleted file mode 100644
index b67577b..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20190608.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20201127.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20201127.zip
new file mode 100644
index 0000000..9bbabbe
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20201127.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20190608.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20190608.zip
deleted file mode 100644
index 08e0d28..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20190608.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20201127.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20201127.zip
new file mode 100644
index 0000000..bec6330
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20201127.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20190608.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20190608.zip
deleted file mode 100644
index 78f504a..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20190608.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20201127.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20201127.zip
new file mode 100644
index 0000000..7130126
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20201127.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip
deleted file mode 100644
index 34ca179..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip b/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip
new file mode 100644
index 0000000..4f09d70
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20190619.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20190619.zip
deleted file mode 100644
index f3ecf13..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20190619.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20201128.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20201128.zip
new file mode 100644
index 0000000..836fec8
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20201128.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20190619.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20190619.zip
deleted file mode 100644
index a95bcf2..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20190619.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20201128.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20201128.zip
new file mode 100644
index 0000000..f2f3919
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20201128.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20190619.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20190619.zip
deleted file mode 100644
index 57bc92e..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20190619.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20201128.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20201128.zip
new file mode 100644
index 0000000..f7092f6
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20201128.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20190619.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20190619.zip
deleted file mode 100644
index f4a7c95..0000000
Binary files a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20190619.zip and /dev/null differ
diff --git a/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20201128.zip b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20201128.zip
new file mode 100644
index 0000000..d310f18
Binary files /dev/null and b/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20201128.zip differ
diff --git a/coordinator/Z-Stack_Home_1.2/firmware.patch b/coordinator/Z-Stack_Home_1.2/firmware.patch
index 4213da7..43103a7 100644
--- a/coordinator/Z-Stack_Home_1.2/firmware.patch
+++ b/coordinator/Z-Stack_Home_1.2/firmware.patch
@@ -1,3 +1,23 @@
+From 79b43ef6bb5d3ab40e60c26f1419ba6143559d48 Mon Sep 17 00:00:00 2001
+From: Koen Kanters
+Date: Tue, 28 Jul 2020 19:39:55 +0200
+Subject: [PATCH 1/1] Own changes
+
+---
+ .../hal/target/CC2530ZNP/hal_board_cfg.h | 6 +-
+ Components/mt/MT_SYS.c | 16 +++
+ Components/mt/revision_info.h | 1 +
+ Components/stack/af/AF.c | 26 +++-
+ Components/stack/zdo/ZDApp.c | 10 +-
+ Components/stack/zdo/ZDSecMgr.c | 17 +++
+ Projects/zstack/ZMain/TI2530ZNP/OnBoard.c | 9 ++
+ .../zstack/ZNP/CC253x/Source/preinclude.h | 123 ++++++++++++++++++
+ Projects/zstack/ZNP/Source/znp.cfg | 4 +-
+ Projects/zstack/ZNP/Source/znp_app.c | 22 +++-
+ 10 files changed, 223 insertions(+), 11 deletions(-)
+ create mode 100644 Components/mt/revision_info.h
+ create mode 100644 Projects/zstack/ZNP/CC253x/Source/preinclude.h
+
diff --git a/Components/hal/target/CC2530ZNP/hal_board_cfg.h b/Components/hal/target/CC2530ZNP/hal_board_cfg.h
index 0459c86..1e40362 100644
--- a/Components/hal/target/CC2530ZNP/hal_board_cfg.h
@@ -65,13 +85,13 @@ index 35aae57..1f8ee82 100644
diff --git a/Components/mt/revision_info.h b/Components/mt/revision_info.h
new file mode 100644
-index 0000000..abe513b
+index 0000000..f9343d6
--- /dev/null
+++ b/Components/mt/revision_info.h
@@ -0,0 +1 @@
-+#define CODE_REVISION_NUMBER 20190619
++#define CODE_REVISION_NUMBER 20201128
diff --git a/Components/stack/af/AF.c b/Components/stack/af/AF.c
-index c6183b6..2b885b6 100644
+index c6183b6..128b194 100644
--- a/Components/stack/af/AF.c
+++ b/Components/stack/af/AF.c
@@ -372,10 +372,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16 Src
@@ -110,11 +130,37 @@ index c6183b6..2b885b6 100644
else if ( (epDesc = afFindEndPointDesc( aff->DstEndPoint )) )
{
pList = afFindEndPointDescList( epDesc->endPoint );
+@@ -422,7 +436,9 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16 Src
+ // 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 )) ||
++ // Fix below is to support PGC410EU: https://github.com/Koenkk/zigbee2mqtt/issues/4055
++ ((epDesc->endPoint == 2) && ( aff->ProfileID == 0xFC01 )) )
+ {
+ // Save original endpoint
+ uint8 endpoint = aff->DstEndPoint;
diff --git a/Components/stack/zdo/ZDApp.c b/Components/stack/zdo/ZDApp.c
-index 242be04..cca4781 100644
+index 242be04..cfad5e9 100644
--- a/Components/stack/zdo/ZDApp.c
+++ b/Components/stack/zdo/ZDApp.c
-@@ -3463,7 +3463,7 @@ void ZDApp_NVUpdate( void )
+@@ -3148,6 +3148,14 @@ void ZDO_NetworkStatusCB( uint16 nwkDstAddr, uint8 statusCode, uint16 dstAddr )
+ // 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 );
++ }
+ }
+
+ /******************************************************************************
+@@ -3463,7 +3471,7 @@ void ZDApp_NVUpdate( void )
*/
uint16 ZDApp_CoordStartPANIDConflictCB( uint16 panid )
{
@@ -123,6 +169,68 @@ index 242be04..cca4781 100644
}
/*********************************************************************
+diff --git a/Components/stack/zdo/ZDSecMgr.c b/Components/stack/zdo/ZDSecMgr.c
+index 2eacc11..a910a06 100644
+--- a/Components/stack/zdo/ZDSecMgr.c
++++ b/Components/stack/zdo/ZDSecMgr.c
+@@ -42,6 +42,8 @@ extern "C"
+ {
+ #endif
+
++#define SLEEP(_count) do {volatile uint32 count = (_count); while (count--);} while (0)
++
+ /******************************************************************************
+ * INCLUDES
+ */
+@@ -1114,14 +1116,22 @@ ZStatus_t ZDSecMgrDeviceJoin( ZDSecMgrDevice_t* device )
+ ZStatus_t status = ZSuccess;
+ uint16 ami;
+
++ // Add sleeps, see https://github.com/Koenkk/zigbee2mqtt/issues/3177
++ SLEEP(0x3E8);
++
+ // attempt to validate device that joined/rejoined without security
+ if ( device->secure == FALSE )
+ {
++ SLEEP(0x3E8);
+ status = ZDSecMgrDeviceValidate( device );
+ }
++
++ SLEEP(0x3E8);
+
+ if ( status == ZSuccess )
+ {
++ SLEEP(0x3E8);
++
+ // Add the device to the address manager
+ ZDSecMgrAddrStore( device->nwkAddr, device->extAddr, &ami );
+
+@@ -1129,18 +1139,25 @@ ZStatus_t ZDSecMgrDeviceJoin( ZDSecMgrDevice_t* device )
+ if ( ( device->devStatus & DEV_SEC_INIT_STATUS ) &&
+ ( device->secure == FALSE ) )
+ {
++ SLEEP(0x3E8);
+ //send the nwk key data to the joining device
+ status = ZDSecMgrSendNwkKey( device );
+ }
++
++ SLEEP(0x3E8);
+
+ if ( status != ZSuccess )
+ {
++ SLEEP(0x3E8);
+ ZDSecMgrAddrClear( device->extAddr );
+ }
+ }
++
++ SLEEP(0x3E8);
+
+ if ( status != ZSuccess )
+ {
++ SLEEP(0x3E8);
+ // not allowed or transport key failed, remove the device
+ ZDSecMgrDeviceRemove( device );
+ }
diff --git a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c
index 7c6c77e..8265ff1 100644
--- a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c
@@ -333,3 +441,6 @@ index 470ff12..e42ac65 100644
}
else
{
+--
+2.18.0.windows.1
+
diff --git a/router/CC2530/README.md b/router/CC2530/README.md
deleted file mode 100644
index ff25f21..0000000
--- a/router/CC2530/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# CC2530 router firmware
-Currently no compilation instructions are available for this firmware.
-
-Credits for this firmware go to [ptvoinfo](https://github.com/ptvoinfo)
\ No newline at end of file
diff --git a/router/CC2530_CC2591/README.md b/router/CC2530_CC2591/README.md
deleted file mode 100644
index 102a5de..0000000
--- a/router/CC2530_CC2591/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# CC2530_CC2591 router firmware
-Currently no compilation instructions are available for this firmware.
-
-Credits for this firmware go to [ptvoinfo](https://github.com/ptvoinfo)
\ No newline at end of file
diff --git a/router/CC2530_CC2592/README.md b/router/CC2530_CC2592/README.md
deleted file mode 100644
index 03f8a39..0000000
--- a/router/CC2530_CC2592/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# CC2530_CC2592 router firmware
-Currently no compilation instructions are available for this firmware.
-
-Credits for this firmware go to [ptvoinfo](https://github.com/ptvoinfo)
\ No newline at end of file
diff --git a/router/CC2531/README.md b/router/CC2531/README.md
deleted file mode 100644
index 10a1a81..0000000
--- a/router/CC2531/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# CC2531 router firmware
-Currently no compilation instructions are available for this firmware.
-
-Credits for this firmware go to [ptvoinfo](https://github.com/ptvoinfo)
\ No newline at end of file
diff --git a/router/Z-Stack_3.x.0/CHANGELOG.md b/router/Z-Stack_3.x.0/CHANGELOG.md
new file mode 100644
index 0000000..96d5ca1
--- /dev/null
+++ b/router/Z-Stack_3.x.0/CHANGELOG.md
@@ -0,0 +1,2 @@
+# 20210128
+- Initial router firmwares
\ No newline at end of file
diff --git a/router/Z-Stack_3.x.0/COMPILE.md b/router/Z-Stack_3.x.0/COMPILE.md
new file mode 100644
index 0000000..0ab765d
--- /dev/null
+++ b/router/Z-Stack_3.x.0/COMPILE.md
@@ -0,0 +1,24 @@
+# Compiling the firmware
+
+## Setup development environment
+1. Download and install [SIMPLELINK-CC13X2-26X2-SDK_4.40.00.44](http://www.ti.com/tool/download/SIMPLELINK-CC13X2-26X2-SDK).
+1. Download and install [Code Composer Studio 10.2.0.00009](http://www.ti.com/tool/CCSTUDIO).
+
+## Compiling
+1. Start Code Composer Studio
+1. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13x2_26x2_sdk_4_40_00_44/examples/rtos`. Select `zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_css`, `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_css` and `zr_genericapp_CC2652RB_LAUNCHXL_tirtos_css`. Press *Finish*.
+1. In Code Composer Studio, expand the 3 projects and for each open `znp.syscfg`, change `Minimal Poll Period (ms)` to `1000`, change it back to `100` immediately and save the file.
+1. Go to your CCS workspace and copy `firmware.patch` to the root.
+1. Open Git Bash, go to your CCS root and apply the patch using `git apply firmware.patch --ignore-space-change`.
+1. **Only** for `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_css`:
+ - Right click on `znp.syscfg` -> *Delete*
+ - Right click on `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_css` -> *Properties*.
+ - Go to *(CCS) Build* - *ARM Compiler* - *Include Options* -> Under *Add dir to #include search path (--include_path, -l)* add `${PROJECT_ROOT}/syscfg` as the **last** entry.
+ - Go to *(CCS) Build* - *ARM Linker* - *File Search Path* -> Under *Include library file or command file as input (--library, -l)* change `${PROJECT_BUILD_DIR}/syscfg/ti_utils_build_linker.cmd.genlibs` to `${PROJECT_ROOT}/syscfg/ti_utils_build_linker.cmd.genlibs`
+1. Build the 3 projects; right click -> *Build project*.
+ - **Important:** by default the **launchpad** variant of the CC1352P2_CC2652P (= `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs`) is build. To build the **other** variant comment `#define LAUNCHPAD_CONFIG 1` in `preinclude.h` (located under `Stack/Config/`), don't forget to save.
+1. Once finished, the firmware can be found under `zr_genericapp_[CC26X2R1/CC1352P_2/CC2652RB]_LAUNCHXL_tirtos_ccs/default/zr_genericapp_[CC26X2R1/CC2652RB/CC1352P_2]_LAUNCHXL_tirtos_ccs.hex`
+ - `zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs.hex` -> CC2652R
+ - `zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs.hex` -> CC2652RB
+ - `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs.hex` -> CC1352P-2 and CC2652P
+
diff --git a/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210128.zip b/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210128.zip
new file mode 100644
index 0000000..43c66d5
Binary files /dev/null and b/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_20210128.zip differ
diff --git a/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210128.zip b/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210128.zip
new file mode 100644
index 0000000..7add157
Binary files /dev/null and b/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_20210128.zip differ
diff --git a/router/Z-Stack_3.x.0/bin/CC2652RB_20210128.zip b/router/Z-Stack_3.x.0/bin/CC2652RB_20210128.zip
new file mode 100644
index 0000000..7657c45
Binary files /dev/null and b/router/Z-Stack_3.x.0/bin/CC2652RB_20210128.zip differ
diff --git a/router/Z-Stack_3.x.0/bin/CC2652R_20210128.zip b/router/Z-Stack_3.x.0/bin/CC2652R_20210128.zip
new file mode 100644
index 0000000..22efdac
Binary files /dev/null and b/router/Z-Stack_3.x.0/bin/CC2652R_20210128.zip differ
diff --git a/router/Z-Stack_3.x.0/bin/README.md b/router/Z-Stack_3.x.0/bin/README.md
new file mode 100644
index 0000000..9a107be
--- /dev/null
+++ b/router/Z-Stack_3.x.0/bin/README.md
@@ -0,0 +1,14 @@
+# Z-Stack 3.x.0 router firmwares
+
+## What firmware to pick for my device?
+Same logic as the coordinator firmware applies. See [README.md of the coordinator firmware](../../../coordinator/Z-Stack_3.x.0/bin/README.md).
+
+## Pairing
+After reflashing the router will automatically pair.
+
+## Factory reset
+To factory reset single press the button on your device.
+
+Notes:
+- Launchpads have 2 buttons, it doesn't matter which one you press
+- Slaesh's CC2652RB stick has 2 buttons, press the one furthest away from the USB connector.
diff --git a/router/Z-Stack_3.x.0/firmware.patch b/router/Z-Stack_3.x.0/firmware.patch
new file mode 100644
index 0000000..0389805
--- /dev/null
+++ b/router/Z-Stack_3.x.0/firmware.patch
@@ -0,0 +1,2638 @@
+From 0c5f65ee658c64f991b7cb22551df907984d2f71 Mon Sep 17 00:00:00 2001
+From: Koen Kanters
+Date: Mon, 25 Jan 2021 15:48:06 +0100
+Subject: [PATCH 1/1] Own changes
+
+---
+ .../Application/zcl_genericapp.c | 32 +-
+ .../Application/zcl_genericapp_data.c | 22 +-
+ .../Stack/Config/f8wrouter.opts | 2 +
+ .../Stack/Config/preinclude.h | 19 +
+ .../syscfg/ti_devices_config.c | 103 ++
+ .../syscfg/ti_drivers_config.c | 1060 +++++++++++++++++
+ .../syscfg/ti_drivers_config.h | 283 +++++
+ .../syscfg/ti_radio_config.c | 340 ++++++
+ .../syscfg/ti_radio_config.h | 77 ++
+ .../syscfg/ti_utils_build_linker.cmd.genlibs | 35 +
+ .../syscfg/ti_zstack_config.h | 226 ++++
+ .../Application/zcl_genericapp.c | 32 +-
+ .../Application/zcl_genericapp_data.c | 22 +-
+ .../Stack/Config/f8wrouter.opts | 2 +
+ .../Stack/Config/preinclude.h | 6 +
+ .../zr_genericapp.syscfg | 3 +
+ .../Application/zcl_genericapp.c | 32 +-
+ .../Application/zcl_genericapp_data.c | 22 +-
+ .../Stack/Config/f8wrouter.opts | 2 +
+ .../Stack/Config/preinclude.h | 6 +
+ .../zr_genericapp.syscfg | 3 +
+ 21 files changed, 2263 insertions(+), 66 deletions(-)
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+ create mode 100644 zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
+ create mode 100644 zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+ create mode 100644 zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+index f33fc07..5aad76f 100644
+--- a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+@@ -53,6 +53,8 @@
+ * INCLUDES
+ */
+
++#include
++
+ #include "rom_jt_154.h"
+ #include "zcomdef.h"
+
+@@ -426,7 +428,7 @@ static void zclGenericApp_Init( void )
+ // Call BDB initialization. Should be called once from application at startup to restore
+ // previous network configuration, if applicable.
+ zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- zstack_bdbStartCommissioningReq.commissioning_mode = 0;
++ zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+ Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+ }
+
+@@ -1208,28 +1210,16 @@ static void zclGenericApp_changeKeyCallback(Button_Handle _btn, Button_EventMask
+ */
+ static void zclGenericApp_processKey(Button_Handle _btn)
+ {
+- zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- //Button 1
+- if(_btn == gLeftButtonHandle)
+- {
+- if(ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE)
+- {
++ NLME_LeaveReq_t req;
++ memset( &req, 0, sizeof( NLME_LeaveReq_t ) );
++ NLME_LeaveReq(&req);
++ // Sleep for 2 seconds, otherwise leave request is not send
++ Task_sleep(2000 * (1000 / ClockP_getSystemTickPeriod()));
+
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- else if (ZG_BUILD_JOINING_TYPE && ZG_DEVICE_JOINING_TYPE)
+- {
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- }
+- //Button 2
+- if(_btn == gRightButtonHandle)
+- {
+- Zstackapi_bdbResetLocalActionReq(appServiceTaskId);
+- }
++ zgWriteStartupOptions( ZG_STARTUP_SET,
++ ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE);
+
++ SysCtrlSystemReset();
+ }
+
+
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+index c0e473d..a09a0df 100644
+--- a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+@@ -96,6 +96,8 @@ const uint16_t zclGenericApp_identify_clusterRevision = 0x0001;
+ const uint8_t zclGenericApp_HWRevision = GENERICAPP_HWVERSION;
+ const uint8_t zclGenericApp_ZCLVersion = GENERICAPP_ZCLVERSION;
+ const uint8_t zclGenericApp_ManufacturerName[] = { 16, 'T','e','x','a','s','I','n','s','t','r','u','m','e','n','t','s' };
++const uint8_t zclGenericApp_ModelID[] = { 9, 't','i','.','r','o','u','t','e','r' };
++const uint8_t zclGenericApp_SwBuildID[] = { 8, '2','0','2','1','0','1','2','8' };
+ const uint8_t zclGenericApp_PowerSource = POWER_SOURCE_MAINS_1_PHASE;
+ uint8_t zclGenericApp_PhysicalEnvironment = PHY_UNSPECIFIED_ENV;
+
+@@ -143,10 +145,28 @@ CONST zclAttrRec_t zclGenericApp_Attrs[] =
+ { // Attribute record
+ ATTRID_BASIC_ZCL_VERSION,
+ ZCL_DATATYPE_UINT8,
+- ACCESS_CONTROL_READ,
++ ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
+ (void *)&zclGenericApp_ZCLVersion
+ }
+ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_MODEL_IDENTIFIER,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_ModelID
++ }
++ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_SW_BUILD_ID,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_SwBuildID
++ }
++ },
+ {
+ ZCL_CLUSTER_ID_GENERAL_BASIC,
+ { // Attribute record
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+index b841d60..598f537 100644
+--- a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+@@ -9,3 +9,5 @@
+ -DADDRMGR_NV_SINGLES
+ -DBINDINGTABLE_NV_SINGLES
+ -DASSOCLIST_NV_SINGLES
++
++--preinclude=preinclude.h
+\ No newline at end of file
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+new file mode 100644
+index 0000000..7fe1942
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+@@ -0,0 +1,19 @@
++#define ZCL_REPORT_DESTINATION_DEVICE
++#define BDB_REPORTING
++#define CUI_DISABLE
++#define NWK_MAX_DEVICE_LIST 50
++#define MAX_NEIGHBOR_ENTRIES 30
++#define MAX_RTG_ENTRIES 100
++
++// Different configs, uncomment for for launchpad 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
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+new file mode 100644
+index 0000000..e6815a3
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_devices_config.c
+@@ -0,0 +1,103 @@
++/*
++ * ======== 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
++// #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
++
++
++//#####################################
++// Debug access settings
++//#####################################
++
++// Disable unlocking of TI FA option.
++#define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00
++
++// 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
++#include DeviceFamily_constructPath(startup_files/ccfg.c)
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+new file mode 100644
+index 0000000..304f6b2
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.c
+@@ -0,0 +1,1060 @@
++/*
++ * ======== ti_drivers_config.c ========
++ * Configured TI-Drivers module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P_2_LAUNCHXL
++ * by the SysConfig tool.
++ */
++
++#include
++#include
++
++#ifndef DeviceFamily_CC13X2
++#define DeviceFamily_CC13X2
++#endif
++
++#include
++
++#include "ti_drivers_config.h"
++
++/*
++ * =============================== AESCBC ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESCBC_COUNT 1
++AESCBCCC26XX_Object aescbcCC26XXObjects[CONFIG_AESCBC_COUNT];
++
++/*
++ * ======== aescbcCC26XXHWAttrs ========
++ */
++const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CONFIG_AESCBC_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const AESCBC_Config AESCBC_config[CONFIG_AESCBC_COUNT] = {
++ { /* CONFIG_AESCBC_0 */
++ .object = &aescbcCC26XXObjects[CONFIG_AESCBC_0],
++ .hwAttrs = &aescbcCC26XXHWAttrs[CONFIG_AESCBC_0]
++ },
++};
++
++const uint_least8_t CONFIG_AESCBC_0_CONST = CONFIG_AESCBC_0;
++const uint_least8_t AESCBC_count = CONFIG_AESCBC_COUNT;
++
++/*
++ * =============================== AESCCM ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESCCM_COUNT 1
++AESCCMCC26XX_Object aesccmCC26XXObjects[CONFIG_AESCCM_COUNT];
++
++/*
++ * ======== aesccmCC26XXHWAttrs ========
++ */
++const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CONFIG_AESCCM_COUNT] = {
++ {
++ .intPriority = 0x40,
++ },
++};
++
++const AESCCM_Config AESCCM_config[CONFIG_AESCCM_COUNT] = {
++ { /* CONFIG_AESCCM_0 */
++ .object = &aesccmCC26XXObjects[CONFIG_AESCCM_0],
++ .hwAttrs = &aesccmCC26XXHWAttrs[CONFIG_AESCCM_0]
++ },
++};
++
++const uint_least8_t CONFIG_AESCCM_0_CONST = CONFIG_AESCCM_0;
++const uint_least8_t AESCCM_count = CONFIG_AESCCM_COUNT;
++
++/*
++ * =============================== AESECB ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_AESECB_COUNT 1
++AESECBCC26XX_Object aesecbCC26XXObjects[CONFIG_AESECB_COUNT];
++
++/*
++ * ======== aesecbCC26XXHWAttrs ========
++ */
++const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CONFIG_AESECB_COUNT] = {
++ {
++ .intPriority = 0x20,
++ },
++};
++
++const AESECB_Config AESECB_config[CONFIG_AESECB_COUNT] = {
++ { /* CONFIG_AESECB_0 */
++ .object = &aesecbCC26XXObjects[CONFIG_AESECB_0],
++ .hwAttrs = &aesecbCC26XXHWAttrs[CONFIG_AESECB_0]
++ },
++};
++
++
++const uint_least8_t CONFIG_AESECB_0_CONST = CONFIG_AESECB_0;
++const uint_least8_t AESECB_count = CONFIG_AESECB_COUNT;
++
++/*
++ * =============================== DMA ===============================
++ */
++
++#include
++#include
++#include
++
++UDMACC26XX_Object udmaCC26XXObject;
++
++const UDMACC26XX_HWAttrs udmaCC26XXHWAttrs = {
++ .baseAddr = UDMA0_BASE,
++ .powerMngrId = PowerCC26XX_PERIPH_UDMA,
++ .intNum = INT_DMA_ERR,
++ .intPriority = (~0)
++};
++
++const UDMACC26XX_Config UDMACC26XX_config[1] = {
++ {
++ .object = &udmaCC26XXObject,
++ .hwAttrs = &udmaCC26XXHWAttrs,
++ },
++};
++
++/*
++ * =============================== ECDH ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECDH_COUNT 1
++
++ECDHCC26X2_Object ecdhCC26X2Objects[CONFIG_ECDH_COUNT];
++
++/*
++ * ======== ecdhCC26X2HWAttrs ========
++ */
++const ECDHCC26X2_HWAttrs ecdhCC26X2HWAttrs[CONFIG_ECDH_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const ECDH_Config ECDH_config[CONFIG_ECDH_COUNT] = {
++ { /* CONFIG_ECDH_0 */
++ .object = &ecdhCC26X2Objects[CONFIG_ECDH_0],
++ .hwAttrs = &ecdhCC26X2HWAttrs[CONFIG_ECDH_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECDH_0_CONST = CONFIG_ECDH_0;
++const uint_least8_t ECDH_count = CONFIG_ECDH_COUNT;
++
++/*
++ * =============================== ECDSA ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECDSA_COUNT 1
++ECDSACC26X2_Object ecdsaCC26X2Objects[CONFIG_ECDSA_COUNT];
++
++/*
++ * ======== ecdsaCC26X2HWAttrs ========
++ */
++const ECDSACC26X2_HWAttrs ecdsaCC26X2HWAttrs[CONFIG_ECDSA_COUNT] = {
++ {
++ .intPriority = (~0),
++ .trngIntPriority = (~0),
++ },
++};
++
++const ECDSA_Config ECDSA_config[CONFIG_ECDSA_COUNT] = {
++ { /* CONFIG_ECDSA_0 */
++ .object = &ecdsaCC26X2Objects[CONFIG_ECDSA_0],
++ .hwAttrs = &ecdsaCC26X2HWAttrs[CONFIG_ECDSA_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECDSA_0_CONST = CONFIG_ECDSA_0;
++const uint_least8_t ECDSA_count = CONFIG_ECDSA_COUNT;
++
++/*
++ * =============================== ECJPAKE ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_ECJPAKE_COUNT 1
++ECJPAKECC26X2_Object ecjpakeCC26X2Objects[CONFIG_ECJPAKE_COUNT];
++
++/*
++ * ======== ecjpakeCC26X2HWAttrs ========
++ */
++const ECJPAKECC26X2_HWAttrs ecjpakeCC26X2HWAttrs[CONFIG_ECJPAKE_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const ECJPAKE_Config ECJPAKE_config[CONFIG_ECJPAKE_COUNT] = {
++ { /* CONFIG_ECJPAKE_0 */
++ .object = &ecjpakeCC26X2Objects[CONFIG_ECJPAKE_0],
++ .hwAttrs = &ecjpakeCC26X2HWAttrs[CONFIG_ECJPAKE_0]
++ },
++};
++
++const uint_least8_t CONFIG_ECJPAKE_0_CONST = CONFIG_ECJPAKE_0;
++const uint_least8_t ECJPAKE_count = CONFIG_ECJPAKE_COUNT;
++
++/*
++ * =============================== GPIO ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_GPIO_COUNT 5
++
++/*
++ * ======== gpioPinConfigs ========
++ * Array of Pin configurations
++ */
++GPIO_PinConfig gpioPinConfigs[] = {
++ /* CONFIG_GPIO_BTN1 : LaunchPad Button BTN-1 (Left) */
++ GPIOCC26XX_DIO_15 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
++ /* CONFIG_GPIO_BTN2 : LaunchPad Button BTN-2 (Right) */
++ GPIOCC26XX_DIO_14 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
++ /* CONFIG_GPIO_RLED : LaunchPad LED Red */
++ GPIOCC26XX_DIO_06 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
++ /* CONFIG_GPIO_GLED : LaunchPad LED Green */
++ GPIOCC26XX_DIO_07 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
++ /* SPI Flash Slave Select GPIO Instance */
++ GPIOCC26XX_DIO_20 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH,
++};
++
++/*
++ * ======== gpioCallbackFunctions ========
++ * Array of callback function pointers
++ *
++ * NOTE: Unused callback entries can be omitted from the callbacks array to
++ * reduce memory usage by enabling callback table optimization
++ * (GPIO.optimizeCallbackTableSize = true)
++ */
++GPIO_CallbackFxn gpioCallbackFunctions[] = {
++ /* CONFIG_GPIO_BTN1 : LaunchPad Button BTN-1 (Left) */
++ NULL,
++ /* CONFIG_GPIO_BTN2 : LaunchPad Button BTN-2 (Right) */
++ NULL,
++ /* CONFIG_GPIO_RLED : LaunchPad LED Red */
++ NULL,
++ /* CONFIG_GPIO_GLED : LaunchPad LED Green */
++ NULL,
++ /* SPI Flash Slave Select GPIO Instance */
++ NULL,
++};
++
++const uint_least8_t CONFIG_GPIO_BTN1_CONST = CONFIG_GPIO_BTN1;
++const uint_least8_t CONFIG_GPIO_BTN2_CONST = CONFIG_GPIO_BTN2;
++const uint_least8_t CONFIG_GPIO_RLED_CONST = CONFIG_GPIO_RLED;
++const uint_least8_t CONFIG_GPIO_GLED_CONST = CONFIG_GPIO_GLED;
++const uint_least8_t CONFIG_GPIO_0_CONST = CONFIG_GPIO_0;
++
++/*
++ * ======== GPIOCC26XX_config ========
++ */
++const GPIOCC26XX_Config GPIOCC26XX_config = {
++ .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
++ .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
++ .numberOfPinConfigs = 5,
++ .numberOfCallbacks = 5,
++ .intPriority = (~0)
++};
++
++/*
++ * =============================== NVS ===============================
++ */
++
++#include
++#include
++
++/*
++ * NVSCC26XX Internal NVS flash region definitions
++ *
++ * Place uninitialized char arrays at addresses
++ * corresponding to the 'regionBase' addresses defined in
++ * the configured NVS regions. These arrays are used as
++ * place holders so that the linker will not place other
++ * content there.
++ *
++ * For GCC targets, the char arrays are each placed into
++ * the shared ".nvs" section. The user must add content to
++ * their GCC linker command file to place the .nvs section
++ * at the lowest 'regionBase' address specified in their NVS
++ * regions.
++ */
++
++#if defined(__TI_COMPILER_VERSION__) || defined(__clang__)
++
++static char flashBuf0[0x4000] __attribute__ ((retain, noinit, location(0x52000)));
++
++#elif defined(__IAR_SYSTEMS_ICC__)
++
++__no_init static char flashBuf0[0x4000] @ 0x52000;
++
++#elif defined(__GNUC__)
++
++__attribute__ ((section (".nvs")))
++static char flashBuf0[0x4000];
++
++#endif
++
++NVSCC26XX_Object nvsCC26XXObjects[1];
++
++static const NVSCC26XX_HWAttrs nvsCC26XXHWAttrs[1] = {
++ /* CONFIG_NVSINTERNAL */
++ {
++ .regionBase = (void *) flashBuf0,
++ .regionSize = 0x4000
++ },
++};
++
++#include
++
++/*
++ * NVSSPI25X External NVS flash region definitions
++ */
++
++/*
++ * Provide write verification buffer whose size is
++ * the largest specified Verification Buffer Size
++ */
++
++static uint8_t verifyBuf[64];
++
++NVSSPI25X_Object nvsSPI25XObjects[1];
++
++static const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
++ /* CONFIG_NVSEXTERNAL */
++ /* MX25R8035F SPI Flash */
++ {
++ .regionBaseOffset = 0x0,
++ .regionSize = 0x256000,
++ .sectorSize = 0x1000,
++ .verifyBuf = verifyBuf,
++ .verifyBufSize = 64,
++ /* NVS opens SPI */
++ .spiHandle = NULL,
++ /* SPI driver index */
++ .spiIndex = CONFIG_SPI_0,
++ .spiBitRate = 4000000,
++ /* GPIO driver pin index */
++ .spiCsnGpioIndex = CONFIG_GPIO_0,
++ .statusPollDelayUs = 100
++ },
++};
++
++#define CONFIG_NVS_COUNT 2
++
++const NVS_Config NVS_config[CONFIG_NVS_COUNT] = {
++ /* CONFIG_NVSINTERNAL */
++ {
++ .fxnTablePtr = &NVSCC26XX_fxnTable,
++ .object = &nvsCC26XXObjects[0],
++ .hwAttrs = &nvsCC26XXHWAttrs[0],
++ },
++ /* CONFIG_NVSEXTERNAL */
++ /* MX25R8035F SPI Flash */
++ {
++ .fxnTablePtr = &NVSSPI25X_fxnTable,
++ .object = &nvsSPI25XObjects[0],
++ .hwAttrs = &nvsSPI25XHWAttrs[0],
++ },
++};
++
++const uint_least8_t CONFIG_NVSINTERNAL_CONST = CONFIG_NVSINTERNAL;
++const uint_least8_t CONFIG_NVSEXTERNAL_CONST = CONFIG_NVSEXTERNAL;
++const uint_least8_t NVS_count = CONFIG_NVS_COUNT;
++
++/*
++ * =============================== PIN ===============================
++ */
++#include
++#include
++
++#define CONFIG_PIN_COUNT 13
++
++const PIN_Config BoardGpioInitTable[CONFIG_PIN_COUNT + 1] = {
++ /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO13) */
++ CONFIG_PIN_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO12) */
++ CONFIG_PIN_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 0, (DIO28) */
++ CONFIG_RF_24GHZ | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 1, (DIO29) */
++ CONFIG_RF_HIGH_PA | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 2, (DIO30) */
++ CONFIG_RF_SUB1GHZ | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO15) */
++ CONFIG_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
++ /* LaunchPad Button BTN-2 (Right), Parent Signal: CONFIG_GPIO_BTN2 GPIO Pin, (DIO14) */
++ CONFIG_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
++ /* LaunchPad LED Red, Parent Signal: CONFIG_GPIO_RLED GPIO Pin, (DIO6) */
++ CONFIG_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad LED Green, Parent Signal: CONFIG_GPIO_GLED GPIO Pin, (DIO7) */
++ CONFIG_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* MX25R8035F SPI Flash Slave Select, Parent Signal: CONFIG_GPIO_0 GPIO Pin, (DIO20) */
++ CONFIG_PIN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 SCLK, (DIO10) */
++ CONFIG_PIN_SPI_SCLK | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MISO, (DIO8) */
++ CONFIG_PIN_SPI_MISO | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
++ /* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MOSI, (DIO9) */
++ CONFIG_PIN_SPI_MOSI | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
++
++ PIN_TERMINATE
++};
++
++const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
++ .intPriority = (~0),
++ .swiPriority = 0
++};
++
++/*
++ * =============================== Power ===============================
++ */
++#include
++#include
++#include "ti_drivers_config.h"
++
++extern void PowerCC26XX_standbyPolicy(void);
++extern bool PowerCC26XX_calibrate(unsigned int);
++
++const PowerCC26X2_Config PowerCC26X2_config = {
++ .enablePolicy = true,
++ .policyInitFxn = NULL,
++ .policyFxn = PowerCC26XX_standbyPolicy,
++ .calibrateFxn = PowerCC26XX_calibrate,
++ .calibrateRCOSC_LF = true,
++ .calibrateRCOSC_HF = true,
++ .enableTCXOFxn = NULL
++};
++
++
++/*
++ * =============================== RF Driver ===============================
++ */
++#include
++
++/*
++ * RF driver callback function, called by the driver on global driver events.
++ */
++static void RF_globalCallbackFunction (RF_Handle client, RF_GlobalEvent events, void* arg);
++
++/*
++ * Callback function to handle custom / application specific behavior
++ */
++extern void __attribute__((weak)) rfDriverCallback (RF_Handle client, RF_GlobalEvent events, void *arg);
++
++/*
++ * Callback function to handle antenna switching
++ */
++extern void __attribute__((weak)) rfDriverCallbackAntennaSwitching (RF_Handle client, RF_GlobalEvent events, void *arg);
++
++/*
++ * Platform-specific driver configuration
++ */
++const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
++ .hwiPriority = (~0),
++ .swiPriority = (uint8_t)0,
++ .xoscHfAlwaysNeeded = true,
++ .globalCallback = &RF_globalCallbackFunction,
++ .globalEventMask = RF_GlobalEventInit | RF_GlobalEventRadioPowerDown | RF_GlobalEventRadioSetup
++};
++
++/*
++ * ======== RF_globalCallbackFunction ========
++ * This function is called by the driver on global driver events.
++ * It will call specific callback functions to further handle the triggering events.
++ */
++static void RF_globalCallbackFunction(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ rfDriverCallback(client, events, arg);
++ rfDriverCallbackAntennaSwitching(client, events, arg);
++}
++
++/*
++ * ======== rfDriverCallback ========
++ * Handle events triggered by the RF driver for custom / application specific behavior.
++ */
++void __attribute__((weak)) rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ /* ======== PLEASE READ THIS ========
++ *
++ * This function is declared weak for the application to override it.
++ * A new definition of 'rfDriverCallback' is required if you want to
++ * handle the events listed in '.globalEventMask'.
++ *
++ * Please copy this function definition to create your own, but make
++ * sure to remove '__attribute__((weak))' for your definition.
++ *
++ * According to '.globalEventMask', this function will be triggered by:
++ * - RF_GlobalEventInit
++ * - RF_GlobalEventRadioPowerDown
++ * - RF_GlobalEventRadioSetup
++ *
++ * An example of how to handle these events would be:
++ *
++ * --- Code snippet begin ---
++ *
++ * if(events & RF_GlobalEventInit) {
++ * // Perform action for this event
++ * }
++ * else if (events & RF_GlobalEventRadioPowerDown) {
++ * // Perform action for this event
++ * }
++ * else if (events & RF_GlobalEventRadioSetup) {
++ * // Perform action for this event
++ * }
++ *
++ * --- Code snippet end ---
++ */
++}
++
++
++/*
++ * ======== Antenna switching ========
++ */
++static PIN_Handle antennaPins;
++static PIN_State antennaState;
++
++static void initAntennaSwitch()
++{
++ PIN_Config antennaConfig[] = {
++ CONFIG_RF_24GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ CONFIG_RF_HIGH_PA | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ CONFIG_RF_SUB1GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
++ PIN_TERMINATE
++ };
++ antennaPins = PIN_open(&antennaState, antennaConfig);
++}
++
++/*
++ * ======== rfDriverCallbackAntennaSwitching ========
++ * Sets up the antenna switch depending on the current PHY configuration.
++ *
++ * Truth table:
++ *
++ * Path DIO28 DIO29 DIO30
++ * =========== ===== ===== =====
++ * Off 0 0 0
++ * Sub-1 GHz 0 0 1
++ * 2.4 GHz 1 0 0
++ * 20 dBm TX 0 1 0
++ */
++void __attribute__((weak)) rfDriverCallbackAntennaSwitching(RF_Handle client, RF_GlobalEvent events, void *arg)
++{
++ /* Protect against repeated RF_init */
++ static bool initialized = false;
++
++ /* Local variable. */
++ bool sub1GHz = false;
++ uint8_t loDivider = 0;
++
++ if (!initialized && events & RF_GlobalEventInit) {
++ /* Don't do it again */
++ initialized = true;
++ initAntennaSwitch();
++ }
++ else if (events & RF_GlobalEventRadioSetup) {
++ /* Switch off all paths. */
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_HIGH_PA, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 0);
++
++ /* Decode the current PA configuration. */
++ RF_TxPowerTable_PAType paType = (RF_TxPowerTable_PAType)RF_getTxPower(client).paType;
++
++ /* Decode the generic argument as a setup command. */
++ RF_RadioSetup* setupCommand = (RF_RadioSetup*)arg;
++
++ switch (setupCommand->common.commandNo) {
++ case (CMD_RADIO_SETUP):
++ case (CMD_BLE5_RADIO_SETUP):
++ loDivider = RF_LODIVIDER_MASK & setupCommand->common.loDivider;
++
++ /* Sub-1GHz front-end. */
++ if (loDivider != 0) {
++ sub1GHz = true;
++ }
++ break;
++ case (CMD_PROP_RADIO_DIV_SETUP):
++ loDivider = RF_LODIVIDER_MASK & setupCommand->prop_div.loDivider;
++
++ /* Sub-1GHz front-end. */
++ if (loDivider != 0) {
++ sub1GHz = true;
++ }
++ break;
++ default:break;
++ }
++
++ if (sub1GHz) {
++ /* Sub-1 GHz */
++ if (paType == RF_TxPowerTable_HighPA) {
++ /* PA enable --> HIGH PA
++ * LNA enable --> Sub-1 GHz
++ */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ /* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
++ de-asserted on CC1352 Rev A. */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_RFC_GPO0);
++ } else {
++ /* RF core active --> Sub-1 GHz */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 1);
++ }
++ } else {
++ /* 2.4 GHz */
++ if (paType == RF_TxPowerTable_HighPA)
++ {
++ /* PA enable --> HIGH PA
++ * LNA enable --> 2.4 GHz
++ */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_RFC_GPO0);
++ /* Note: RFC_GPO3 is a work-around because the RFC_GPO1 (PA enable signal) is sometimes not
++ de-asserted on CC1352 Rev A. */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_RFC_GPO3);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ } else {
++ /* RF core active --> 2.4 GHz */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 1);
++ }
++ }
++ }
++ else if (events & RF_GlobalEventRadioPowerDown) {
++ /* Switch off all paths. */
++ PINCC26XX_setOutputValue(CONFIG_RF_24GHZ, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_HIGH_PA, 0);
++ PINCC26XX_setOutputValue(CONFIG_RF_SUB1GHZ, 0);
++
++ /* Reset the IO multiplexer to GPIO functionality */
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_24GHZ, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_HIGH_PA, PINCC26XX_MUX_GPIO);
++ PINCC26XX_setMux(antennaPins, CONFIG_RF_SUB1GHZ, PINCC26XX_MUX_GPIO);
++ }
++}
++
++/*
++ * =============================== SHA2 ===============================
++ */
++
++#include
++#include
++
++#define CONFIG_SHA2_COUNT 1
++
++SHA2CC26X2_Object sha2CC26X2Objects[CONFIG_SHA2_COUNT];
++
++/*
++ * ======== sha2CC26X2HWAttrs ========
++ */
++const SHA2CC26X2_HWAttrs sha2CC26X2HWAttrs[CONFIG_SHA2_COUNT] = {
++ {
++ .intPriority = (~0),
++ },
++};
++
++const SHA2_Config SHA2_config[CONFIG_SHA2_COUNT] = {
++ { /* CONFIG_SHA2_0 */
++ .object = &sha2CC26X2Objects[CONFIG_SHA2_0],
++ .hwAttrs = &sha2CC26X2HWAttrs[CONFIG_SHA2_0]
++ },
++};
++
++const uint_least8_t CONFIG_SHA2_0_CONST = CONFIG_SHA2_0;
++const uint_least8_t SHA2_count = CONFIG_SHA2_COUNT;
++
++/*
++ * =============================== SPI DMA ===============================
++ */
++#include
++#include
++
++#define CONFIG_SPI_COUNT 1
++
++/*
++ * ======== spiCC26X2DMAObjects ========
++ */
++SPICC26X2DMA_Object spiCC26X2DMAObjects[CONFIG_SPI_COUNT];
++
++/*
++ * ======== spiCC26X2DMAHWAttrs ========
++ */
++const SPICC26X2DMA_HWAttrs spiCC26X2DMAHWAttrs[CONFIG_SPI_COUNT] = {
++ /* CONFIG_SPI_0 */
++ /* LaunchPad SPI Bus */
++ {
++ .baseAddr = SSI0_BASE,
++ .intNum = INT_SSI0_COMB,
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .powerMngrId = PowerCC26XX_PERIPH_SSI0,
++ .defaultTxBufValue = ~0,
++ .rxChannelBitMask = 1<
++#include
++
++#define CONFIG_TRNG_COUNT 1
++
++TRNGCC26XX_Object trngCC26XXObjects[CONFIG_TRNG_COUNT];
++
++/*
++ * ======== trngCC26XXHWAttrs ========
++ */
++static const TRNGCC26XX_HWAttrs trngCC26XXHWAttrs[CONFIG_TRNG_COUNT] = {
++ {
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .samplesPerCycle = 240000
++ },
++};
++
++const TRNG_Config TRNG_config[CONFIG_TRNG_COUNT] = {
++ { /* CONFIG_TRNG_0 */
++ .object = &trngCC26XXObjects[CONFIG_TRNG_0],
++ .hwAttrs = &trngCC26XXHWAttrs[CONFIG_TRNG_0]
++ },
++};
++
++const uint_least8_t CONFIG_TRNG_0_CONST = CONFIG_TRNG_0;
++const uint_least8_t TRNG_count = CONFIG_TRNG_COUNT;
++
++/*
++ * =============================== Temperature ===============================
++ */
++#include
++#include
++
++const TemperatureCC26X2_Config TemperatureCC26X2_config = {
++ .intPriority = (~0),
++};
++
++/*
++ * =============================== UART ===============================
++ */
++
++#include
++#include
++#include
++#include
++#include
++#include
++
++#define CONFIG_UART_COUNT 1
++
++UARTCC26XX_Object uartCC26XXObjects[CONFIG_UART_COUNT];
++
++static unsigned char uartCC26XXRingBuffer0[32];
++
++static const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CONFIG_UART_COUNT] = {
++ {
++ .baseAddr = UART0_BASE,
++ .intNum = INT_UART0_COMB,
++ .intPriority = (~0),
++ .swiPriority = 0,
++ .powerMngrId = PowerCC26XX_PERIPH_UART0,
++ .ringBufPtr = uartCC26XXRingBuffer0,
++ .ringBufSize = sizeof(uartCC26XXRingBuffer0),
++ .rxPin = IOID_12,
++ .txPin = IOID_13,
++ .ctsPin = PIN_UNASSIGNED,
++ .rtsPin = PIN_UNASSIGNED,
++ .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
++ .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
++ .errorFxn = NULL
++ },
++};
++
++const UART_Config UART_config[CONFIG_UART_COUNT] = {
++ { /* CONFIG_DISPLAY_UART */
++ .fxnTablePtr = &UARTCC26XX_fxnTable,
++ .object = &uartCC26XXObjects[CONFIG_DISPLAY_UART],
++ .hwAttrs = &uartCC26XXHWAttrs[CONFIG_DISPLAY_UART]
++ },
++};
++
++const uint_least8_t CONFIG_DISPLAY_UART_CONST = CONFIG_DISPLAY_UART;
++const uint_least8_t UART_count = CONFIG_UART_COUNT;
++
++/*
++ * =============================== Button ===============================
++ */
++#include
++
++#define CONFIG_BUTTON_COUNT 2
++Button_Object ButtonObjects[CONFIG_BUTTON_COUNT];
++
++static const Button_HWAttrs ButtonHWAttrs[CONFIG_BUTTON_COUNT] = {
++ /* CONFIG_BTN_LEFT */
++ /* LaunchPad Button BTN-1 (Left) */
++ {
++ .gpioIndex = CONFIG_GPIO_BTN1
++ },
++ /* CONFIG_BTN_RIGHT */
++ /* LaunchPad Button BTN-2 (Right) */
++ {
++ .gpioIndex = CONFIG_GPIO_BTN2
++ },
++};
++
++const Button_Config Button_config[CONFIG_BUTTON_COUNT] = {
++ /* CONFIG_BTN_LEFT */
++ /* LaunchPad Button BTN-1 (Left) */
++ {
++ .object = &ButtonObjects[CONFIG_BTN_LEFT],
++ .hwAttrs = &ButtonHWAttrs[CONFIG_BTN_LEFT]
++ },
++ /* CONFIG_BTN_RIGHT */
++ /* LaunchPad Button BTN-2 (Right) */
++ {
++ .object = &ButtonObjects[CONFIG_BTN_RIGHT],
++ .hwAttrs = &ButtonHWAttrs[CONFIG_BTN_RIGHT]
++ },
++};
++
++const uint_least8_t CONFIG_BTN_LEFT_CONST = CONFIG_BTN_LEFT;
++const uint_least8_t CONFIG_BTN_RIGHT_CONST = CONFIG_BTN_RIGHT;
++const uint_least8_t Button_count = CONFIG_BUTTON_COUNT;
++
++/*
++ * =============================== LED ===============================
++ */
++#include
++
++#define CONFIG_LED_COUNT 2
++LED_Object LEDObjects[CONFIG_LED_COUNT];
++
++static const LED_HWAttrs LEDHWAttrs[CONFIG_LED_COUNT] = {
++ /* CONFIG_LED_RED */
++ /* LaunchPad LED Red */
++ {
++ .type = LED_GPIO_CONTROLLED,
++ .index = CONFIG_GPIO_RLED,
++ },
++ /* CONFIG_LED_GREEN */
++ /* LaunchPad LED Green */
++ {
++ .type = LED_GPIO_CONTROLLED,
++ .index = CONFIG_GPIO_GLED,
++ },
++};
++
++const LED_Config LED_config[CONFIG_LED_COUNT] = {
++ /* CONFIG_LED_RED */
++ /* LaunchPad LED Red */
++ {
++ .object = &LEDObjects[CONFIG_LED_RED],
++ .hwAttrs = &LEDHWAttrs[CONFIG_LED_RED]
++ },
++ /* CONFIG_LED_GREEN */
++ /* LaunchPad LED Green */
++ {
++ .object = &LEDObjects[CONFIG_LED_GREEN],
++ .hwAttrs = &LEDHWAttrs[CONFIG_LED_GREEN]
++ },
++};
++
++const uint_least8_t CONFIG_LED_RED_CONST = CONFIG_LED_RED;
++const uint_least8_t CONFIG_LED_GREEN_CONST = CONFIG_LED_GREEN;
++const uint_least8_t LED_count = CONFIG_LED_COUNT;
++
++#include
++
++#include
++#include
++
++#include
++
++/*
++ * ======== Board_sendExtFlashByte ========
++ */
++void Board_sendExtFlashByte(PIN_Handle pinHandle, uint8_t byte)
++{
++ uint8_t i;
++
++ /* SPI Flash CS */
++ PIN_setOutputValue(pinHandle, IOID_20, 0);
++
++ for (i = 0; i < 8; i++) {
++ PIN_setOutputValue(pinHandle, IOID_10, 0); /* SPI Flash CLK */
++
++ /* SPI Flash MOSI */
++ PIN_setOutputValue(pinHandle, IOID_9, (byte >> (7 - i)) & 0x01);
++ PIN_setOutputValue(pinHandle, IOID_10, 1); /* SPI Flash CLK */
++
++ /*
++ * Waste a few cycles to keep the CLK high for at
++ * least 45% of the period.
++ * 3 cycles per loop: 8 loops @ 48 Mhz = 0.5 us.
++ */
++ CPUdelay(8);
++ }
++
++ PIN_setOutputValue(pinHandle, IOID_10, 0); /* CLK */
++ PIN_setOutputValue(pinHandle, IOID_20, 1); /* CS */
++
++ /*
++ * Keep CS high at least 40 us
++ * 3 cycles per loop: 700 loops @ 48 Mhz ~= 44 us
++ */
++ CPUdelay(700);
++}
++
++/*
++ * ======== Board_wakeUpExtFlash ========
++ */
++void Board_wakeUpExtFlash(void)
++{
++ PIN_Config extFlashPinTable[] = {
++ /* SPI Flash CS */
++ IOID_20 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ PIN_TERMINATE
++ };
++ PIN_State extFlashPinState;
++ PIN_Handle extFlashPinHandle = PIN_open(&extFlashPinState, extFlashPinTable);
++
++ /*
++ * To wake up we need to toggle the chip select at
++ * least 20 ns and ten wait at least 35 us.
++ */
++
++ /* Toggle chip select for ~20ns to wake ext. flash */
++ PIN_setOutputValue(extFlashPinHandle, IOID_20, 0);
++ /* 3 cycles per loop: 1 loop @ 48 Mhz ~= 62 ns */
++ CPUdelay(1);
++ PIN_setOutputValue(extFlashPinHandle, IOID_20, 1);
++ /* 3 cycles per loop: 560 loops @ 48 Mhz ~= 35 us */
++ CPUdelay(560);
++
++ PIN_close(extFlashPinHandle);
++}
++
++/*
++ * ======== Board_shutDownExtFlash ========
++ */
++void Board_shutDownExtFlash(void)
++{
++ /*
++ * To be sure we are putting the flash into sleep and not waking it,
++ * we first have to make a wake up call
++ */
++ Board_wakeUpExtFlash();
++
++ PIN_Config extFlashPinTable[] = {
++ /* SPI Flash CS*/
++ IOID_20 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash CLK */
++ IOID_10 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash MOSI */
++ IOID_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL |
++ PIN_INPUT_DIS | PIN_DRVSTR_MED,
++ /* SPI Flash MISO */
++ IOID_8 | PIN_INPUT_EN | PIN_PULLDOWN,
++ PIN_TERMINATE
++ };
++ PIN_State extFlashPinState;
++ PIN_Handle extFlashPinHandle = PIN_open(&extFlashPinState, extFlashPinTable);
++
++ uint8_t extFlashShutdown = 0xB9;
++
++ Board_sendExtFlashByte(extFlashPinHandle, extFlashShutdown);
++
++ PIN_close(extFlashPinHandle);
++}
++
++
++#include
++
++/*
++ * ======== Board_initHook ========
++ * Perform any board-specific initialization needed at startup. This
++ * function is declared weak to allow applications to override it if needed.
++ */
++void __attribute__((weak)) Board_initHook(void)
++{
++}
++
++/*
++ * ======== Board_init ========
++ * Perform any initialization needed before using any board APIs
++ */
++void Board_init(void)
++{
++ /* ==== /ti/drivers/Power initialization ==== */
++ Power_init();
++
++ /* ==== /ti/devices/CCFGTemplate initialization ==== */
++
++ /* ==== /ti/drivers/PIN initialization ==== */
++ if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
++ /* Error with PIN_init */
++ while (1);
++ }
++ /* ==== /ti/drivers/RF initialization ==== */
++
++
++ Board_shutDownExtFlash();
++
++ Board_initHook();
++}
++
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+new file mode 100644
+index 0000000..abf128f
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_drivers_config.h
+@@ -0,0 +1,283 @@
++/*
++ * ======== ti_drivers_config.h ========
++ * Configured TI-Drivers module declarations
++ *
++ * The macros defines herein are intended for use by applications which
++ * directly include this header. These macros should NOT be hard coded or
++ * copied into library source code.
++ *
++ * Symbols declared as const are intended for use with libraries.
++ * Library source code must extern the correct symbol--which is resolved
++ * when the application is linked.
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P_2_LAUNCHXL
++ * by the SysConfig tool.
++ */
++#ifndef ti_drivers_config_h
++#define ti_drivers_config_h
++
++#define CONFIG_SYSCONFIG_PREVIEW
++
++#define CONFIG_CC1352P_2_LAUNCHXL
++#ifndef DeviceFamily_CC13X2
++#define DeviceFamily_CC13X2
++#endif
++
++#include
++
++#include
++
++/* support C++ sources */
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/*
++ * ======== CCFG ========
++ */
++
++
++/*
++ * ======== AESCBC ========
++ */
++
++extern const uint_least8_t CONFIG_AESCBC_0_CONST;
++#define CONFIG_AESCBC_0 0
++#define CONFIG_TI_DRIVERS_AESCBC_COUNT 1
++
++
++/*
++ * ======== AESCCM ========
++ */
++
++extern const uint_least8_t CONFIG_AESCCM_0_CONST;
++#define CONFIG_AESCCM_0 0
++#define CONFIG_TI_DRIVERS_AESCCM_COUNT 1
++
++
++/*
++ * ======== AESECB ========
++ */
++
++extern const uint_least8_t CONFIG_AESECB_0_CONST;
++#define CONFIG_AESECB_0 0
++#define CONFIG_TI_DRIVERS_AESECB_COUNT 1
++
++
++/*
++ * ======== ECDH ========
++ */
++
++extern const uint_least8_t CONFIG_ECDH_0_CONST;
++#define CONFIG_ECDH_0 0
++#define CONFIG_TI_DRIVERS_ECDH_COUNT 1
++
++
++/*
++ * ======== ECDSA ========
++ */
++
++extern const uint_least8_t CONFIG_ECDSA_0_CONST;
++#define CONFIG_ECDSA_0 0
++#define CONFIG_TI_DRIVERS_ECDSA_COUNT 1
++
++
++/*
++ * ======== ECJPAKE ========
++ */
++
++extern const uint_least8_t CONFIG_ECJPAKE_0_CONST;
++#define CONFIG_ECJPAKE_0 0
++#define CONFIG_TI_DRIVERS_ECJPAKE_COUNT 1
++
++
++/*
++ * ======== GPIO ========
++ */
++
++/* DIO15, LaunchPad Button BTN-1 (Left) */
++extern const uint_least8_t CONFIG_GPIO_BTN1_CONST;
++#define CONFIG_GPIO_BTN1 0
++/* DIO14, LaunchPad Button BTN-2 (Right) */
++extern const uint_least8_t CONFIG_GPIO_BTN2_CONST;
++#define CONFIG_GPIO_BTN2 1
++/* DIO6, LaunchPad LED Red */
++extern const uint_least8_t CONFIG_GPIO_RLED_CONST;
++#define CONFIG_GPIO_RLED 2
++/* DIO7, LaunchPad LED Green */
++extern const uint_least8_t CONFIG_GPIO_GLED_CONST;
++#define CONFIG_GPIO_GLED 3
++/* DIO20, MX25R8035F SPI Flash Slave Select */
++extern const uint_least8_t CONFIG_GPIO_0_CONST;
++#define CONFIG_GPIO_0 4
++#define CONFIG_TI_DRIVERS_GPIO_COUNT 5
++
++/* LEDs are active high */
++#define CONFIG_GPIO_LED_ON (1)
++#define CONFIG_GPIO_LED_OFF (0)
++
++#define CONFIG_LED_ON (CONFIG_GPIO_LED_ON)
++#define CONFIG_LED_OFF (CONFIG_GPIO_LED_OFF)
++
++
++/*
++ * ======== NVS ========
++ */
++
++extern const uint_least8_t CONFIG_NVSINTERNAL_CONST;
++#define CONFIG_NVSINTERNAL 0
++/*
++ * MOSI: DIO9
++ * MISO: DIO8
++ * SCLK: DIO10
++ * LaunchPad SPI Bus
++ * SS: DIO20, MX25R8035F SPI Flash Slave Select
++ */
++extern const uint_least8_t CONFIG_NVSEXTERNAL_CONST;
++#define CONFIG_NVSEXTERNAL 1
++#define CONFIG_TI_DRIVERS_NVS_COUNT 2
++
++
++/*
++ * ======== PIN ========
++ */
++#include
++
++extern const PIN_Config BoardGpioInitTable[];
++
++/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART TX, (DIO13) */
++#define CONFIG_PIN_UART_TX 0x0000000d
++/* XDS110 UART, Parent Signal: CONFIG_DISPLAY_UART RX, (DIO12) */
++#define CONFIG_PIN_UART_RX 0x0000000c
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 0, (DIO28) */
++// #define CONFIG_RF_24GHZ 0x0000001c
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 1, (DIO29) */
++// #define CONFIG_RF_HIGH_PA 0x0000001d
++/* SKY13317-373LF RF Antenna Switch, Parent Signal: /ti/drivers/RF RF Antenna Pin 2, (DIO30) */
++#define CONFIG_RF_SUB1GHZ 0x0000001e
++/* LaunchPad Button BTN-1 (Left), Parent Signal: CONFIG_GPIO_BTN1 GPIO Pin, (DIO15) */
++#define CONFIG_PIN_BTN1 0x0000000f
++/* LaunchPad Button BTN-2 (Right), Parent Signal: CONFIG_GPIO_BTN2 GPIO Pin, (DIO14) */
++#define CONFIG_PIN_BTN2 0x0000000e
++/* LaunchPad LED Red, Parent Signal: CONFIG_GPIO_RLED GPIO Pin, (DIO6) */
++#define CONFIG_PIN_RLED 0x00000006
++/* LaunchPad LED Green, Parent Signal: CONFIG_GPIO_GLED GPIO Pin, (DIO7) */
++#define CONFIG_PIN_GLED 0x00000007
++/* MX25R8035F SPI Flash Slave Select, Parent Signal: CONFIG_GPIO_0 GPIO Pin, (DIO20) */
++#define CONFIG_PIN_0 0x00000014
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 SCLK, (DIO10) */
++#define CONFIG_PIN_SPI_SCLK 0x0000000a
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MISO, (DIO8) */
++#define CONFIG_PIN_SPI_MISO 0x00000008
++/* LaunchPad SPI Bus, Parent Signal: CONFIG_SPI_0 MOSI, (DIO9) */
++#define CONFIG_PIN_SPI_MOSI 0x00000009
++#define CONFIG_TI_DRIVERS_PIN_COUNT 13
++
++
++/*
++ * ======== RF ========
++ */
++#define Board_DIO_30_RFSW 0x0000001e
++
++
++/*
++ * ======== SHA2 ========
++ */
++
++extern const uint_least8_t CONFIG_SHA2_0_CONST;
++#define CONFIG_SHA2_0 0
++#define CONFIG_TI_DRIVERS_SHA2_COUNT 1
++
++
++/*
++ * ======== SPI ========
++ */
++
++/*
++ * MOSI: DIO9
++ * MISO: DIO8
++ * SCLK: DIO10
++ * LaunchPad SPI Bus
++ */
++extern const uint_least8_t CONFIG_SPI_0_CONST;
++#define CONFIG_SPI_0 0
++#define CONFIG_TI_DRIVERS_SPI_COUNT 1
++
++
++/*
++ * ======== TRNG ========
++ */
++
++extern const uint_least8_t CONFIG_TRNG_0_CONST;
++#define CONFIG_TRNG_0 0
++#define CONFIG_TI_DRIVERS_TRNG_COUNT 1
++
++
++/*
++ * ======== UART ========
++ */
++
++/*
++ * TX: DIO13
++ * RX: DIO12
++ * XDS110 UART
++ */
++extern const uint_least8_t CONFIG_DISPLAY_UART_CONST;
++#define CONFIG_DISPLAY_UART 0
++#define CONFIG_TI_DRIVERS_UART_COUNT 1
++
++
++/*
++ * ======== Button ========
++ */
++
++/* DIO15, LaunchPad Button BTN-1 (Left) */
++extern const uint_least8_t CONFIG_BTN_LEFT_CONST;
++#define CONFIG_BTN_LEFT 0
++/* DIO14, LaunchPad Button BTN-2 (Right) */
++extern const uint_least8_t CONFIG_BTN_RIGHT_CONST;
++#define CONFIG_BTN_RIGHT 1
++#define CONFIG_TI_DRIVERS_BUTTON_COUNT 2
++
++
++/*
++ * ======== LED ========
++ */
++
++/* DIO6, LaunchPad LED Red */
++extern const uint_least8_t CONFIG_LED_RED_CONST;
++#define CONFIG_LED_RED 0
++/* DIO7, LaunchPad LED Green */
++extern const uint_least8_t CONFIG_LED_GREEN_CONST;
++#define CONFIG_LED_GREEN 1
++#define CONFIG_TI_DRIVERS_LED_COUNT 2
++
++
++/*
++ * ======== Board_init ========
++ * Perform all required TI-Drivers initialization
++ *
++ * This function should be called once at a point before any use of
++ * TI-Drivers.
++ */
++extern void Board_init(void);
++
++/*
++ * ======== Board_initGeneral ========
++ * (deprecated)
++ *
++ * Board_initGeneral() is defined purely for backward compatibility.
++ *
++ * All new code should use Board_init() to do any required TI-Drivers
++ * initialization _and_ use _init() for only where specific drivers
++ * are explicitly referenced by the application. _init() functions
++ * are idempotent.
++ */
++#define Board_initGeneral Board_init
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* include guard */
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+new file mode 100644
+index 0000000..ac1e16f
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.c
+@@ -0,0 +1,340 @@
++/*
++ * ======== ti_radio_config.c ========
++ * Configured RadioConfig module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ
++ * by the SysConfig tool.
++ *
++ * Radio Config module version : 1.8
++ * SmartRF Studio data version : 2.20.0
++ */
++
++#include
++#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
++#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
++#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
++#include
++#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h)
++#include "ti_radio_config.h"
++
++
++// *********************************************************************************
++// RF Frontend configuration
++// *********************************************************************************
++// RF design based on: LAUNCHXL-CC1352P-2 (CC1352PEM-XD4251-XD24-PA24_10dBm)
++
++// TX Power tables
++// The RF_TxPowerTable_DEFAULT_PA_ENTRY and RF_TxPowerTable_HIGH_PA_ENTRY macros are defined in RF.h.
++// The following arguments are required:
++// RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost, coefficient)
++// RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
++// See the Technical Reference Manual for further details about the "txPower" Command field.
++// The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
++
++// 868 MHz, 13 dBm
++RF_TxPowerTable_Entry txPowerTable_868_pa13[TXPOWERTABLE_868_PA13_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 3) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 5) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 8) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 9) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 10) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 11) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 14) },
++ {6, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 3, 0, 16) },
++ {7, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 19) },
++ {8, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 3, 0, 22) },
++ {9, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 3, 0, 31) },
++ {10, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 2, 0, 31) },
++ {11, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 2, 0, 51) },
++ {12, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 0, 0, 82) },
++ // The original PA value (12.5 dBm) has been rounded to an integer value.
++ {13, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 0, 89) },
++ // This setting requires CCFG_FORCE_VDDR_HH = 1.
++ {14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++
++// 2400 MHz, 5 dBm
++RF_TxPowerTable_Entry txPowerTable_2400_pa5[TXPOWERTABLE_2400_PA5_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) },
++ {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) },
++ {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) },
++ {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) },
++ {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) },
++ {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++// 2400 MHz, 5 + 20 dBm
++RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[TXPOWERTABLE_2400_PA5_20_SIZE] =
++{
++ {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) },
++ {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) },
++ {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) },
++ {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) },
++ {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) },
++ {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) },
++ {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) },
++ {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) },
++ {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) },
++ {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) },
++ {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) },
++ {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) },
++ {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) },
++ {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) },
++ {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) },
++ {14, RF_TxPowerTable_HIGH_PA_ENTRY(22, 3, 1, 19, 27) },
++ {15, RF_TxPowerTable_HIGH_PA_ENTRY(26, 3, 1, 23, 27) },
++ {16, RF_TxPowerTable_HIGH_PA_ENTRY(30, 3, 1, 28, 27) },
++ {17, RF_TxPowerTable_HIGH_PA_ENTRY(37, 3, 1, 39, 27) },
++ {18, RF_TxPowerTable_HIGH_PA_ENTRY(32, 3, 1, 35, 48) },
++ {19, RF_TxPowerTable_HIGH_PA_ENTRY(34, 3, 1, 48, 63) },
++ {20, RF_TxPowerTable_HIGH_PA_ENTRY(53, 3, 1, 58, 63) },
++ RF_TxPowerTable_TERMINATION_ENTRY
++};
++
++
++
++//*********************************************************************************
++// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8
++//
++// PHY: ieee154
++// Setting file: setting_ieee_802_15_4.json
++//*********************************************************************************
++
++// PARAMETER SUMMARY
++// Channel - Frequency (MHz): 2405
++// TX Power (dBm): 5
++
++// TI-RTOS RF Mode Object
++RF_Mode RF_prop_ieee154 =
++{
++ .rfMode = RF_MODE_AUTO,
++ .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4,
++ .mcePatchFxn = 0,
++ .rfePatchFxn = 0
++};
++
++// Overrides for CMD_RADIO_SETUP_PA
++uint32_t pOverrides_ieee154[] =
++{
++ // override_ieee_802_15_4.json
++ // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0)
++ (uint32_t)0x000F8883,
++ // Tx: Set DCDC settings IPEAK=3, dither = off
++ (uint32_t)0x00F388D3,
++ (uint32_t)0xFFFFFFFF
++};
++
++
++
++// CMD_RADIO_SETUP_PA
++// Radio Setup Command for Pre-Defined Schemes
++const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154 =
++{
++ .commandNo = 0x0802,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .mode = 0x01,
++ .loDivider = 0x00,
++ .config.frontEndMode = 0x0,
++ .config.biasMode = 0x1,
++ .config.analogCfgMode = 0x0,
++ .config.bNoFsPowerUp = 0x0,
++ .txPower = 0x7217,
++ .pRegOverride = pOverrides_ieee154,
++ .pRegOverrideTxStd = 0,
++ .pRegOverrideTx20 = 0
++};
++
++// CMD_FS
++// Frequency Synthesizer Programming Command
++const rfc_CMD_FS_t RF_cmdFs_ieee154 =
++{
++ .commandNo = 0x0803,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .frequency = 0x0965,
++ .fractFreq = 0x0000,
++ .synthConf.bTxMode = 0x0,
++ .synthConf.refFreq = 0x0,
++ .__dummy0 = 0x00,
++ .__dummy1 = 0x00,
++ .__dummy2 = 0x00,
++ .__dummy3 = 0x0000
++};
++
++// CMD_IEEE_TX
++// IEEE 802.15.4 Transmit Command
++const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154 =
++{
++ .commandNo = 0x2C01,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .txOpt.bIncludePhyHdr = 0x0,
++ .txOpt.bIncludeCrc = 0x0,
++ .txOpt.payloadLenMsb = 0x0,
++ .payloadLen = 0x1E,
++ .pPayload = 0,
++ .timeStamp = 0x00000000
++};
++
++// CMD_IEEE_RX
++// IEEE 802.15.4 Receive Command
++const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154 =
++{
++ .commandNo = 0x2801,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x1,
++ .condition.nSkip = 0x0,
++ .channel = 0x00,
++ .rxConfig.bAutoFlushCrc = 0x0,
++ .rxConfig.bAutoFlushIgn = 0x0,
++ .rxConfig.bIncludePhyHdr = 0x0,
++ .rxConfig.bIncludeCrc = 0x0,
++ .rxConfig.bAppendRssi = 0x1,
++ .rxConfig.bAppendCorrCrc = 0x1,
++ .rxConfig.bAppendSrcInd = 0x0,
++ .rxConfig.bAppendTimestamp = 0x0,
++ .pRxQ = 0,
++ .pOutput = 0,
++ .frameFiltOpt.frameFiltEn = 0x0,
++ .frameFiltOpt.frameFiltStop = 0x0,
++ .frameFiltOpt.autoAckEn = 0x0,
++ .frameFiltOpt.slottedAckEn = 0x0,
++ .frameFiltOpt.autoPendEn = 0x0,
++ .frameFiltOpt.defaultPend = 0x0,
++ .frameFiltOpt.bPendDataReqOnly = 0x0,
++ .frameFiltOpt.bPanCoord = 0x0,
++ .frameFiltOpt.maxFrameVersion = 0x3,
++ .frameFiltOpt.fcfReservedMask = 0x0,
++ .frameFiltOpt.modifyFtFilter = 0x0,
++ .frameFiltOpt.bStrictLenFilter = 0x0,
++ .frameTypes.bAcceptFt0Beacon = 0x1,
++ .frameTypes.bAcceptFt1Data = 0x1,
++ .frameTypes.bAcceptFt2Ack = 0x1,
++ .frameTypes.bAcceptFt3MacCmd = 0x1,
++ .frameTypes.bAcceptFt4Reserved = 0x1,
++ .frameTypes.bAcceptFt5Reserved = 0x1,
++ .frameTypes.bAcceptFt6Reserved = 0x1,
++ .frameTypes.bAcceptFt7Reserved = 0x1,
++ .ccaOpt.ccaEnEnergy = 0x0,
++ .ccaOpt.ccaEnCorr = 0x0,
++ .ccaOpt.ccaEnSync = 0x0,
++ .ccaOpt.ccaCorrOp = 0x1,
++ .ccaOpt.ccaSyncOp = 0x1,
++ .ccaOpt.ccaCorrThr = 0x0,
++ .ccaRssiThr = 0x64,
++ .__dummy0 = 0x00,
++ .numExtEntries = 0x00,
++ .numShortEntries = 0x00,
++ .pExtEntryList = 0,
++ .pShortEntryList = 0,
++ .localExtAddr = 0x12345678,
++ .localShortAddr = 0xABBA,
++ .localPanID = 0x0000,
++ .__dummy1 = 0x000000,
++ .endTrigger.triggerType = 0x1,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .endTime = 0x00000000
++};
++
++// CMD_IEEE_CSMA
++// IEEE 802.15.4 CSMA-CA Command
++const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154 =
++{
++ .commandNo = 0x2C02,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x0,
++ .condition.nSkip = 0x0,
++ .randomState = 0x0000,
++ .macMaxBE = 0x00,
++ .macMaxCSMABackoffs = 0x00,
++ .csmaConfig.initCW = 0x0,
++ .csmaConfig.bSlotted = 0x0,
++ .csmaConfig.rxOffMode = 0x0,
++ .NB = 0x00,
++ .BE = 0x00,
++ .remainingPeriods = 0x00,
++ .lastRssi = 0x00,
++ .endTrigger.triggerType = 0x0,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .lastTimeStamp = 0x00000000,
++ .endTime = 0x00000000
++};
++
++// CMD_IEEE_RX_ACK
++// IEEE 802.15.4 Receive Acknowledgement Command
++const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154 =
++{
++ .commandNo = 0x2C03,
++ .status = 0x0000,
++ .pNextOp = 0,
++ .startTime = 0x00000000,
++ .startTrigger.triggerType = 0x0,
++ .startTrigger.bEnaCmd = 0x0,
++ .startTrigger.triggerNo = 0x0,
++ .startTrigger.pastTrig = 0x0,
++ .condition.rule = 0x0,
++ .condition.nSkip = 0x0,
++ .seqNo = 0x00,
++ .endTrigger.triggerType = 0x0,
++ .endTrigger.bEnaCmd = 0x0,
++ .endTrigger.triggerNo = 0x0,
++ .endTrigger.pastTrig = 0x0,
++ .endTime = 0x00000000
++};
++
++
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+new file mode 100644
+index 0000000..1e63c91
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_radio_config.h
+@@ -0,0 +1,77 @@
++/*
++ * ======== ti_radio_config.h ========
++ * Configured RadioConfig module definitions
++ *
++ * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ
++ * by the SysConfig tool.
++ *
++ * Radio Config module version : 1.8
++ * SmartRF Studio data version : 2.20.0
++ */
++#ifndef _TI_RADIO_CONFIG_H_
++#define _TI_RADIO_CONFIG_H_
++
++#include
++#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
++#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h)
++#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h)
++#include
++
++// *********************************************************************************
++// RF Frontend configuration
++// *********************************************************************************
++// RF design based on: LAUNCHXL-CC1352P-2 (CC1352PEM-XD4251-XD24-PA24_10dBm)
++#define LAUNCHXL_CC1352P_2
++
++// High-Power Amplifier supported
++#define SUPPORT_HIGH_PA
++
++// RF frontend configuration
++#define FRONTEND_SUB1G_DIFF_RF
++#define FRONTEND_SUB1G_EXT_BIAS
++#define FRONTEND_24G_DIFF_RF
++#define FRONTEND_24G_EXT_BIAS
++
++// Supported frequency bands
++#define SUPPORT_FREQBAND_868
++#define SUPPORT_FREQBAND_2400
++
++// TX power table size definitions
++#define TXPOWERTABLE_868_PA13_SIZE 20 // 868 MHz, 13 dBm
++#define TXPOWERTABLE_2400_PA5_SIZE 16 // 2400 MHz, 5 dBm
++#define TXPOWERTABLE_2400_PA5_20_SIZE 23 // 2400 MHz, 5 + 20 dBm
++
++// TX power tables
++extern RF_TxPowerTable_Entry txPowerTable_868_pa13[]; // 868 MHz, 13 dBm
++extern RF_TxPowerTable_Entry txPowerTable_2400_pa5[]; // 2400 MHz, 5 dBm
++extern RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[]; // 2400 MHz, 5 + 20 dBm
++
++
++
++//*********************************************************************************
++// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8
++//
++// PHY: ieee154
++// Setting file: setting_ieee_802_15_4.json
++//*********************************************************************************
++
++// PA table usage
++#define TX_POWER_TABLE_SIZE_ieee154 TXPOWERTABLE_2400_PA5_SIZE
++
++#define txPowerTable_ieee154 txPowerTable_2400_pa5
++
++// TI-RTOS RF Mode object
++extern RF_Mode RF_prop_ieee154;
++
++// RF Core API commands
++extern const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154;
++extern const rfc_CMD_FS_t RF_cmdFs_ieee154;
++extern const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154;
++extern const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154;
++extern const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154;
++extern const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154;
++
++// RF Core API overrides
++extern uint32_t pOverrides_ieee154[];
++
++#endif // _TI_RADIO_CONFIG_H_
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+new file mode 100644
+index 0000000..4ce34a6
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_utils_build_linker.cmd.genlibs
+@@ -0,0 +1,35 @@
++/*
++ * ======== ti_utils_build_linker.cmd.genlibs ========
++ * Libraries needed to link this application's configuration
++ *
++ * NOTE, this feature requires software components configured in your
++ * system to correctly indicate their dependencies and report the
++ * libraries needed for your specific configuration. If you find
++ * errors, please report them on TI's E2E forums
++ * (https://e2e.ti.com/) so they can be addressed in a future
++ * release.
++ *
++ * This file allows one to portably link applications that use SysConfig
++ * _without_ having to make changes to build rules when moving to a new
++ * device OR when upgrading to a new version of a SysConfig enabled
++ * product.
++ *
++ * DO NOT EDIT - This file is generated by the SysConfig tool for the
++ * TI C/C++ toolchain
++ */
++
++/* libraries required for /third_party/spiffs */
++-l"third_party/spiffs/lib/ccs/m4f/spiffs.a"
++
++/* libraries required for /ti/drivers/RF */
++-l"ti/drivers/rf/lib/rf_multiMode_cc13x2.aem4f"
++
++/* libraries required for /ti/drivers */
++-l"ti/drivers/lib/ccs/m4f/drivers_cc13x2.a"
++-l"ti/grlib/lib/ccs/m4f/grlib.a"
++-l"ti/dpl/lib/ccs/m4f/dpl_cc13x2.a"
++
++/* libraries required for /ti/zstack */
++-l"ti/ti154stack/library/tirtos/ccs/bin/maclib_nosecure_cc13x2_2_4g.a"
++-l"ti/zstack/lib/ccs/libZStack_nwk_zr_ccs.a"
++
+diff --git a/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
+new file mode 100644
+index 0000000..49ece4c
+--- /dev/null
++++ b/zr_genericapp_CC1352P_2_LAUNCHXL_tirtos_ccs/syscfg/ti_zstack_config.h
+@@ -0,0 +1,226 @@
++/*
++ * Copyright (c) 2018, Texas Instruments Incorporated
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * * Neither the name of Texas Instruments Incorporated nor the names of
++ * its contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
++ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * 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.
++ *
++ */
++
++/*
++ * ti_zstack_config.h
++ *
++ * DO NOT EDIT - This file was generated by the SysConfig tool.
++ *
++ * Macros used to define a TI Z-Stack ZigBee device. New user defined
++ * options may be added to this file, as necessary.
++ *
++ */
++
++#ifndef TI_ZSTACK_CONFIG_H
++#define TI_ZSTACK_CONFIG_H
++
++/* Default (primary) and secondary channel masks. Secondary mask is used when the
++ * default channels fail.
++ * Channels are defined in the following:
++ * 11 - 26 : 2.4 GHz 0x07FFF800
++ */
++#ifndef DEFAULT_CHANLIST
++#define DEFAULT_CHANLIST 0x07fff800
++#endif
++
++#ifndef SECONDARY_CHANLIST
++#define SECONDARY_CHANLIST 0x00000000
++#endif
++
++/* Define the default PAN ID.
++ *
++ * Setting this to a value other than 0xFFFF causes
++ * ZDO_COORD to use this value as its PAN ID and
++ * Routers and end devices to join PAN with this ID
++ */
++#ifndef ZDAPP_CONFIG_PAN_ID
++#define ZDAPP_CONFIG_PAN_ID 0xFFFF
++#endif
++
++/* Specifiy whether to set the EPID to the Extended Address, or to use the
++ * custom Extended Pan ID (EPID) defined by ZDAPP_CONFIG_EPID
++ */
++#ifndef SET_EPID_AS_EXT_ADDR
++#define SET_EPID_AS_EXT_ADDR TRUE
++#endif
++
++/* Define the default Extended Pan ID (EPID)
++ * ZDAPP_CONFIG_EPID is only used if SET_EPID_AS_EXT_ADDR is FALSE. Otherwise,
++ * the EPID is set to the Extended Address.
++ */
++#ifndef ZDAPP_CONFIG_EPID
++#define ZDAPP_CONFIG_EPID {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF}
++#endif
++
++/* in seconds; set to 255 to turn off route expiry */
++#ifndef ROUTE_EXPIRY_TIME
++#define ROUTE_EXPIRY_TIME 30
++#endif
++
++/* Default indirect message holding timeout value:
++ * 1-65535 (0 -> 65536) X CNT_RTG_TIMER X RTG_TIMER_INTERVAL
++ */
++#ifndef NWK_INDIRECT_MSG_TIMEOUT
++#define NWK_INDIRECT_MSG_TIMEOUT 7
++#endif
++
++/* The number of simultaneous route discoveries in network */
++#ifndef MAX_RREQ_ENTRIES
++#define MAX_RREQ_ENTRIES 8
++#endif
++
++/* The maximum number of MAC frame transmission attempts allowed */
++#ifndef ZMAC_MAX_FRAME_RETRIES
++#define ZMAC_MAX_FRAME_RETRIES 3
++#endif
++
++/* Max number of times attempts looking for the next hop address of a message */
++#ifndef NWK_MAX_DATA_RETRIES
++#define NWK_MAX_DATA_RETRIES 2
++#endif
++
++/* The maximum number of times APS frames are retried after not receiving an APS ACK */
++#ifndef APSC_MAX_FRAME_RETRIES
++#define APSC_MAX_FRAME_RETRIES 3
++#endif
++
++/* This number is used by polled devices, since the spec'd formula
++ * doesn't work for sleeping end devices. For non-polled devices,
++ * a formula is used. Value is in 2 milliseconds periods
++ */
++#ifndef APSC_ACK_WAIT_DURATION_POLLED
++#define APSC_ACK_WAIT_DURATION_POLLED 3000
++#endif
++
++/* The maximum number of groups in the groups table */
++#ifndef APS_MAX_GROUPS
++#define APS_MAX_GROUPS 16
++#endif
++
++/* Number of entries in the regular routing table plus additional
++ * entries for route repair
++ */
++#ifndef MAX_RTG_ENTRIES
++#define MAX_RTG_ENTRIES 40
++#endif
++
++/* Maximum number of entries in the Binding table. */
++#ifndef NWK_MAX_BINDING_ENTRIES
++#define NWK_MAX_BINDING_ENTRIES 4
++#endif
++
++/* Default security key. */
++#ifndef DEFAULT_KEY
++#define DEFAULT_KEY {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
++#endif
++
++/* ZigBee Alliance Pre-configured Distributed Link Key (for Distributed networks) */
++#ifndef DISTRIBUTED_GLOBAL_LINK_KEY
++#define DISTRIBUTED_GLOBAL_LINK_KEY {0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF}
++#endif
++
++/* ZigBee Alliance Pre-configured TC Link Key - 'ZigBeeAlliance09' (for Centralized networks) */
++#ifndef DEFAULT_TC_LINK_KEY
++#define DEFAULT_TC_LINK_KEY {0x5a,0x69,0x67,0x42,0x65,0x65,0x41,0x6c,0x6c,0x69,0x61,0x6e,0x63,0x65,0x30,0x39}
++#endif
++
++/* The number of milliseconds to wait between data request polls to the coordinator. */
++#ifndef TXPOWER
++#define TXPOWER 5
++#endif
++
++/****************************************
++ * The following are for End Devices only
++ ***************************************/
++
++/* Determine whether the radio on an End Device is always on */
++#ifndef RFD_RX_ALWAYS_ON_CAPABLE
++#define RFD_RX_ALWAYS_ON_CAPABLE TRUE
++#endif
++
++#ifndef RFD_RX_ALWAYS_ON
++#define RFD_RX_ALWAYS_ON TRUE
++#endif
++
++/* The minimum poll rate. */
++#ifndef MINIMUM_APP_POLL_RATE
++#define MINIMUM_APP_POLL_RATE 100
++#endif
++
++/* The number of milliseconds to wait between data request polls to the coordinator. */
++#ifndef POLL_RATE
++#define POLL_RATE 3000
++#endif
++
++/* This is used after receiving a data indication to poll immediately
++ * for queued messages...in milliseconds.
++ */
++#ifndef QUEUED_POLL_RATE
++#define QUEUED_POLL_RATE 100
++#endif
++
++/* This is used after receiving a data confirmation to poll immediately
++ * for response messages...in milliseconds
++ */
++#ifndef RESPONSE_POLL_RATE
++#define RESPONSE_POLL_RATE 100
++#endif
++
++/* This is used as an alternate response poll rate only for rejoin request.
++ * This rate is determined by the response time of the parent that the device
++ * is trying to join.
++ */
++#ifndef REJOIN_POLL_RATE
++#define REJOIN_POLL_RATE 440
++#endif
++
++/* Maximum number of devices in the Assoc/Device list. */
++#ifndef NWK_MAX_DEVICE_LIST
++#define NWK_MAX_DEVICE_LIST 20
++#endif
++
++/* Total Number of APS keys that a TC can manage. This is equal to the number of devices a ZC can allow to join the network */
++#ifndef ZDSECMGR_TC_DEVICE_MAX
++#define ZDSECMGR_TC_DEVICE_MAX 3
++#endif
++
++/* Value used by end device when sending End Device Timeout Request */
++/* This is an index into table timeoutValue[] defined in nwk_globals.c */
++#ifndef END_DEV_TIMEOUT_VALUE
++#define END_DEV_TIMEOUT_VALUE 8
++#endif
++
++
++
++
++#endif /* TI_ZSTACK_CONFIG_H */
+diff --git a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+index f33fc07..5aad76f 100644
+--- a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
++++ b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+@@ -53,6 +53,8 @@
+ * INCLUDES
+ */
+
++#include
++
+ #include "rom_jt_154.h"
+ #include "zcomdef.h"
+
+@@ -426,7 +428,7 @@ static void zclGenericApp_Init( void )
+ // Call BDB initialization. Should be called once from application at startup to restore
+ // previous network configuration, if applicable.
+ zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- zstack_bdbStartCommissioningReq.commissioning_mode = 0;
++ zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+ Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+ }
+
+@@ -1208,28 +1210,16 @@ static void zclGenericApp_changeKeyCallback(Button_Handle _btn, Button_EventMask
+ */
+ static void zclGenericApp_processKey(Button_Handle _btn)
+ {
+- zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- //Button 1
+- if(_btn == gLeftButtonHandle)
+- {
+- if(ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE)
+- {
++ NLME_LeaveReq_t req;
++ memset( &req, 0, sizeof( NLME_LeaveReq_t ) );
++ NLME_LeaveReq(&req);
++ // Sleep for 2 seconds, otherwise leave request is not send
++ Task_sleep(2000 * (1000 / ClockP_getSystemTickPeriod()));
+
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- else if (ZG_BUILD_JOINING_TYPE && ZG_DEVICE_JOINING_TYPE)
+- {
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- }
+- //Button 2
+- if(_btn == gRightButtonHandle)
+- {
+- Zstackapi_bdbResetLocalActionReq(appServiceTaskId);
+- }
++ zgWriteStartupOptions( ZG_STARTUP_SET,
++ ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE);
+
++ SysCtrlSystemReset();
+ }
+
+
+diff --git a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+index c0e473d..a09a0df 100644
+--- a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
++++ b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+@@ -96,6 +96,8 @@ const uint16_t zclGenericApp_identify_clusterRevision = 0x0001;
+ const uint8_t zclGenericApp_HWRevision = GENERICAPP_HWVERSION;
+ const uint8_t zclGenericApp_ZCLVersion = GENERICAPP_ZCLVERSION;
+ const uint8_t zclGenericApp_ManufacturerName[] = { 16, 'T','e','x','a','s','I','n','s','t','r','u','m','e','n','t','s' };
++const uint8_t zclGenericApp_ModelID[] = { 9, 't','i','.','r','o','u','t','e','r' };
++const uint8_t zclGenericApp_SwBuildID[] = { 8, '2','0','2','1','0','1','2','8' };
+ const uint8_t zclGenericApp_PowerSource = POWER_SOURCE_MAINS_1_PHASE;
+ uint8_t zclGenericApp_PhysicalEnvironment = PHY_UNSPECIFIED_ENV;
+
+@@ -143,10 +145,28 @@ CONST zclAttrRec_t zclGenericApp_Attrs[] =
+ { // Attribute record
+ ATTRID_BASIC_ZCL_VERSION,
+ ZCL_DATATYPE_UINT8,
+- ACCESS_CONTROL_READ,
++ ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
+ (void *)&zclGenericApp_ZCLVersion
+ }
+ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_MODEL_IDENTIFIER,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_ModelID
++ }
++ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_SW_BUILD_ID,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_SwBuildID
++ }
++ },
+ {
+ ZCL_CLUSTER_ID_GENERAL_BASIC,
+ { // Attribute record
+diff --git a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+index b841d60..598f537 100644
+--- a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
++++ b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+@@ -9,3 +9,5 @@
+ -DADDRMGR_NV_SINGLES
+ -DBINDINGTABLE_NV_SINGLES
+ -DASSOCLIST_NV_SINGLES
++
++--preinclude=preinclude.h
+\ No newline at end of file
+diff --git a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+new file mode 100644
+index 0000000..471eeb2
+--- /dev/null
++++ b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+@@ -0,0 +1,6 @@
++#define ZCL_REPORT_DESTINATION_DEVICE
++#define BDB_REPORTING
++#define CUI_DISABLE
++#define NWK_MAX_DEVICE_LIST 50
++#define MAX_NEIGHBOR_ENTRIES 30
++#define MAX_RTG_ENTRIES 100
+diff --git a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
+index 538a31c..439ade0 100644
+--- a/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
++++ b/zr_genericapp_CC2652RB_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
+@@ -50,6 +50,7 @@ CCFG.enableBootloaderBackdoor = true;
+ CCFG.dioBootloaderBackdoor = 13;
+ CCFG.levelBootloaderBackdoor = "Active low";
+ CCFG.srcClkLF = "Derived from HF XOSC";
++CCFG.enableDCDC = false;
+ CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0";
+
+ AESCBC1.$name = "CONFIG_AESCBC_0";
+@@ -127,6 +128,8 @@ zstack.deviceTypeReadOnly = true;
+ zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
+ zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
+ zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
++zstack.rf.primaryChannels = [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26];
++zstack.rf.txPower = "5";
+ zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
+ zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
+ zstack.network.$name = "ti_zstack_network_zstack_network0";
+diff --git a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+index f33fc07..5aad76f 100644
+--- a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
++++ b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp.c
+@@ -53,6 +53,8 @@
+ * INCLUDES
+ */
+
++#include
++
+ #include "rom_jt_154.h"
+ #include "zcomdef.h"
+
+@@ -426,7 +428,7 @@ static void zclGenericApp_Init( void )
+ // Call BDB initialization. Should be called once from application at startup to restore
+ // previous network configuration, if applicable.
+ zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- zstack_bdbStartCommissioningReq.commissioning_mode = 0;
++ zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+ Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+ }
+
+@@ -1208,28 +1210,16 @@ static void zclGenericApp_changeKeyCallback(Button_Handle _btn, Button_EventMask
+ */
+ static void zclGenericApp_processKey(Button_Handle _btn)
+ {
+- zstack_bdbStartCommissioningReq_t zstack_bdbStartCommissioningReq;
+- //Button 1
+- if(_btn == gLeftButtonHandle)
+- {
+- if(ZG_BUILD_COORDINATOR_TYPE && ZG_DEVICE_COORDINATOR_TYPE)
+- {
++ NLME_LeaveReq_t req;
++ memset( &req, 0, sizeof( NLME_LeaveReq_t ) );
++ NLME_LeaveReq(&req);
++ // Sleep for 2 seconds, otherwise leave request is not send
++ Task_sleep(2000 * (1000 / ClockP_getSystemTickPeriod()));
+
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- else if (ZG_BUILD_JOINING_TYPE && ZG_DEVICE_JOINING_TYPE)
+- {
+- zstack_bdbStartCommissioningReq.commissioning_mode = BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING;
+- Zstackapi_bdbStartCommissioningReq(appServiceTaskId,&zstack_bdbStartCommissioningReq);
+- }
+- }
+- //Button 2
+- if(_btn == gRightButtonHandle)
+- {
+- Zstackapi_bdbResetLocalActionReq(appServiceTaskId);
+- }
++ zgWriteStartupOptions( ZG_STARTUP_SET,
++ ZCD_STARTOPT_DEFAULT_NETWORK_STATE | ZCD_STARTOPT_DEFAULT_CONFIG_STATE);
+
++ SysCtrlSystemReset();
+ }
+
+
+diff --git a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+index c0e473d..a09a0df 100644
+--- a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
++++ b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Application/zcl_genericapp_data.c
+@@ -96,6 +96,8 @@ const uint16_t zclGenericApp_identify_clusterRevision = 0x0001;
+ const uint8_t zclGenericApp_HWRevision = GENERICAPP_HWVERSION;
+ const uint8_t zclGenericApp_ZCLVersion = GENERICAPP_ZCLVERSION;
+ const uint8_t zclGenericApp_ManufacturerName[] = { 16, 'T','e','x','a','s','I','n','s','t','r','u','m','e','n','t','s' };
++const uint8_t zclGenericApp_ModelID[] = { 9, 't','i','.','r','o','u','t','e','r' };
++const uint8_t zclGenericApp_SwBuildID[] = { 8, '2','0','2','1','0','1','2','8' };
+ const uint8_t zclGenericApp_PowerSource = POWER_SOURCE_MAINS_1_PHASE;
+ uint8_t zclGenericApp_PhysicalEnvironment = PHY_UNSPECIFIED_ENV;
+
+@@ -143,10 +145,28 @@ CONST zclAttrRec_t zclGenericApp_Attrs[] =
+ { // Attribute record
+ ATTRID_BASIC_ZCL_VERSION,
+ ZCL_DATATYPE_UINT8,
+- ACCESS_CONTROL_READ,
++ ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
+ (void *)&zclGenericApp_ZCLVersion
+ }
+ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_MODEL_IDENTIFIER,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_ModelID
++ }
++ },
++ {
++ ZCL_CLUSTER_ID_GENERAL_BASIC,
++ { // Attribute record
++ ATTRID_BASIC_SW_BUILD_ID,
++ ZCL_DATATYPE_CHAR_STR,
++ ACCESS_CONTROL_READ,
++ (void *)zclGenericApp_SwBuildID
++ }
++ },
+ {
+ ZCL_CLUSTER_ID_GENERAL_BASIC,
+ { // Attribute record
+diff --git a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+index b841d60..598f537 100644
+--- a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
++++ b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/f8wrouter.opts
+@@ -9,3 +9,5 @@
+ -DADDRMGR_NV_SINGLES
+ -DBINDINGTABLE_NV_SINGLES
+ -DASSOCLIST_NV_SINGLES
++
++--preinclude=preinclude.h
+\ No newline at end of file
+diff --git a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+new file mode 100644
+index 0000000..471eeb2
+--- /dev/null
++++ b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/Stack/Config/preinclude.h
+@@ -0,0 +1,6 @@
++#define ZCL_REPORT_DESTINATION_DEVICE
++#define BDB_REPORTING
++#define CUI_DISABLE
++#define NWK_MAX_DEVICE_LIST 50
++#define MAX_NEIGHBOR_ENTRIES 30
++#define MAX_RTG_ENTRIES 100
+diff --git a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
+index e95d4ec..91c1400 100644
+--- a/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
++++ b/zr_genericapp_CC26X2R1_LAUNCHXL_tirtos_ccs/zr_genericapp.syscfg
+@@ -49,6 +49,7 @@ CCFG.enableBootloader = true;
+ CCFG.enableBootloaderBackdoor = true;
+ CCFG.dioBootloaderBackdoor = 13;
+ CCFG.levelBootloaderBackdoor = "Active low";
++CCFG.enableDCDC = false;
+ CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0";
+
+ AESCBC1.$name = "CONFIG_AESCBC_0";
+@@ -126,6 +127,8 @@ zstack.deviceTypeReadOnly = true;
+ zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0";
+ zstack.pm.$name = "ti_zstack_pm_zstack_pm0";
+ zstack.rf.$name = "ti_zstack_rf_zstack_rf0";
++zstack.rf.txPower = "5";
++zstack.rf.primaryChannels = [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26];
+ zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40";
+ zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0";
+ zstack.network.$name = "ti_zstack_network_zstack_network0";
+--
+2.24.3 (Apple Git-128)
+
diff --git a/router/README.md b/router/Z-Stack_Home_1.2/README.md
similarity index 62%
rename from router/README.md
rename to router/Z-Stack_Home_1.2/README.md
index 07f6324..b23935b 100644
--- a/router/README.md
+++ b/router/Z-Stack_Home_1.2/README.md
@@ -1,19 +1,22 @@
-# Buttons
+# Z-Stack_Home 1.2 router firmware
+Firmwares have been taken from: https://ptvo.info/ , no sources and compilation instructions are available. Credits go to [ptvoinfo](https://github.com/ptvoinfo).
-* S1 button: only changes the state of the green LED.
+## Buttons
+
+* S1 button: only changes the state of the green LED.
* S2 button: repairs CC2531 (see below)
-# Lights
+## Lights
* Short fast blinks (one per second) – the router is connecting to a network.
* Short long blinks (one per 4 seconds) – normal operations.
* Three short blinks – the router cannot send a report to a coordinator.
-# Pairing
+## Pairing
Flash firmware and permit joining to a network on your coordinator.
-# Re-pairing
+## Re-pairing
* CC2530, CC2531: Power on, wait 2 seconds, power off, repeat this cycle three times.
* CC2531: Power on, press and hold down the S2 button for 5 seconds.
diff --git a/router/CC2530_CC2591/bin/CC2530_CC2591_router_2020_09_29.zip b/router/Z-Stack_Home_1.2/bin/CC2530_CC2591_router_2020_09_29.zip
similarity index 100%
rename from router/CC2530_CC2591/bin/CC2530_CC2591_router_2020_09_29.zip
rename to router/Z-Stack_Home_1.2/bin/CC2530_CC2591_router_2020_09_29.zip
diff --git a/router/CC2530_CC2592/bin/CC2530_CC2592_router_2020_09_29.zip b/router/Z-Stack_Home_1.2/bin/CC2530_CC2592_router_2020_09_29.zip
similarity index 100%
rename from router/CC2530_CC2592/bin/CC2530_CC2592_router_2020_09_29.zip
rename to router/Z-Stack_Home_1.2/bin/CC2530_CC2592_router_2020_09_29.zip
diff --git a/router/CC2530/bin/CC2530_router_2020_09_29.zip b/router/Z-Stack_Home_1.2/bin/CC2530_router_2020_09_29.zip
similarity index 100%
rename from router/CC2530/bin/CC2530_router_2020_09_29.zip
rename to router/Z-Stack_Home_1.2/bin/CC2530_router_2020_09_29.zip
diff --git a/router/CC2531/bin/CC2531_router_2020_09_29.zip b/router/Z-Stack_Home_1.2/bin/CC2531_router_2020_09_29.zip
similarity index 100%
rename from router/CC2531/bin/CC2531_router_2020_09_29.zip
rename to router/Z-Stack_Home_1.2/bin/CC2531_router_2020_09_29.zip