├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ └── config.yml └── workflows │ └── stale.yml ├── LICENSE ├── README.md ├── coordinator ├── README.md ├── Z-Stack_3.0.x │ ├── CHANGELOG.md │ ├── COMPILE.md │ ├── bin │ │ ├── CC2530_20190523.zip │ │ ├── CC2530_CC2591_20190523.zip │ │ ├── CC2530_CC2592_20190523.zip │ │ ├── CC2531_20190425.zip │ │ └── CC2538_CC2592_MODKAMRU_V3.md │ └── firmware_CC2531_CC2530.patch ├── Z-Stack_3.x.0 │ ├── CHANGELOG.md │ ├── COMPILE.md │ ├── bin │ │ ├── CC1352P2_CC2652P_launchpad_coordinator_20240710.zip │ │ ├── CC1352P2_CC2652P_other_coordinator_20240710.zip │ │ ├── CC1352P7_coordinator_20240710.zip │ │ ├── CC2652R7_coordinator_20240710.zip │ │ ├── CC2652RB_coordinator_20240710.zip │ │ ├── CC2652R_coordinator_20240710.zip │ │ └── README.md │ ├── firmware.patch │ └── maclib_binary.patch └── Z-Stack_Home_1.2 │ ├── CHANGELOG.md │ ├── COMPILE.md │ ├── bin │ ├── default │ │ ├── CC2530_CC2591_DEFAULT_20211115.zip │ │ ├── CC2530_CC2592_DEFAULT_20211115.zip │ │ ├── CC2530_DEFAULT_20211115.zip │ │ └── CC2531_DEFAULT_20211115.zip │ └── source_routing │ │ ├── CC2530_CC2591_SOURCE_ROUTING_20211116.zip │ │ ├── CC2530_CC2592_SOURCE_ROUTING_20211116.zip │ │ ├── CC2530_SOURCE_ROUTING_20211116.zip │ │ └── CC2531_SOURCE_ROUTING_20211116.zip │ └── firmware.patch ├── index.json └── router ├── Z-Stack_3.x.0 ├── CHANGELOG.md ├── COMPILE.md ├── bin │ ├── CC1352P2_CC2652P_launchpad_router_20221102.zip │ ├── CC1352P2_CC2652P_other_router_20221102.zip │ ├── CC2652RB_router_20221102.zip │ ├── CC2652R_router_20221102.zip │ └── README.md └── firmware.patch └── Z-Stack_Home_1.2 ├── README.md └── bin ├── CC2530_CC2591_router_2020_09_29.zip ├── CC2530_CC2592_router_2020_09_29.zip ├── CC2530_router_2020_09_29.zip └── CC2531_router_2020_09_29.zip /.gitattributes: -------------------------------------------------------------------------------- 1 | *.patch -text 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Zigbee2MQTT issue tracker 4 | url: https://github.com/Koenkk/zigbee2mqtt/issues/new/choose 5 | about: Preferably create an issue in the Zigbee2MQTT issue tracker. Only click on "Open a blank issue" below if you are conviced it really belongs in this issue tracker. 6 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: "Close stale issues/pull requests" 2 | on: 3 | schedule: 4 | - cron: "0 0 * * *" 5 | workflow_dispatch: 6 | 7 | jobs: 8 | stale: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/stale@v3 12 | with: 13 | repo-token: ${{ secrets.GITHUB_TOKEN }} 14 | stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days' 15 | stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days' 16 | days-before-stale: 30 17 | days-before-close: 7 18 | operations-per-run: 500 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2021 Koen Kanters 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Z-Stack-firmware 2 | This repository contains compilation instructions and compiled Z-Stack firmwares for the Texas Instruments [CC2530](https://www.ti.com/product/CC2530), [CC2531](https://www.ti.com/product/CC2531), [CC2538](https://www.ti.com/product/CC2538), [CC1352P](https://www.ti.com/product/CC1352P), [CC2652P](https://www.ti.com/product/CC2652P), [CC2652R](https://www.ti.com/product/CC2652R) and [CC2652RB](https://www.ti.com/product/CC2652RB). 3 | -------------------------------------------------------------------------------- /coordinator/README.md: -------------------------------------------------------------------------------- 1 | # Z-Stack coordinator firmwares 2 | This directory contains various Z-Stack coordinator firmwares. 3 | 4 | ## Overiew 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 82 | 83 |
Z-StackDeviceZigbeeDirect childrenRoutesNotes
Z-Stack_Home_1.2 (default)CC25311.2 HA2030/0
CC2530, CC2530 + CC2591, CC2530 + CC25921.2 HA1630/0
Z-Stack_Home_1.2 (source_routing)CC2531, CC2530, CC2530 + CC2591, CC2530 + CC25921.2 HA540/40
Z-Stack_3.0.xCC25313.01540/0 44 | - Discussion #1445 45 |
46 | - Max 40 Zigbee 3.0 devices 47 |
CC2530, CC2530 + CC2591, CC2530 + CC25923.01040/0 55 | - Discussion #1445 56 |
57 | - Max 40 Zigbee 3.0 devices 58 |
CC2538 + CC25923.0100200/400 66 | - Discussion #1568 67 |
68 | - Max 200 Zigbee 3.0 devices 69 |
Z-Stack_3.x.0CC2652P, CC2652R, CC2652RB, CC1352P-23.050100/200 78 | - Discussion #5266 79 |
80 | - Max 200 Zigbee 3.0 devices 81 |
84 | 85 | ### I'm using a CC2530 or CC2531, which firmware should I use? 86 | This depends: 87 | - Zigbee 3.0 firmwares are **not** recommended for the CC2530 and CC2531 (since those are not powerful enough) 88 | - If you have a network of 1 - 15 devices, the Z-Stack_Home_1.2 **default** firmware is recommended. 89 | - If you have a network of 15+ devices, the Z-Stack_Home_1.2 **source routing** firmware is recommended. 90 | - Note that the **source routing** firmware only supports 5 direct children, therefore you need to have routers in range of the coordinator. 91 | 92 | ### Legend 93 | - *Z-Stack:* Z-Stack is the Zigbee stack for Texas Instruments Zigbee devices 94 | - *Device:* The Zigbee hardware 95 | - *Zigbee:* Zigbee version, for more information read [What's New in Zigbee 3.0](https://www.ti.com/lit/an/swra615a/swra615a.pdf) 96 | - *Direct children:* Number of children that directly can join the coordinator. Note that this is **not** the maximum network size. For more information, read [the Zigbee2MQTT FAQ about device limit](https://www.zigbee2mqtt.io/guide/faq/#i-read-that-zigbee2mqtt-has-a-limit-of-20-devices-when-using-a-cc2530-cc2531-adapter-is-this-true) 97 | - *Routes:* This indicates how many routes the coordinator can keep in memory. For example 100/200 would mean that: 100 normal routes and 200 source routes can be kept in memory. 0 source routes mean that source routing is disabled. Source routes improve the performance for larger (40+ nodes) networks. For more information read [Large ZigBee Networks and Source Routing 98 | ](https://www.digi.com/resources/documentation/digidocs/90001537/references/r_large_zigbee_networks-source_routing.htm?TocPath=Working%20with%20Zigbee%7C_____14). 99 | 100 | #### Notes 101 | - Due to new security requirements in Zigbee 3.0, Zigbee 3.0 coordinators can only support a limited amount of Zigbee 3.0 devices. For Zigbee 1.2 coordinators there is no limit on the max number of Zigbee 3.0 devices that can join. 102 | 103 | ## Compiling the firmware 104 | In case you want to compile the firmware yourself, you can find a `COMPILE.md` for each firmware. 105 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CC2530, CC2530_CC2591, CC2530_CC2592, CC2531 2 | 3 | ## 20190523 4 | - Add CC2530 and CC2530_CC2591 firmware 5 | 6 | ## 20190425 7 | - Initial version. 8 | 9 | # CC2538_CC2592_MODKAMRU_V3 10 | 11 | Available [here](https://github.com/jethome-ru/zigbee-firmware/tree/master/ti/coordinator/cc2538_cc2592#changelog). -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/COMPILE.md: -------------------------------------------------------------------------------- 1 | # CC2530, CC2530_CC2591, CC2530_CC2592, CC2531 2 | 3 | ## Setup development environment 4 | 1. Download and install [Z-STACK-3.0.2](http://www.ti.com/tool/Z-STACK). 5 | 2. Download and install [IAR Embedded Workbench for 8051](https://www.iar.com/iar-embedded-workbench/#!?architecture=8051). 6 | 7 | *NOTE: For IAR Embedded Workbench for 8051 you need either the full (paid) version or the 30-days evaluation version.* 8 | 9 | ## Compiling 10 | 1. Copy `firmware_CC2531_CC2530.patch` to `Z-Stack 3.0.2` 11 | 2. Open Git Bash, go to `Z-Stack 3.0.2` and apply the patch using `git apply firmware_CC2531_CC2530.patch --ignore-space-change`. 12 | 3. Open `Z-Stack 3.0.2\Projects\zstack\ZNP\CC253x\znp.eww` with IAR Embedded workbench for 8051. 13 | 4. Select the correct target: 14 | - For CC2531 select *CC2531 - ZNP-with-SBL* 15 | - For CC2530, CC2530_CC2591, CC2530_CC2592 select *CC2530 - ZNP-with-SBL* 16 | - If you want to compile the `.bin` firmware, select *ZNP-without-SBL* 17 | 5. Right-click on your target and press options. Go to C/C++ compiler -> preprocessor. First remove all *Defined symbols* and depending on what you want to compile add one of the following: 18 | - Device type: `FIRMWARE_CC2530`, `FIRMWARE_CC2530_CC2591`, `FIRMWARE_CC2531` or `FIRMWARE_CC2530_CC2592` 19 | - If you chose for *ZNP-without-SBL* add `FIRMWARE_SBL`. 20 | 6. Go to General Options -> Stack/Heap -> Stack sizes -> and change `XDATA` to `0x400`. 21 | 7. Press OK. 22 | 8. Right-click on your target and click *Rebuild all*. 23 | 9. Once finished, you can find the `CC253(0|1)ZNP-Prod.(hex|bin)` file in `Z-Stack 3.0.2\Projects\zstack\ZNP\CC253x\dev`. 24 | 25 | # CC2538_CC2592_MODKAMRU_V3 26 | 27 | Available [here](https://github.com/jethome-ru/zigbee-firmware/tree/master/ti/coordinator/cc2538_cc2592#modkam-v3-differences-form-the-original-ti-znp-z-stack-302). 28 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/bin/CC2530_20190523.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.0.x/bin/CC2530_20190523.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/bin/CC2530_CC2591_20190523.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.0.x/bin/CC2530_CC2591_20190523.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/bin/CC2530_CC2592_20190523.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.0.x/bin/CC2530_CC2592_20190523.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/bin/CC2531_20190425.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.0.x/bin/CC2531_20190425.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/bin/CC2538_CC2592_MODKAMRU_V3.md: -------------------------------------------------------------------------------- 1 | Firmwares are hosted [here](https://github.com/jethome-ru/zigbee-firmware/tree/master/ti/coordinator/cc2538_cc2592). -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.0.x/firmware_CC2531_CC2530.patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.0.x/firmware_CC2531_CC2530.patch -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 20240710 2 | 3 | - Fixed firmware instability issues introduced in the 20230507 firmware 4 | - Fix `NWK_TABLE_FULL` errors 5 | - SimpleLink SDK 7.41.00.17 6 | 7 | # 20230507 8 | 9 | - Enable child aging to fix issues like [#13478](https://github.com/Koenkk/zigbee2mqtt/issues/13478) (but not for older Xiaomi devices as they do not implement child aging correctly which gets them kicked out of the network) 10 | - Increase message timeout from 7 to 8 seconds to increase message delivery success rate for devices using a 7.5 seconds poll interval ([#13478](https://github.com/Koenkk/zigbee2mqtt/issues/13478#issuecomment-1501188485)) 11 | - Improve performance with larger network 12 | - Optimize table sizes 13 | - Increase `stack_size` from `1024` to `8192` 14 | - Add firmware for CC1352P7 and CC2652R7 15 | - SimpleLink SDK 7.10.00.98 16 | 17 | # 20221226 18 | 19 | - Improve performance/reliability for larger network (100+ devices) 20 | - Increase request retry attempts 21 | - Increase routing table sizes 22 | - SimpleLink SDK 6.10.01.01 ([changelog](https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/6.10.01.01/exports/changelog.html)) 23 | 24 | # 20220219 25 | 26 | - Fix Touchlink crash 27 | - SimpleLink SDK 5.40.00.40 ([changelog](https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/5.40.00.40/exports/changelog.html)) 28 | 29 | # 20211217 30 | 31 | - SimpleLink SDK 5.30.01.01 ([changelog](https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/5.30.01.01/exports/changelog.html)) 32 | - Increase memory heap 33 | - Turn on/off leds when joining is enabled/disabled 34 | - Fix Xiaomi E1 devices not (fully) working 35 | - Allow setting transmit power for CC2652P/CC1352P greater than 5dBm (max 20dBm), default transmit power is set to 9dBm 36 | 37 | # 20210708 38 | 39 | - SimpleLink SDK 5.10.00.48 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/5.10.00.48/exports/changelog.html)) 40 | - Increase MAC buffers, increases performance on message burst and reduces MAC_TRANSACTION_OVERFLOW errors 41 | - LED control 42 | - Fix joining not working when joining is only permitted on specific router 43 | - Forward message to host even when profileID does not match 44 | 45 | # 20210120 46 | 47 | - Optimize network parameters (according to https://www.ti.com/lit/an/swra650b/swra650b.pdf) 48 | - Change default CC2652R/CC2652RB/CC1352P-2/CC2652P transmit power from 0dBm to 5dBm 49 | - Potential fix for Hue end devices disconnecting 50 | - 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)) 51 | 52 | # 20201026 53 | 54 | - 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)) 55 | - Expose `AssocAdd` function 56 | 57 | # 20200925 58 | 59 | - SimpleLink SDK 4.20.01.04 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.20.01.04/exports/changelog.html)) 60 | - Allow support for Samsung SmartThings PGC410EU presence sensor ([link](https://github.com/Koenkk/zigbee2mqtt/issues/4055)) 61 | - Fix commands to long sleeping end devices failing when directly connected to coordinator (e.g. Xiaomi JTYJ-GD-01LM/BW) 62 | 63 | # 20200805 64 | 65 | - Expose `AssocRemove` function 66 | - SimpleLink SDK 4.20.00.35 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.20.00.35/exports/changelog.html)) 67 | 68 | # 20200417 69 | 70 | - SimpleLink SDK 4.10.00.78 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/4.10.00.78/exports/changelog.html)) (+ SimpleLink SDK 3.40.00.02 ([changelog](http://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_26x2_sdk/3.40.00.02/exports/changelog.html))) 71 | - Remove and rediscover route on source route failure (should fix issues with e.g. Hue enddevices dropping off) ([more info](https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/883629)) 72 | - Fix devices not able to reconnect when attempt unsecured rejoin ([more info](https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311)) 73 | - Enable parent announce, fixes devices not reachable when changing parents while coordinator is down. 74 | 75 | # 20191106 76 | 77 | - Increase max number of Zigbee 3.0 devices that can join to 200 78 | 79 | # 20191015 80 | 81 | - Increased group command buffer 82 | 83 | # 20191010 84 | 85 | - Update to `SIMPLELINK-CC13X2-26X2-SDK_3.30.00.03` 86 | - Add CC1352P_2 firmware 87 | 88 | # 20190426 89 | 90 | - Initial version. 91 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/COMPILE.md: -------------------------------------------------------------------------------- 1 | # Compiling the firmware 2 | 3 | ## Setup development environment 4 | 5 | 1. Download and install [SIMPLELINK-LOWPOWER-F2-SDK 7.41.00.17](https://www.ti.com/tool/download/SIMPLELINK-LOWPOWER-F2-SDK/7.41.00.17) 6 | 1. Download and install [Code Composer Studio 12.6.0](https://www.ti.com/tool/download/CCSTUDIO/12.6.0) 7 | 8 | ## Compiling 9 | 10 | 1. Create a folder called `workspace` in the folder where the SDK is installed. In the SDK installation folder you should see files like `Makefile` and `license_simplelink_cc13xx_cc26xx_sdk_7_41_00_17.txt`. 11 | 1. Start Code Composer Studio, it will ask you to select a workspace folder, select the `workspace` folder you created in the previous step. 12 | 1. Go to _File -> Import -> Code Composer Studio -> CCS Projects -> Select_ search-directory: `simplelink_cc13xx_cc26xx_sdk_7_41_00_17/examples/rtos`. 13 | 1. Select: 14 | - `znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang` 15 | - `znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang` 16 | - `znp_LP_CC1352P7_4_tirtos7_ticlang` 17 | - `znp_LP_CC2652R7_tirtos7_ticlang` 18 | - `znp_LP_CC2652RB_tirtos7_ticlang` 19 | 1. Press _Finish_. 20 | 1. In Code Composer Studio, expand the 5 projects and for each open `znp.syscfg`, expand `Power Management` and change `Minimal Poll Period (ms)` to `1000`, change it back to `100` immediately and save the file. 21 | 1. Copy `*.patch` to the SDK installation folder, open a Git Bash in this folder and apply the patch using `git apply *.patch --ignore-space-change`. 22 | 1. Build the 5 projects; right click -> _Build project_. 23 | - **Important:** by default the **launchpad** variant of the CC1352P2_CC2652P (= `znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang`) is build. To build the **other** variant comment `#define LAUNCHPAD_CONFIG 1` in `preinclude.h` (located under `Stack/Config/`), don't forget to save. 24 | 1. Once finished, the firmware can be found under `znp_*_tirtos7_ticlang/default/znp_*_tirtos7_ticlang.hex` 25 | - `znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang.hex` -> CC1352P-2 and CC2652P based boards 26 | - `znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang.hex` -> CC2652R based boards 27 | - `znp_LP_CC1352P7_4_tirtos7_ticlang.hex` -> CC1352P7 based boards 28 | - `znp_LP_CC2652R7_tirtos7_ticlang.hex` -> CC2652R7 based boards 29 | - `znp_LP_CC2652RB_tirtos7_ticlang.hex` -> CC2652RB based boards 30 | 31 | ## Binary `maclib_*.a` changes in `firmware.patch` 32 | 33 | Note that the `firmware.patch` patches the binary `maclib_*.a` files. 34 | These changes are required to fix the coordinator crashing when the TX power is set to 5+. 35 | In SDK 7.10.02.23 TI made changes to `macSetTxPowerVal` which introduced this issue. 36 | The patch reverts these changes. 37 | The patched `maclib_*.a` files were provided by a TI employee and will only work for the 7.41.00.17 SDK. 38 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC1352P7_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC1352P7_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC2652R7_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC2652R7_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC2652RB_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC2652RB_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/CC2652R_coordinator_20240710.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_3.x.0/bin/CC2652R_coordinator_20240710.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/bin/README.md: -------------------------------------------------------------------------------- 1 | # Tested adapters 2 | 3 | **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/guide/adapters/. 4 | The list of supported firmware versions and Zigbee adapters in alphabetical order is below: 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 |
AdapterTI Chip/Module UsedFirmware to FlashBSL Trigger Pin (1)Auto-BSL (2)RF Switch Control Pins (3)LED(s)Hardware Flow Control
CircuitSetup.us Zigbee StickCC2652P
(RFSTAR RF-BM-2652P2 PCB Ant.)
CC1352P2_CC2652P_launchpad_*.zipDIO_15NoDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_6 (Green)
DIO_7 (Red)
?
cod.m Zigbee CC2652P RPi ModuleCC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15NoDIO_28: 2.4Ghz
DIO_29: 20dBm PA
N/A?
cod.m Zigbee Coordinator CC2652P7 (CZC-1.0)CC2652P7
(RFSTAR RF-BM-2652P4I)
CC1352P7_*.zipDIO_15YesN/ADIO_7 (Orange)N/A
cod.m ZigBee CC2652P2 TCP Coordinator V0.2CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15NoDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_7 (Green)
DIO_6 (Red)
?
cyijun OpenZ3GatewayCC2652P
(RFSTAR RF-BM-2652P2 SMA Ant.)
CC1352P2_CC2652P_launchpad_*.zipDIO_15NoDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_7 (Green)
DIO_6 (Red)
?
Egony Stick V4
(Ebyte ver.)
CC2652P
(Ebyte E72-2G4M20S1E)
CC1352P2_CC2652P_other_*.zipDIO_15Yes
(from Rev.2.0)
DIO_5: 20dBm PA
DIO_6: 2.4GHz
DIO_8 (Green)
DIO_7 (Red)
?
Egony Stick V4
(RFSTAR ver.)
CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15YesDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_7 (Green)
DIO_6 (Red)
?
Electrolama zoe2CC1352P
(Ebyte E79)
CC1352P2_CC2652P_other_*.zipDIO_15NoDIO_5: 20dBm PA ??
DIO_6: 2.4GHz ??
DIO_7 (Pink)?
Electrolama zzhCC2652RCC2652R_*.zipDIO_13NoN/ADIO_7 (Pink)?
Electrolama zzhpCC2652PCC1352P2_CC2652P_other_*.zipDIO_15YesDIO_5: 20dBm PA ??
DIO_6: 2.4GHz ??
DIO_7 (Pink)?
Electrolama zzhp-liteCC2652P
(Ebyte E72)
CC1352P2_CC2652P_other_*.zipDIO_15YesDIO_5: 20dBm PA ??
DIO_6: 2.4GHz ??
DIO_7 (Pink)?
Gio-dot Z-Bee Duo with CC2652PCC2652P
(Ebyte E72-2G4M20S1E)
CC1352P2_CC2652P_other_*.zipDIO_15Yes
(from Rev.2.0)
DIO_5: 20dBm PA
DIO_6: 2.4GHz
DIO_8 (Green)
DIO_7 (Red)
?
Gio-dot Z-Bee Duo with CC2652PCC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15YesDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_7 (Green)
DIO_6 (Red)
?
Slaesh's CC2652RB stickCC2652RBCC2652RB_*.zipDIO_13YesN/ADIO_7 (Blue)?
SMLIGHT SLZB-02 USB Zigbee AdapterCC2652P
(Ebyte E72-2G4M20S1E)
CC1352P2_CC2652P_other_*.zipDIO_15No
DIO_5: 20dBm PA
DIO_6: 2.4GHz
DIO_8 (Green)
DIO_7 (Red)
?
SMLIGHT SLZB-05 Ethernet Zigbee AdapterCC2652P
(Ebyte E72-2G4M20S1E)
CC1352P2_CC2652P_other_*.zipDIO_15Yes
(from Rev.3.0)
DIO_5: 20dBm PA
DIO_6: 2.4GHz
DIO_8 (Green)
DIO_7 (Red)
?
SMLIGHT SLZB-06 POE Ethernet WiFi USB Zigbee adapterCC2652PCC1352P2_CC2652P_other_*.zipDIO_15Yes
DIO_5: 20dBm PA
DIO_6: 2.4GHz
DIO_8 (Green)
DIO_7 (Red)
?
SONOFF Zigbee 3.0 USB Dongle Plus by ITeadCC2652PCC1352P2_CC2652P_launchpad_*.zipDIO_15YesDIO_29: 20dBm PADIO_7(Not welded)
Power LED(Red)
DIO13: TX
DIO12:RC
DIO19: CTS(DIP switch ON)
DIO18: RTS(DIP switch ON)
TI LAUNCHXL-CC1352P-2CC1352PCC1352P2_CC2652P_launchpad_*.zipDIO_15NoDIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_30: Sub-1GHz
DIO_6 (Red)
DIO_7 (Green)
?
TI LAUNCHXL-CC26xR1CC2652RCC2652R_*.zip
DIO_13NoN/ADIO_6 (Red)
DIO_7 (Green)
?
TI LP-CC1352P7CC1352P7CC1352P7_*.zip
?No???
TI LP-CC2652R7CC1352P7CC1352P7_*.zip
?No?N/A?
Tube's CC2652P2 USB Coordinator
CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15N/ADIO_28: 2.4Ghz
DIO_29: 20dBm PA
N/A?
Tube's Zigbee Gateways (CC2652P2 variant)
CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15N/ADIO_28: 2.4Ghz
DIO_29: 20dBm PA
N/A?
Tube's Zigbee PoE (Power Over Ethernet) Serial Coordinator (CC2652P2 variant)
CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15N/ADIO_28: 2.4Ghz
DIO_29: 20dBm PA
N/A?
ZigStar Stick v4CC2652P
(RFSTAR RF-BM-2652P2)
CC1352P2_CC2652P_launchpad_*.zipDIO_15Only for CH340C ver.DIO_28: 2.4Ghz
DIO_29: 20dBm PA
DIO_6 (Green)
DIO_7 (Red)
?
283 | 284 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_3.x.0/firmware.patch: -------------------------------------------------------------------------------- 1 | From 8b29db11d4c46aa11532153fb3a349971e97ec90 Mon Sep 17 00:00:00 2001 2 | From: Koen Kanters 3 | Date: Wed, 5 Jun 2024 22:25:56 +0200 4 | Subject: [PATCH] Changes 5 | 6 | --- 7 | .../cc13x2_cc26x2_tirtos7_ticlang.cmd | 8 +- 8 | .../cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd | 8 +- 9 | source/ti/zstack/mt/mt.h | 4 + 10 | source/ti/zstack/mt/mt_util.c | 119 +++++- 11 | source/ti/zstack/mt/mt_version.c | 6 +- 12 | source/ti/zstack/mt/mt_zdo.c | 5 + 13 | source/ti/zstack/npi/npi_tl_uart.c | 49 ++- 14 | source/ti/zstack/stack/Config/preinclude.h | 109 +++++ 15 | source/ti/zstack/stack/af/af.c | 18 +- 16 | source/ti/zstack/stack/nwk/nwk_globals.c | 8 +- 17 | source/ti/zstack/stack/nwk/nwk_util.c | 49 +++ 18 | source/ti/zstack/stack/nwk/nwk_util.h | 4 + 19 | source/ti/zstack/stack/sys/zglobals.c | 2 +- 20 | source/ti/zstack/stack/zdo/zd_app.c | 8 + 21 | source/ti/zstack/stack/zdo/zd_object.c | 14 + 22 | source/ti/zstack/stack/zdo/zd_sec_mgr.c | 23 ++ 23 | source/ti/zstack/stack/zdo/zd_sec_mgr.h | 5 + 24 | source/ti/zstack/startup/zstackstartup.c | 8 + 25 | .../.project | 10 + 26 | .../Stack/Config/znp_cnf.opts | 2 + 27 | .../ti_devices_config.c | 108 +++++ 28 | .../ti_drivers_config.h | 274 +++++++++++++ 29 | .../ti_radio_config.c | 385 ++++++++++++++++++ 30 | .../ti_radio_config.h | 83 ++++ 31 | .../znp.syscfg | 10 +- 32 | .../.project | 10 + 33 | .../Stack/Config/znp_cnf.opts | 2 + 34 | .../znp.syscfg | 6 +- 35 | .../.project | 10 + 36 | .../Stack/Config/znp_cnf.opts | 2 + 37 | .../znp.syscfg | 6 +- 38 | .../znp_LP_CC2652R7_tirtos7_ticlang/.project | 10 + 39 | .../Stack/Config/znp_cnf.opts | 2 + 40 | .../znp.syscfg | 6 +- 41 | .../znp_LP_CC2652RB_tirtos7_ticlang/.project | 10 + 42 | .../Stack/Config/znp_cnf.opts | 2 + 43 | .../znp.syscfg | 6 +- 44 | 37 files changed, 1341 insertions(+), 50 deletions(-) 45 | create mode 100644 source/ti/zstack/stack/Config/preinclude.h 46 | create mode 100644 source/ti/zstack/stack/nwk/nwk_util.c 47 | create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c 48 | create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h 49 | create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.c 50 | create mode 100644 workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.h 51 | 52 | diff --git a/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd b/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd 53 | index 54806e395..89a8b8291 100755 54 | --- a/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd 55 | +++ b/source/ti/zstack/boards/cc13x2_cc26x2/cc13x2_cc26x2_tirtos7_ticlang.cmd 56 | @@ -60,7 +60,7 @@ 57 | /* modifications in your CCS project and leave this file alone. */ 58 | /* */ 59 | /* --heap_size=0 */ 60 | ---stack_size=1024 61 | +--stack_size=4096 62 | /* --library=rtsv7M3_T_le_eabi.lib */ 63 | 64 | /* The starting address of the application. Normally the interrupt vectors */ 65 | @@ -71,9 +71,9 @@ 66 | #endif 67 | 68 | #define FLASH_BASE 0x00000000 69 | -#define FLASH_SIZE (0x56000 - (NVOCMP_NVPAGES * 0x2000)) 70 | -#define FLASH_NV_BASE (0x56000 - (NVOCMP_NVPAGES * 0x2000)) 71 | -#define FLASH_NV_SIZE (NVOCMP_NVPAGES * 0x2000) 72 | +#define FLASH_SIZE 0x50000 73 | +#define FLASH_NV_BASE 0x50000 74 | +#define FLASH_NV_SIZE 0x6000 75 | #define FLASH_LAST_BASE 0x56000 76 | #define FLASH_LAST_SIZE 0x2000 77 | 78 | diff --git a/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd b/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd 79 | index 1e5777c21..ababb2c7f 100755 80 | --- a/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd 81 | +++ b/source/ti/zstack/boards/cc13x2x7_cc26x2x7/cc13x2x7_cc26x2x7_tirtos7_ticlang.cmd 82 | @@ -60,16 +60,16 @@ 83 | /* modifications in your CCS project and leave this file alone. */ 84 | /* */ 85 | /* --heap_size=0 */ 86 | ---stack_size=1024 87 | +--stack_size=4096 88 | /* --library=rtsv7M3_T_le_eabi.lib */ 89 | 90 | /* The starting address of the application. Normally the interrupt vectors */ 91 | /* must be located at the beginning of the application. */ 92 | 93 | #define FLASH_BASE 0x00000000 94 | -#define FLASH_SIZE 0xAA000 95 | -#define FLASH_NV_BASE 0xAA000 96 | -#define FLASH_NV_SIZE 0x4000 97 | +#define FLASH_SIZE 0xA6000 98 | +#define FLASH_NV_BASE 0xA6000 99 | +#define FLASH_NV_SIZE 0x8000 100 | #define FLASH_LAST_BASE 0xAE000 101 | #define FLASH_LAST_SIZE 0x2000 102 | 103 | diff --git a/source/ti/zstack/mt/mt.h b/source/ti/zstack/mt/mt.h 104 | index 0435d72c6..28d9e61ff 100644 105 | --- a/source/ti/zstack/mt/mt.h 106 | +++ b/source/ti/zstack/mt/mt.h 107 | @@ -441,6 +441,8 @@ extern "C" 108 | #define MT_UTIL_CALLBACK_SUB_CMD 0x06 109 | #define MT_UTIL_TIME_ALIVE 0x09 110 | 111 | +#define MT_UTIL_LED_CONTROL 0x0A 112 | + 113 | #define MT_UTIL_TEST_LOOPBACK 0x10 114 | #define MT_UTIL_DATA_REQ 0x11 115 | 116 | @@ -467,6 +469,8 @@ extern "C" 117 | #define MT_UTIL_SRNG_GENERATE 0x4C 118 | #endif 119 | #define MT_UTIL_BIND_ADD_ENTRY 0x4D 120 | +#define MT_UTIL_ASSOC_REMOVE 0x63 // Custom command 121 | +#define MT_UTIL_ASSOC_ADD 0x64 // Custom command 122 | 123 | #define MT_UTIL_ZCL_KEY_EST_INIT_EST 0x80 124 | #define MT_UTIL_ZCL_KEY_EST_SIGN 0x81 125 | diff --git a/source/ti/zstack/mt/mt_util.c b/source/ti/zstack/mt/mt_util.c 126 | index 54cecc0d6..12d4ea6db 100644 127 | --- a/source/ti/zstack/mt/mt_util.c 128 | +++ b/source/ti/zstack/mt/mt_util.c 129 | @@ -79,6 +79,9 @@ 130 | #include "mt_zdo.h" 131 | #include "ssp.h" 132 | 133 | +#include 134 | +#include "ti_drivers_config.h" 135 | + 136 | #if !defined NONWK 137 | 138 | #include "mt_nwk.h" 139 | @@ -154,6 +157,9 @@ static void MT_UtilAPSME_LinkKeyNvIdGet(uint8_t *pBuf); 140 | #endif //MT_SYS_KEY_MANAGEMENT 141 | static void MT_UtilAPSME_RequestKeyCmd(uint8_t *pBuf); 142 | static void MT_UtilAssocCount(uint8_t *pBuf); 143 | +static void MT_UtilLedControl(uint8_t *pBuf); 144 | +static void MT_UtilAssocRemove(uint8_t *pBuf); 145 | +static void MT_UtilAssocAdd(uint8_t *pBuf); 146 | static void MT_UtilAssocFindDevice(uint8_t *pBuf); 147 | static void MT_UtilAssocGetWithAddress(uint8_t *pBuf); 148 | static void MT_UtilBindAddEntry(uint8_t *pBuf); 149 | @@ -286,6 +292,10 @@ uint8_t MT_UtilCommandProcessing(uint8_t *pBuf) 150 | MT_UtilAssocCount(pBuf); 151 | break; 152 | 153 | + case MT_UTIL_LED_CONTROL: 154 | + MT_UtilLedControl(pBuf); 155 | + break; 156 | + 157 | case MT_UTIL_ASSOC_FIND_DEVICE: 158 | MT_UtilAssocFindDevice(pBuf); 159 | break; 160 | @@ -298,6 +308,14 @@ uint8_t MT_UtilCommandProcessing(uint8_t *pBuf) 161 | MT_UtilBindAddEntry(pBuf); 162 | break; 163 | 164 | + case MT_UTIL_ASSOC_REMOVE: 165 | + MT_UtilAssocRemove(pBuf); 166 | + break; 167 | + 168 | + case MT_UTIL_ASSOC_ADD: 169 | + MT_UtilAssocAdd(pBuf); 170 | + break; 171 | + 172 | case MT_UTIL_SYNC_REQ: 173 | MT_UtilSync(); 174 | break; 175 | @@ -1401,6 +1419,95 @@ static void MT_UtilAssocCount(uint8_t *pBuf) 176 | MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 2, pBuf); 177 | } 178 | 179 | +/*************************************************************************************************** 180 | + * @fn MT_UtilLedControl 181 | + * 182 | + * @brief Proxy the LedControl() function. 183 | + * 184 | + * @param pBuf - pointer to the received buffer 185 | + * 186 | + * @return void 187 | + ***************************************************************************************************/ 188 | +static void MT_UtilLedControl(uint8_t *pBuf) 189 | +{ 190 | + uint8_t cmdId = pBuf[MT_RPC_POS_CMD1]; 191 | + pBuf += MT_RPC_FRAME_HDR_SZ; 192 | + 193 | + uint8_t mode = pBuf[1]; 194 | + 195 | + if (gLedHandle == NULL) { 196 | + LED_Params ledParams; 197 | + LED_Params_init(&ledParams); 198 | + gLedHandle = LED_open(CONFIG_LED_GREEN, &ledParams); 199 | + } 200 | + 201 | + if (mode==0) { 202 | + LED_setOff(gLedHandle); 203 | + } else if (mode == 5) { 204 | + gLedsDisabled = TRUE; 205 | + LED_setOff(gLedHandle); 206 | + } else { 207 | + LED_setOn(gLedHandle, LED_BRIGHTNESS_MAX); 208 | + } 209 | + 210 | + uint8_t retValue = 0; 211 | + MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue); 212 | +} 213 | + 214 | +/*************************************************************************************************** 215 | + * @fn MT_UtilAssocRemove 216 | + * 217 | + * @brief Proxy the AssocRemove() function. 218 | + * 219 | + * @param pBuf - pointer to the received buffer 220 | + * 221 | + * @return void 222 | + ***************************************************************************************************/ 223 | +static void MT_UtilAssocRemove(uint8_t *pBuf) 224 | +{ 225 | + uint8_t cmdId; 226 | + uint8_t ieeeAddr[Z_EXTADDR_LEN]; 227 | + uint8_t retValue = 0; 228 | + 229 | + // parse header 230 | + cmdId = pBuf[MT_RPC_POS_CMD1]; 231 | + pBuf += MT_RPC_FRAME_HDR_SZ; 232 | + 233 | + /* IeeAddress */ 234 | + OsalPort_memcpy(ieeeAddr, pBuf, Z_EXTADDR_LEN); 235 | + 236 | + AssocRemove(ieeeAddr); 237 | + 238 | + MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue); 239 | +} 240 | + 241 | +/*************************************************************************************************** 242 | + * @fn MT_UtilAssocAdd 243 | + * 244 | + * @brief Proxy the AssocAdd() function. 245 | + * 246 | + * @param pBuf - pointer to the received buffer 247 | + * 248 | + * @return void 249 | + ***************************************************************************************************/ 250 | +static void MT_UtilAssocAdd(uint8_t *pBuf) 251 | +{ 252 | + uint8_t cmdId; 253 | + uint8_t retValue = 0; 254 | + 255 | + // parse header 256 | + cmdId = pBuf[MT_RPC_POS_CMD1]; 257 | + pBuf += MT_RPC_FRAME_HDR_SZ; 258 | + 259 | + AssocAddNew( 260 | + BUILD_UINT16(pBuf[Z_EXTADDR_LEN], pBuf[Z_EXTADDR_LEN + 1]), 261 | + pBuf, 262 | + pBuf[Z_EXTADDR_LEN + 2] 263 | + ); 264 | + 265 | + MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_UTIL), cmdId, 1, &retValue); 266 | +} 267 | + 268 | /*************************************************************************************************** 269 | * @fn MT_UtilAssocFindDevice 270 | * 271 | @@ -1525,6 +1632,9 @@ static void MT_UtilBindAddEntry(uint8_t *pBuf) 272 | ***************************************************************************************************/ 273 | static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev) 274 | { 275 | + // Applied some fixes here, see https://github.com/Koenkk/zigbee2mqtt/issues/13478#issuecomment-1501085509 276 | + memset(pBuf, 0, sizeof(associated_devices_t)); 277 | + 278 | if (NULL == pDev) 279 | { 280 | uint16_t rtrn = INVALID_NODE_ADDR; 281 | @@ -1546,9 +1656,16 @@ static void packDev_t(uint8_t *pBuf, associated_devices_t *pDev) 282 | *pBuf++ = pDev->linkInfo.rxLqi; 283 | *pBuf++ = pDev->linkInfo.inKeySeqNum; 284 | OsalPort_bufferUint32( pBuf, pDev->linkInfo.inFrmCntr ); 285 | - *pBuf += 4; 286 | + pBuf += 4; 287 | *pBuf++ = LO_UINT16(pDev->linkInfo.txFailure); 288 | *pBuf++ = HI_UINT16(pDev->linkInfo.txFailure); 289 | + *pBuf++ = pDev->endDev.endDevCfg; 290 | + OsalPort_bufferUint32( pBuf, pDev->endDev.deviceTimeout); 291 | + pBuf += 4; 292 | + OsalPort_bufferUint32( pBuf, pDev->timeoutCounter); 293 | + pBuf += 4; 294 | + *pBuf++ = pDev->keepaliveRcv; 295 | + *pBuf++ = pDev->ctrl; 296 | } 297 | } 298 | 299 | diff --git a/source/ti/zstack/mt/mt_version.c b/source/ti/zstack/mt/mt_version.c 300 | index 831aeb699..f5559fc79 100644 301 | --- a/source/ti/zstack/mt/mt_version.c 302 | +++ b/source/ti/zstack/mt/mt_version.c 303 | @@ -74,10 +74,14 @@ 304 | *****************************************************************************/ 305 | const uint8_t MTVersionString[] = { 306 | 2, /* Transport protocol revision */ 307 | - 0, /* Product ID */ 308 | + 1, /* Product ID */ 309 | 2, /* Software major release number */ 310 | 7, /* Software minor release number */ 311 | 1, /* Software maintenance release number */ 312 | + ((CODE_REVISION_NUMBER >> 0) & 0xFF), 313 | + ((CODE_REVISION_NUMBER >> 8) & 0xFF), 314 | + ((CODE_REVISION_NUMBER >> 16) & 0xFF), 315 | + ((CODE_REVISION_NUMBER >> 24) & 0xFF), 316 | }; 317 | 318 | /****************************************************************************** 319 | diff --git a/source/ti/zstack/mt/mt_zdo.c b/source/ti/zstack/mt/mt_zdo.c 320 | index f43df5cbf..f0bc7faaa 100644 321 | --- a/source/ti/zstack/mt/mt_zdo.c 322 | +++ b/source/ti/zstack/mt/mt_zdo.c 323 | @@ -1684,6 +1684,11 @@ static void MT_ZdoMgmtPermitJoinRequest(uint8_t *pBuf) 324 | ignoreIndication = TRUE; 325 | retValue = (uint8_t)ZDP_MgmtPermitJoinReq( &destAddr, duration, tcSignificance, 0); 326 | ignoreIndication = FALSE; 327 | + 328 | + // If joining is enabled via a router, ZDO_ProcessMgmtPermitJoinReq is never triggered thus 329 | + // ZDSecMgrPermitJoining is never called. Joining via a router would always fail now since 330 | + // ZDSecMgrPermitJoiningEnabled in zd_sec_mgr.c stays FALSE 331 | + ZDSecMgrPermitJoining(duration); 332 | 333 | MT_BuildAndSendZToolResponse(((uint8_t)MT_RPC_CMD_SRSP | (uint8_t)MT_RPC_SYS_ZDO), cmdId, 1, &retValue); 334 | } 335 | diff --git a/source/ti/zstack/npi/npi_tl_uart.c b/source/ti/zstack/npi/npi_tl_uart.c 336 | index bfea71ca3..3c90f6757 100644 337 | --- a/source/ti/zstack/npi/npi_tl_uart.c 338 | +++ b/source/ti/zstack/npi/npi_tl_uart.c 339 | @@ -1,5 +1,7 @@ 340 | /****************************************************************************** 341 | 342 | +****************************************************************************** 343 | + 344 | @file npi_tl_uart.c 345 | 346 | @brief NPI Transport Layer Module for UART 347 | @@ -8,7 +10,7 @@ 348 | Target Device: cc13xx_cc26xx 349 | 350 | ****************************************************************************** 351 | - 352 | + 353 | Copyright (c) 2015-2024, Texas Instruments Incorporated 354 | All rights reserved. 355 | 356 | @@ -38,10 +40,6 @@ 357 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 358 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 359 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 360 | - 361 | - ****************************************************************************** 362 | - 363 | - 364 | *****************************************************************************/ 365 | 366 | // **************************************************************************** 367 | @@ -114,6 +112,8 @@ static uint16 NPITLUART_readIsrBuf(size_t size); 368 | //! \brief UART Callback invoked after UART write completion 369 | static void NPITLUART_writeCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status); 370 | 371 | +static void NPITLUART_eventCallBack(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg); 372 | + 373 | //! \brief UART Callback invoked after readsize has been read or timeout 374 | static void NPITLUART_readCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status); 375 | 376 | @@ -152,6 +152,8 @@ void NPITLUART_initializeTransport(uint8_t *tRxBuf, uint8_t *tTxBuf, npiCB_t npi 377 | 378 | params.readCallback = NPITLUART_readCallBack; 379 | params.writeCallback = NPITLUART_writeCallBack; 380 | + params.eventCallback = NPITLUART_eventCallBack; 381 | + params.eventMask |= UART2_EVENT_TX_FINISHED; 382 | 383 | // Open / power on the UART. 384 | uartHandle = UART2_open(CONFIG_DISPLAY_UART, ¶ms); 385 | @@ -253,29 +255,34 @@ void NPITLUART_handleMrdyEvent(void) 386 | //! \return void 387 | // ----------------------------------------------------------------------------- 388 | static void NPITLUART_writeCallBack(UART2_Handle handle, void *ptr, size_t size, void *userArg, int_fast16_t status) 389 | +{} 390 | +static void NPITLUART_eventCallBack(UART2_Handle handle, uint32_t event, uint32_t data, void *userArg) 391 | { 392 | - uint32_t key; 393 | - key = OsalPort_enterCS(); 394 | - 395 | -#if (NPI_FLOW_CTRL == 1) 396 | - if ( !RxActive ) 397 | + if (event == UART2_EVENT_TX_FINISHED) 398 | { 399 | - UART2_readCancel(uartHandle); 400 | + uint32_t key; 401 | + key = OsalPort_enterCS(); 402 | + 403 | + #if (NPI_FLOW_CTRL == 1) 404 | + if ( !RxActive ) 405 | + { 406 | + UART2_readCancel(uartHandle); 407 | + if ( npiTransmitCB ) 408 | + { 409 | + npiTransmitCB(TransportRxLen,TransportTxLen); 410 | + } 411 | + } 412 | + 413 | + TxActive = FALSE; 414 | + #else 415 | if ( npiTransmitCB ) 416 | { 417 | - npiTransmitCB(TransportRxLen,TransportTxLen); 418 | + npiTransmitCB(0,TransportTxLen); 419 | } 420 | - } 421 | + #endif // NPI_FLOW_CTRL = 1 422 | 423 | - TxActive = FALSE; 424 | -#else 425 | - if ( npiTransmitCB ) 426 | - { 427 | - npiTransmitCB(0,TransportTxLen); 428 | + OsalPort_leaveCS(key); 429 | } 430 | -#endif // NPI_FLOW_CTRL = 1 431 | - 432 | - OsalPort_leaveCS(key); 433 | } 434 | 435 | // ----------------------------------------------------------------------------- 436 | diff --git a/source/ti/zstack/stack/Config/preinclude.h b/source/ti/zstack/stack/Config/preinclude.h 437 | new file mode 100644 438 | index 000000000..0602c98c0 439 | --- /dev/null 440 | +++ b/source/ti/zstack/stack/Config/preinclude.h 441 | @@ -0,0 +1,109 @@ 442 | +// Firmware version, used in mt_version.c 443 | +#define CODE_REVISION_NUMBER 20240710 444 | + 445 | +// Required, otherwise firmware crashes after some uptime in some cases. 446 | +#define NVOCMP_RECOVER_FROM_COMPACT_FAILURE 447 | + 448 | +// Required in order to use the extended MT API commands. 449 | +#define FEATURE_NVEXID 1 450 | + 451 | +// Grants access to the security key data 452 | +#define MT_SYS_KEY_MANAGEMENT 1 453 | + 454 | +// Increase by 1 to compensate for lag (default is 7) 455 | +#define NWK_INDIRECT_MSG_TIMEOUT 8 456 | + 457 | +// Increase frame retries 458 | +#define ZMAC_MAX_FRAME_RETRIES 7 459 | +#define NWK_MAX_DATA_RETRIES 4 460 | + 461 | +// Increase MAC buffers, multiplied default value by 10 462 | +#undef MAC_CFG_TX_DATA_MAX 463 | +#define MAC_CFG_TX_DATA_MAX 50 464 | +#undef MAC_CFG_TX_MAX 465 | +#define MAC_CFG_TX_MAX 80 466 | +#undef MAC_CFG_RX_MAX 467 | +#define MAC_CFG_RX_MAX 50 468 | + 469 | +// From https://www.ti.com/lit/an/swra650b/swra650b.pdf 470 | +#define LINK_DOWN_TRIGGER 12 471 | +#define NWK_ROUTE_AGE_LIMIT 5 472 | +#define DEF_NWK_RADIUS 15 473 | +#define DEFAULT_ROUTE_REQUEST_RADIUS 8 474 | +#define ZDNWKMGR_MIN_TRANSMISSIONS 0 475 | +#define ROUTE_DISCOVERY_TIME 13 476 | +#define MTO_RREQ_LIMIT_TIME 5000 477 | + 478 | +// Save memory (tables are not used) 479 | +#undef NWK_MAX_BINDING_ENTRIES 480 | +#define NWK_MAX_BINDING_ENTRIES 1 481 | +#undef APS_MAX_GROUPS 482 | +#define APS_MAX_GROUPS 1 483 | + 484 | +// Increase NV pages to allow for bigger device tables 485 | +#undef NVOCMP_NVPAGES 486 | +#define NVOCMP_NVPAGES 3 487 | + 488 | +// Disabling MULTICAST is required in order for proper group support. 489 | +// If MULTICAST is not disabled, the group adress is not included in the APS header 490 | +#define MULTICAST_ENABLED FALSE 491 | + 492 | +// Increase the max number of boardcasts, the default broadcast delivery time is 3 seconds 493 | +// with the value below this will allow for 1 broadcast every 0.15 second 494 | +#define MAX_BCAST 30 495 | + 496 | +// Reduce the APS ack wait duration from 6000 ms to 1000 ms (value * 2 = value in ms). 497 | +// This will make requests timeout quicker, in pratice the default timeout of 6000ms is too long. 498 | +#define APSC_ACK_WAIT_DURATION_POLLED 500 499 | + 500 | +// Enable MTO routing 501 | +// MTO Routing will be used in addition to the standard AODV routing to provide additional route discovery opportunities. 502 | +// Especially useful for larger networks with multiple hops. 503 | +#define CONCENTRATOR_ENABLE TRUE 504 | +#define CONCENTRATOR_ROUTE_CACHE TRUE 505 | +#define CONCENTRATOR_DISCOVERY_TIME 60 506 | +#define MAX_RTG_SRC_ENTRIES 250 507 | +#define SRC_RTG_EXPIRY_TIME 10 508 | + 509 | +// The number of simultaneous route discoveries in network 510 | +#define MAX_RREQ_ENTRIES 40 511 | + 512 | +// Size of the conflicted address table 513 | +#define CONFLICTED_ADDR_TABLE_SIZE 15 514 | + 515 | +// Number of devices which have associated directly through the coordinator 516 | +// This does not determine the upper limit in the number of nodes in the network, 517 | +// just the upper limit for number of nodes directly connected to a certain routing node 518 | +#define NWK_MAX_DEVICE_LIST 50 519 | + 520 | +// Determines the maximum number of devices in the Neighbor Table. 521 | +#define MAX_NEIGHBOR_ENTRIES 25 522 | + 523 | +// Number of devices in the standard Routing Table, which is used for AODV routing. 524 | +// Only stores information for 1-hop routes, so this table does not need to be as big as the Source Route table. 525 | +#define MAX_RTG_ENTRIES 100 526 | +#define ROUTE_EXPIRY_TIME 2 527 | + 528 | +// Determines the maximum number of “secure partners” that the network Trust Center (ZC) can support. 529 | +// This value will be the upper limit of Zigbee 3.0 devices which are allowed in the network 530 | +#define ZDSECMGR_TC_DEVICE_MAX 200 531 | + 532 | +// Set default transmit power to 9 for PA devices 533 | +#if defined(CC1352P_2) || defined(DeviceFamily_CC13X2X7) 534 | + #define TXPOWER 9 535 | +#endif 536 | + 537 | +// CC1352P2 specific 538 | +#if defined(CC1352P_2) 539 | + // Different configs, comment `LAUNCHPAD_CONFIG` for "other" firmware 540 | + #define LAUNCHPAD_CONFIG 1 541 | + #ifdef LAUNCHPAD_CONFIG 542 | + #define CONFIG_RF_24GHZ 0x0000001c 543 | + #define CONFIG_RF_HIGH_PA 0x0000001d 544 | + #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xc1 545 | + #else 546 | + #define CONFIG_RF_24GHZ 0x0000006 547 | + #define CONFIG_RF_HIGH_PA 0x0000005 548 | + #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xfa 549 | + #endif 550 | +#endif 551 | diff --git a/source/ti/zstack/stack/af/af.c b/source/ti/zstack/stack/af/af.c 552 | index d1de1d45c..1f791c719 553 | --- a/source/ti/zstack/stack/af/af.c 554 | +++ b/source/ti/zstack/stack/af/af.c 555 | @@ -433,10 +433,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S 556 | #if !defined ( APS_NO_GROUPS ) 557 | // Find the first endpoint for this group 558 | grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST ); 559 | - if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) 560 | - return; // No endpoint found 561 | + if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) { 562 | + // No endpoint found, default to endpoint 1. 563 | + // In the original source code there is a return here. 564 | + // This prevent the messags from being forwarded. 565 | + // For our use-case we want to capture all messages. 566 | + // Even if the coordinator is not in the group. 567 | + epDesc = afFindEndPointDesc( 1 ); 568 | + } 569 | + else { 570 | + epDesc = afFindEndPointDesc( grpEp ); 571 | + } 572 | 573 | - epDesc = afFindEndPointDesc( grpEp ); 574 | if ( epDesc == NULL ) 575 | return; // Endpoint descriptor not found 576 | 577 | @@ -483,7 +491,9 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16_t S 578 | // if the Wildcard ProfileID is received the message should not be sent to ZDO endpoint 579 | if ( (aff->ProfileID == epProfileID) || 580 | ((epDesc->endPoint == ZDO_EP) && (aff->ProfileID == ZDO_PROFILE_ID)) || 581 | - ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) ) 582 | + ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) || 583 | + // Forward messages to endpoint even with profileID mismatches 584 | + ((aff->ProfileID >= 0x100) && (aff->ProfileID <= 0xFC01)) ) 585 | { 586 | // Save original endpoint 587 | uint8_t endpoint = aff->DstEndPoint; 588 | diff --git a/source/ti/zstack/stack/nwk/nwk_globals.c b/source/ti/zstack/stack/nwk/nwk_globals.c 589 | index f90e3164f..cb57e8868 590 | --- a/source/ti/zstack/stack/nwk/nwk_globals.c 591 | +++ b/source/ti/zstack/stack/nwk/nwk_globals.c 592 | @@ -91,10 +91,10 @@ 593 | * CONSTANTS 594 | */ 595 | // Maximums for the data buffer queue 596 | -#define NWK_MAX_DATABUFS_WAITING 8 // Waiting to be sent to MAC 597 | -#define NWK_MAX_DATABUFS_SCHEDULED 5 // Timed messages to be sent 598 | -#define NWK_MAX_DATABUFS_CONFIRMED 5 // Held after MAC confirms 599 | -#define NWK_MAX_DATABUFS_TOTAL 12 // Total number of buffers 600 | +#define NWK_MAX_DATABUFS_WAITING 48 // Waiting to be sent to MAC 601 | +#define NWK_MAX_DATABUFS_SCHEDULED 30 // Timed messages to be sent 602 | +#define NWK_MAX_DATABUFS_CONFIRMED 30 // Held after MAC confirms 603 | +#define NWK_MAX_DATABUFS_TOTAL 72 // Total number of buffers 604 | 605 | // 1-255 (0 -> 256) X RTG_TIMER_INTERVAL 606 | // A known shortcoming is that when a message is enqueued as "hold" for a 607 | diff --git a/source/ti/zstack/stack/nwk/nwk_util.c b/source/ti/zstack/stack/nwk/nwk_util.c 608 | new file mode 100644 609 | index 000000000..da24c0388 610 | --- /dev/null 611 | +++ b/source/ti/zstack/stack/nwk/nwk_util.c 612 | @@ -0,0 +1,49 @@ 613 | +#include "nwk_util.h" 614 | +#include "aps_mede.h" 615 | + 616 | +#ifndef NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES 617 | +#define NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES 50 618 | +#endif 619 | + 620 | +typedef struct 621 | +{ 622 | + uint8_t extAddr[Z_EXTADDR_LEN]; 623 | + uint8_t numBytesToMatch; 624 | +} child_aging_leave_disabled_entry_t; 625 | + 626 | +child_aging_leave_disabled_entry_t childAgingLeaveDisabledList[NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES]; 627 | +uint8_t chidlAgingLeaveDisabledCnt = 0; 628 | + 629 | +uint8_t NwkDisableChildAgingLeaveAdd(uint8_t* extAddr, uint8_t numBytesToMatch) 630 | +{ 631 | + if (chidlAgingLeaveDisabledCnt == NWK_MAX_CHILD_AGING_LEAVE_DISABLED_ENTRIES) { 632 | + return 1; 633 | + } 634 | + 635 | + memcpy(childAgingLeaveDisabledList[chidlAgingLeaveDisabledCnt].extAddr, extAddr, Z_EXTADDR_LEN); 636 | + childAgingLeaveDisabledList[chidlAgingLeaveDisabledCnt].numBytesToMatch = numBytesToMatch; 637 | + ++chidlAgingLeaveDisabledCnt; 638 | + 639 | + return 0; 640 | +} 641 | + 642 | +void NwkNotMyChildSendLeaveCustom (uint16_t dstAddr) 643 | +{ 644 | + uint8_t extAddr[Z_EXTADDR_LEN]; 645 | + uint8_t idx; 646 | + 647 | + if (!APSME_LookupExtAddr(dstAddr, extAddr)) { 648 | + return; 649 | + } 650 | + 651 | + // Do not send leave request to devices where it is disabled for 652 | + for (idx = 0; idx < chidlAgingLeaveDisabledCnt; ++idx) 653 | + { 654 | + uint8_t offset = Z_EXTADDR_LEN - childAgingLeaveDisabledList[idx].numBytesToMatch; 655 | + if (memcmp(childAgingLeaveDisabledList[idx].extAddr + offset, extAddr + offset, childAgingLeaveDisabledList[idx].numBytesToMatch) == 0) { 656 | + return; 657 | + } 658 | + } 659 | + 660 | + NwkNotMyChildSendLeave (dstAddr); 661 | +}; 662 | diff --git a/source/ti/zstack/stack/nwk/nwk_util.h b/source/ti/zstack/stack/nwk/nwk_util.h 663 | index 468227b32..4075d50df 100644 664 | --- a/source/ti/zstack/stack/nwk/nwk_util.h 665 | +++ b/source/ti/zstack/stack/nwk/nwk_util.h 666 | @@ -638,6 +638,10 @@ extern uint8_t (*pNwkNotMyChildListAdd)( uint16_t devAddr, uint32_t timeoutValue 667 | extern void (*pNwkNotMyChildListDelete)( uint16_t devAddr ); 668 | extern void (*pNwkNotMyChildSendLeave)( uint16_t dstAddr ); 669 | 670 | +// Custom functions 671 | +void NwkNotMyChildSendLeaveCustom (uint16_t dstAddr); 672 | +uint8_t NwkDisableChildAgingLeaveAdd(uint8_t* extAddr, uint8_t numBytesToMatch); 673 | + 674 | /**************************************************************************** 675 | * Utility function to copy NV items 676 | ****************************************************************************/ 677 | diff --git a/source/ti/zstack/stack/sys/zglobals.c b/source/ti/zstack/stack/sys/zglobals.c 678 | index 0a1d7d2a6..37a0a7bf7 100644 679 | --- a/source/ti/zstack/stack/sys/zglobals.c 680 | +++ b/source/ti/zstack/stack/sys/zglobals.c 681 | @@ -131,7 +131,7 @@ uint8_t zgSecurePermitJoin = TRUE; 682 | // TC Link Key. In this scenario, if this flag is TRUE, the Trust Center will 683 | // encrypt the outgoing NWK Key with the default TC Link Key (ZigbeeAlliance09). 684 | // If this flag is FALSE (default), the Trust Center will not send the NWK Key at all. 685 | -uint8_t zgAllowRejoinsWithWellKnownKey = FALSE; 686 | +uint8_t zgAllowRejoinsWithWellKnownKey = TRUE; // https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/882650/3265311#3265311 687 | 688 | //allowInstallCodes 689 | uint8_t zgAllowInstallCodes = ZG_IC_SUPPORTED_NOT_REQUIRED; 690 | diff --git a/source/ti/zstack/stack/zdo/zd_app.c b/source/ti/zstack/stack/zdo/zd_app.c 691 | index d67a7798a..c769641dc 100644 692 | --- a/source/ti/zstack/stack/zdo/zd_app.c 693 | +++ b/source/ti/zstack/stack/zdo/zd_app.c 694 | @@ -3163,6 +3163,14 @@ void ZDO_NetworkStatusCB( uint16_t nwkDstAddr, uint8_t statusCode, uint16_t dstA 695 | // Routing error for dstAddr, this is informational and a Route 696 | // Request should happen automatically. 697 | } 698 | + 699 | + if ( (nwkDstAddr == NLME_GetShortAddr()) 700 | + && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) ) 701 | + { 702 | + // Received a source route failure, remove route and rediscover. 703 | + RTG_RemoveRtgEntry( dstAddr, 0 ); 704 | + NLME_RouteDiscoveryRequest( dstAddr, 0, 30 ); 705 | + } 706 | } 707 | 708 | /****************************************************************************** 709 | diff --git a/source/ti/zstack/stack/zdo/zd_object.c b/source/ti/zstack/stack/zdo/zd_object.c 710 | index 0c62d58d6..d1f899cec 100644 711 | --- a/source/ti/zstack/stack/zdo/zd_object.c 712 | +++ b/source/ti/zstack/stack/zdo/zd_object.c 713 | @@ -676,6 +676,20 @@ void ZDO_ProcessNodeDescReq( zdoIncomingMsg_t *inMsg ) 714 | 715 | if ( desc != NULL ) 716 | { 717 | + uint8_t extAddr[Z_EXTADDR_LEN]; 718 | + // Respond with Xiaomi manufacturer code when ieeAddr is withing Xiaomi address space 719 | + // Otherwise some devices don't work 720 | + // https://github.com/Koenkk/zigbee2mqtt/issues/9274 721 | + if (APSME_LookupExtAddr(inMsg->srcAddr.addr.shortAddr, extAddr) == TRUE && 722 | + ((extAddr[7] == 0x04 && extAddr[6] == 0xcf && extAddr[5] == 0x8c) || 723 | + (extAddr[7] == 0x54 && extAddr[6] == 0xef && extAddr[5] == 0x44))) { 724 | + desc->ManufacturerCode[0] = 0x5f; 725 | + desc->ManufacturerCode[1] = 0x11; 726 | + } else { 727 | + desc->ManufacturerCode[0] = 0x0; 728 | + desc->ManufacturerCode[1] = 0x0; 729 | + } 730 | + 731 | ZDP_NodeDescMsg( inMsg, aoi, desc ); 732 | } 733 | else 734 | diff --git a/source/ti/zstack/stack/zdo/zd_sec_mgr.c b/source/ti/zstack/stack/zdo/zd_sec_mgr.c 735 | index 65d7857cc..3ae6825da 100644 736 | --- a/source/ti/zstack/stack/zdo/zd_sec_mgr.c 737 | +++ b/source/ti/zstack/stack/zdo/zd_sec_mgr.c 738 | @@ -88,6 +88,7 @@ extern "C" 739 | 740 | #include 741 | #include 742 | +#include "ti_drivers_config.h" 743 | 744 | /****************************************************************************** 745 | * CONSTANTS 746 | @@ -145,6 +146,8 @@ typedef struct 747 | */ 748 | extern CONST uint8_t gMAX_NWK_SEC_MATERIAL_TABLE_ENTRIES; 749 | extern pfnZdoCb zdoCBFunc[MAX_ZDO_CB_FUNC]; 750 | +bool gLedsDisabled = FALSE; 751 | +LED_Handle gLedHandle; 752 | 753 | /****************************************************************************** 754 | * EXTERNAL FUNCTIONS 755 | @@ -1545,6 +1548,23 @@ void ZDSecMgrConfig( void ) 756 | } 757 | } 758 | 759 | +void updateLED( void ) 760 | +{ 761 | + if (gLedHandle == NULL) { 762 | + LED_Params ledParams; 763 | + LED_Params_init(&ledParams); 764 | + gLedHandle = LED_open(CONFIG_LED_GREEN, &ledParams); 765 | + } 766 | + 767 | + if (gLedsDisabled == FALSE && gLedHandle != NULL) { 768 | + if (ZDSecMgrPermitJoiningEnabled == TRUE) { 769 | + LED_setOn(gLedHandle, LED_BRIGHTNESS_MAX); 770 | + } else { 771 | + LED_setOff(gLedHandle); 772 | + } 773 | + } 774 | +} 775 | + 776 | /****************************************************************************** 777 | * @fn ZDSecMgrPermitJoining 778 | * 779 | @@ -1573,6 +1593,7 @@ uint8_t ZDSecMgrPermitJoining( uint8_t duration ) 780 | ZDSecMgrPermitJoiningEnabled = FALSE; 781 | } 782 | 783 | + updateLED(); 784 | accept = TRUE; 785 | 786 | return accept; 787 | @@ -1594,6 +1615,8 @@ void ZDSecMgrPermitJoiningTimeout( void ) 788 | ZDSecMgrPermitJoiningEnabled = FALSE; 789 | ZDSecMgrPermitJoiningTimed = FALSE; 790 | } 791 | + 792 | + updateLED(); 793 | } 794 | 795 | /****************************************************************************** 796 | diff --git a/source/ti/zstack/stack/zdo/zd_sec_mgr.h b/source/ti/zstack/stack/zdo/zd_sec_mgr.h 797 | index b1ab5fcf4..a85f0ca08 100644 798 | --- a/source/ti/zstack/stack/zdo/zd_sec_mgr.h 799 | +++ b/source/ti/zstack/stack/zdo/zd_sec_mgr.h 800 | @@ -77,6 +77,8 @@ extern "C" 801 | #include "zcomdef.h" 802 | #include "zd_app.h" 803 | 804 | +#include 805 | + 806 | /****************************************************************************** 807 | * TYPEDEFS 808 | */ 809 | @@ -121,6 +123,9 @@ extern CONST uint16_t gZDSECMGR_TC_DEVICE_MAX; 810 | extern CONST uint16_t gZDSECMGR_TC_DEVICE_IC_MAX; 811 | extern uint8_t gZDSECMGR_TC_ATTEMPT_DEFAULT_KEY; 812 | 813 | +extern bool gLedsDisabled; 814 | +extern LED_Handle gLedHandle; 815 | + 816 | typedef struct 817 | { 818 | uint32_t FrameCounter; 819 | diff --git a/source/ti/zstack/startup/zstackstartup.c b/source/ti/zstack/startup/zstackstartup.c 820 | index 72073f7a9..47b2f1b4f 100644 821 | --- a/source/ti/zstack/startup/zstackstartup.c 822 | +++ b/source/ti/zstack/startup/zstackstartup.c 823 | @@ -701,6 +701,14 @@ static void stackInit(void) 824 | //Initialize default poll rates 825 | nwk_InitializeDefaultPollRates(); 826 | 827 | + // Use custom function for child aging leave requests 828 | + pNwkNotMyChildSendLeave = &NwkNotMyChildSendLeaveCustom; 829 | + 830 | + // Disable child aging leave for Xiaomi/Aqara extAddr range to prevent them from being kicekd out of the network. 831 | + // They do not support child aging. 832 | + uint8_t extAddrXiaomi [] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x15, 0x00}; 833 | + NwkDisableChildAgingLeaveAdd(extAddrXiaomi, 3); 834 | + 835 | /* Initialize MAC buffer */ 836 | macLowLevelBufferInit(); 837 | 838 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project 839 | index 9a0c4b5ab..0732ecdb6 100644 840 | --- a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project 841 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/.project 842 | @@ -450,6 +450,11 @@ 843 | 1 844 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h 845 | 846 | + 847 | + Stack/Config/preinclude.h 848 | + 1 849 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h 850 | + 851 | 852 | Stack/MAC/mac_api.h 853 | 1 854 | @@ -715,6 +720,11 @@ 855 | 1 856 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h 857 | 858 | + 859 | + Stack/nwk/nwk_util.c 860 | + 1 861 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c 862 | + 863 | 864 | Stack/nwk/reflecttrack.h 865 | 1 866 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 867 | index 2a7704196..2e9e7ac6e 100644 868 | --- a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 869 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 870 | @@ -32,3 +32,5 @@ 871 | -DMT_GP_CB_FUNC 872 | 873 | -DMT_APP_CNF_FUNC 874 | + 875 | +-include ../../../source/ti/zstack/stack/Config/preinclude.h 876 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c 877 | new file mode 100644 878 | index 000000000..c80aafd91 879 | --- /dev/null 880 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_devices_config.c 881 | @@ -0,0 +1,108 @@ 882 | +/* 883 | + * ======== ti_devices_config.c ======== 884 | + * Customer Configuration for CC26XX and CC13XX devices. 885 | + * 886 | + * DO NOT EDIT - This file is generated by the SysConfig tool. 887 | + * 888 | + */ 889 | + 890 | +//##################################### 891 | +// Force VDDR high setting (Higher output power but also higher power consumption) 892 | +// This is also called "boost mode" 893 | +//##################################### 894 | + 895 | +// Force VDDR voltage to the factory HH setting (FCFG1..VDDR_TRIM_HH) 896 | +#define CCFG_FORCE_VDDR_HH 0x1 897 | + 898 | + 899 | +//##################################### 900 | +// Power settings 901 | +//##################################### 902 | + 903 | +// Do not use the DC/DC during recharge in powerdown 904 | +#define SET_CCFG_MODE_CONF_DCDC_RECHARGE 0x1 905 | + 906 | +// Do not use the DC/DC during active mode 907 | +#define SET_CCFG_MODE_CONF_DCDC_ACTIVE 0x1 908 | + 909 | + 910 | +//##################################### 911 | +// Clock settings 912 | +//##################################### 913 | + 914 | +// LF XOSC 915 | +#define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x2 916 | + 917 | +// Apply cap-array delta 918 | +#define SET_CCFG_MODE_CONF_XOSC_CAP_MOD 0x0 919 | +// CUSTOM: set in preinclude.h 920 | +// #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xc1 921 | + 922 | +//##################################### 923 | +// Special HF clock source setting 924 | +//##################################### 925 | + 926 | +// HF source is a 48 MHz xtal 927 | +#define SET_CCFG_MODE_CONF_XOSC_FREQ 0x2 928 | + 929 | +//##################################### 930 | +// Bootloader settings 931 | +//##################################### 932 | + 933 | +// Enable ROM boot loader 934 | +#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5 935 | + 936 | +// Enabled boot loader backdoor 937 | +#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5 938 | + 939 | +// DIO number for boot loader backdoor 940 | +#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xf 941 | + 942 | +// Active low to open boot loader backdoor 943 | +#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x0 944 | + 945 | + 946 | +// Default address in IMAGE_VALID_CONF register 947 | +#define SET_CCFG_IMAGE_VALID_CONF_IMAGE_VALID 0x00000000 948 | + 949 | +//##################################### 950 | +// Debug access settings 951 | +//##################################### 952 | + 953 | +// Disable unlocking of TI Failure Analysis option 954 | +#define SET_CCFG_CCFG_TI_OPTIONS_TI_FA_ENABLE 0x00 955 | + 956 | +// Disable customer key CKEY0-3 to be XOR'ed with TI FA option unlock key 957 | +#define SET_CCFG_CCFG_TI_OPTIONS_C_FA_DIS 0xC5 958 | + 959 | +// Access enabled if also enabled in FCFG 960 | +#define SET_CCFG_CCFG_TAP_DAP_0_CPU_DAP_ENABLE 0xC5 961 | + 962 | +// Access enabled if also enabled in FCFG 963 | +#define SET_CCFG_CCFG_TAP_DAP_0_PWRPROF_TAP_ENABLE 0xC5 964 | + 965 | +// Access disabled 966 | +#define SET_CCFG_CCFG_TAP_DAP_0_TEST_TAP_ENABLE 0x00 967 | + 968 | +// Access disabled 969 | +#define SET_CCFG_CCFG_TAP_DAP_1_PBIST2_TAP_ENABLE 0x00 970 | + 971 | +// Access disabled 972 | +#define SET_CCFG_CCFG_TAP_DAP_1_PBIST1_TAP_ENABLE 0x00 973 | + 974 | +// Access disabled 975 | +#define SET_CCFG_CCFG_TAP_DAP_1_AON_TAP_ENABLE 0x00 976 | + 977 | +//##################################### 978 | +// Select between cache or GPRAM 979 | +//##################################### 980 | + 981 | +// Cache is enabled and GPRAM is disabled (unavailable) 982 | +#define SET_CCFG_SIZE_AND_DIS_FLAGS_DIS_GPRAM 0x1 983 | + 984 | +/* 985 | + * ======== Include Base Settings for device ======== 986 | + */ 987 | + 988 | +#include 989 | +#include DeviceFamily_constructPath(startup_files/ccfg.c) 990 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h 991 | new file mode 100644 992 | index 000000000..91923e3a1 993 | --- /dev/null 994 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_drivers_config.h 995 | @@ -0,0 +1,274 @@ 996 | +/* 997 | + * ======== ti_drivers_config.h ======== 998 | + * Configured TI-Drivers module declarations 999 | + * 1000 | + * The macros defines herein are intended for use by applications which 1001 | + * directly include this header. These macros should NOT be hard coded or 1002 | + * copied into library source code. 1003 | + * 1004 | + * Symbols declared as const are intended for use with libraries. 1005 | + * Library source code must extern the correct symbol--which is resolved 1006 | + * when the application is linked. 1007 | + * 1008 | + * DO NOT EDIT - This file is generated for the CC1352P_2_LAUNCHXL 1009 | + * by the SysConfig tool. 1010 | + */ 1011 | +#ifndef ti_drivers_config_h 1012 | +#define ti_drivers_config_h 1013 | + 1014 | +#define CONFIG_SYSCONFIG_PREVIEW 1015 | + 1016 | +#define CONFIG_CC1352P_2_LAUNCHXL 1017 | +#ifndef DeviceFamily_CC13X2 1018 | +#define DeviceFamily_CC13X2 1019 | +#endif 1020 | + 1021 | +#include 1022 | + 1023 | +#include 1024 | + 1025 | +/* support C++ sources */ 1026 | +#ifdef __cplusplus 1027 | +extern "C" { 1028 | +#endif 1029 | + 1030 | + 1031 | +/* 1032 | + * ======== CCFG ======== 1033 | + */ 1034 | + 1035 | + 1036 | +/* 1037 | + * ======== AESCBC ======== 1038 | + */ 1039 | + 1040 | +extern const uint_least8_t CONFIG_AESCBC_0_CONST; 1041 | +#define CONFIG_AESCBC_0 0 1042 | +#define CONFIG_TI_DRIVERS_AESCBC_COUNT 1 1043 | + 1044 | + 1045 | +/* 1046 | + * ======== AESCCM ======== 1047 | + */ 1048 | + 1049 | +extern const uint_least8_t CONFIG_AESCCM_0_CONST; 1050 | +#define CONFIG_AESCCM_0 0 1051 | +#define CONFIG_TI_DRIVERS_AESCCM_COUNT 1 1052 | + 1053 | + 1054 | +/* 1055 | + * ======== AESECB ======== 1056 | + */ 1057 | + 1058 | +extern const uint_least8_t CONFIG_AESECB_0_CONST; 1059 | +#define CONFIG_AESECB_0 0 1060 | +#define CONFIG_TI_DRIVERS_AESECB_COUNT 1 1061 | + 1062 | + 1063 | +/* 1064 | + * ======== ECDH ======== 1065 | + */ 1066 | + 1067 | +extern const uint_least8_t CONFIG_ECDH_0_CONST; 1068 | +#define CONFIG_ECDH_0 0 1069 | +#define CONFIG_TI_DRIVERS_ECDH_COUNT 1 1070 | + 1071 | + 1072 | +/* 1073 | + * ======== ECDSA ======== 1074 | + */ 1075 | + 1076 | +extern const uint_least8_t CONFIG_ECDSA_0_CONST; 1077 | +#define CONFIG_ECDSA_0 0 1078 | +#define CONFIG_TI_DRIVERS_ECDSA_COUNT 1 1079 | + 1080 | + 1081 | +/* 1082 | + * ======== GPIO ======== 1083 | + */ 1084 | +/* Owned by CONFIG_DISPLAY_UART as */ 1085 | +extern const uint_least8_t CONFIG_GPIO_DISPLAY_UART_TX_CONST; 1086 | +#define CONFIG_GPIO_DISPLAY_UART_TX 13 1087 | + 1088 | +/* Owned by CONFIG_DISPLAY_UART as */ 1089 | +extern const uint_least8_t CONFIG_GPIO_DISPLAY_UART_RX_CONST; 1090 | +#define CONFIG_GPIO_DISPLAY_UART_RX 12 1091 | + 1092 | +/* Owned by /ti/drivers/RF as */ 1093 | +extern const uint_least8_t CONFIG_RF_24GHZ_CONST; 1094 | +// CUSTOM: set in preinclude.h 1095 | +// #define CONFIG_RF_24GHZ 28 1096 | + 1097 | +/* Owned by /ti/drivers/RF as */ 1098 | +extern const uint_least8_t CONFIG_RF_HIGH_PA_CONST; 1099 | +// CUSTOM: set in preinclude.h 1100 | +// #define CONFIG_RF_HIGH_PA 29 1101 | + 1102 | +/* Owned by /ti/drivers/RF as */ 1103 | +extern const uint_least8_t CONFIG_RF_SUB1GHZ_CONST; 1104 | +#define CONFIG_RF_SUB1GHZ 30 1105 | + 1106 | +/* Owned by CONFIG_BTN_LEFT as */ 1107 | +extern const uint_least8_t CONFIG_GPIO_BTN1_CONST; 1108 | +#define CONFIG_GPIO_BTN1 15 1109 | + 1110 | +/* Owned by CONFIG_BTN_RIGHT as */ 1111 | +extern const uint_least8_t CONFIG_GPIO_BTN2_CONST; 1112 | +#define CONFIG_GPIO_BTN2 14 1113 | + 1114 | +/* Owned by CONFIG_LED_RED as */ 1115 | +extern const uint_least8_t CONFIG_GPIO_RLED_CONST; 1116 | +#define CONFIG_GPIO_RLED 6 1117 | + 1118 | +/* Owned by CONFIG_LED_GREEN as */ 1119 | +extern const uint_least8_t CONFIG_GPIO_GLED_CONST; 1120 | +#define CONFIG_GPIO_GLED 7 1121 | + 1122 | +/* Owned by CONFIG_NVS_SPI_0 as */ 1123 | +extern const uint_least8_t CONFIG_GPIO_0_CONST; 1124 | +#define CONFIG_GPIO_0 20 1125 | + 1126 | +/* Owned by CONFIG_SPI_0 as */ 1127 | +extern const uint_least8_t CONFIG_PIN_SPI_SCLK_CONST; 1128 | +#define CONFIG_PIN_SPI_SCLK 10 1129 | + 1130 | +/* Owned by CONFIG_SPI_0 as */ 1131 | +extern const uint_least8_t CONFIG_PIN_SPI_MISO_CONST; 1132 | +#define CONFIG_PIN_SPI_MISO 8 1133 | + 1134 | +/* Owned by CONFIG_SPI_0 as */ 1135 | +extern const uint_least8_t CONFIG_PIN_SPI_MOSI_CONST; 1136 | +#define CONFIG_PIN_SPI_MOSI 9 1137 | + 1138 | +/* The range of pins available on this device */ 1139 | +extern const uint_least8_t GPIO_pinLowerBound; 1140 | +extern const uint_least8_t GPIO_pinUpperBound; 1141 | + 1142 | +/* LEDs are active high */ 1143 | +#define CONFIG_GPIO_LED_ON (1) 1144 | +#define CONFIG_GPIO_LED_OFF (0) 1145 | + 1146 | +#define CONFIG_LED_ON (CONFIG_GPIO_LED_ON) 1147 | +#define CONFIG_LED_OFF (CONFIG_GPIO_LED_OFF) 1148 | + 1149 | + 1150 | +/* 1151 | + * ======== NVS ======== 1152 | + */ 1153 | + 1154 | +extern const uint_least8_t CONFIG_NVSINTERNAL_CONST; 1155 | +#define CONFIG_NVSINTERNAL 0 1156 | +/* 1157 | + * PICO: DIO9 1158 | + * POCI: DIO8 1159 | + * SCLK: DIO10 1160 | + * LaunchPad SPI Bus 1161 | + * CSN: undefined 1162 | + */ 1163 | +extern const uint_least8_t CONFIG_NVSEXTERNAL_CONST; 1164 | +#define CONFIG_NVSEXTERNAL 1 1165 | +#define CONFIG_TI_DRIVERS_NVS_COUNT 2 1166 | + 1167 | + 1168 | +/* 1169 | + * ======== RF ======== 1170 | + */ 1171 | +#define Board_DIO_30_RFSW 0x0000001e 1172 | + 1173 | + 1174 | +/* 1175 | + * ======== SHA2 ======== 1176 | + */ 1177 | + 1178 | +extern const uint_least8_t CONFIG_SHA2_0_CONST; 1179 | +#define CONFIG_SHA2_0 0 1180 | +#define CONFIG_TI_DRIVERS_SHA2_COUNT 1 1181 | + 1182 | + 1183 | +/* 1184 | + * ======== SPI ======== 1185 | + */ 1186 | + 1187 | +/* 1188 | + * PICO: DIO9 1189 | + * POCI: DIO8 1190 | + * SCLK: DIO10 1191 | + * LaunchPad SPI Bus 1192 | + */ 1193 | +extern const uint_least8_t CONFIG_SPI_0_CONST; 1194 | +#define CONFIG_SPI_0 0 1195 | +#define CONFIG_TI_DRIVERS_SPI_COUNT 1 1196 | + 1197 | + 1198 | +/* 1199 | + * ======== TRNG ======== 1200 | + */ 1201 | + 1202 | +extern const uint_least8_t CONFIG_TRNG_0_CONST; 1203 | +#define CONFIG_TRNG_0 0 1204 | +#define CONFIG_TI_DRIVERS_TRNG_COUNT 1 1205 | + 1206 | + 1207 | +/* 1208 | + * ======== UART2 ======== 1209 | + */ 1210 | + 1211 | +/* 1212 | + * TX: DIO13 1213 | + * RX: DIO12 1214 | + * XDS110 UART 1215 | + */ 1216 | +extern const uint_least8_t CONFIG_DISPLAY_UART_CONST; 1217 | +#define CONFIG_DISPLAY_UART 0 1218 | +#define CONFIG_TI_DRIVERS_UART2_COUNT 1 1219 | + 1220 | + 1221 | +/* 1222 | + * ======== Button ======== 1223 | + */ 1224 | + 1225 | +extern const uint_least8_t CONFIG_BTN_LEFT_CONST; 1226 | +#define CONFIG_BTN_LEFT 0 1227 | +extern const uint_least8_t CONFIG_BTN_RIGHT_CONST; 1228 | +#define CONFIG_BTN_RIGHT 1 1229 | +#define CONFIG_TI_DRIVERS_BUTTON_COUNT 2 1230 | + 1231 | + 1232 | +/* 1233 | + * ======== LED ======== 1234 | + */ 1235 | + 1236 | +extern const uint_least8_t CONFIG_LED_RED_CONST; 1237 | +#define CONFIG_LED_RED 0 1238 | +extern const uint_least8_t CONFIG_LED_GREEN_CONST; 1239 | +#define CONFIG_LED_GREEN 1 1240 | +#define CONFIG_TI_DRIVERS_LED_COUNT 2 1241 | + 1242 | + 1243 | +/* 1244 | + * ======== Board_init ======== 1245 | + * Perform all required TI-Drivers initialization 1246 | + * 1247 | + * This function should be called once at a point before any use of 1248 | + * TI-Drivers. 1249 | + */ 1250 | +extern void Board_init(void); 1251 | + 1252 | +/* 1253 | + * ======== Board_initGeneral ======== 1254 | + * (deprecated) 1255 | + * 1256 | + * Board_initGeneral() is defined purely for backward compatibility. 1257 | + * 1258 | + * All new code should use Board_init() to do any required TI-Drivers 1259 | + * initialization _and_ use _init() for only where specific drivers 1260 | + * are explicitly referenced by the application. _init() functions 1261 | + * are idempotent. 1262 | + */ 1263 | +#define Board_initGeneral Board_init 1264 | + 1265 | +#ifdef __cplusplus 1266 | +} 1267 | +#endif 1268 | + 1269 | +#endif /* include guard */ 1270 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.c b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.c 1271 | new file mode 100644 1272 | index 000000000..27a15e7ca 1273 | --- /dev/null 1274 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.c 1275 | @@ -0,0 +1,385 @@ 1276 | +/* 1277 | + * ======== ti_radio_config.c ======== 1278 | + * Configured RadioConfig module definitions 1279 | + * 1280 | + * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ 1281 | + * by the SysConfig tool. 1282 | + * 1283 | + * Radio Config module version : 1.18.0 1284 | + * SmartRF Studio data version : 2.31.0 1285 | + */ 1286 | + 1287 | +#include "ti_radio_config.h" 1288 | +#include DeviceFamily_constructPath(rf_patches/rf_patch_cpe_ieee_802_15_4.h) 1289 | + 1290 | + 1291 | +// ********************************************************************************* 1292 | +// RF Frontend configuration 1293 | +// ********************************************************************************* 1294 | +// RF design based on: LAUNCHXL-CC1352P-2 1295 | + 1296 | +// TX Power tables 1297 | +// The RF_TxPowerTable_DEFAULT_PA_ENTRY and RF_TxPowerTable_HIGH_PA_ENTRY macros are defined in RF.h. 1298 | +// The following arguments are required: 1299 | +// RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost, coefficient) 1300 | +// RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim) 1301 | +// See the Technical Reference Manual for further details about the "txPower" Command field. 1302 | +// The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. 1303 | + 1304 | +// 868 MHz, 13 dBm 1305 | +RF_TxPowerTable_Entry txPowerTable_868_pa13[TXPOWERTABLE_868_PA13_SIZE] = 1306 | +{ 1307 | + {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) }, // 0x04C0 1308 | + {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 3) }, // 0x06C1 1309 | + {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 5) }, // 0x0AC2 1310 | + {-7, RF_TxPowerTable_DEFAULT_PA_ENTRY(3, 3, 0, 5) }, // 0x0AC3 1311 | + {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) }, // 0x0AC4 1312 | + {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(5, 3, 0, 6) }, // 0x0CC5 1313 | + {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 8) }, // 0x10C8 1314 | + {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 9) }, // 0x12C9 1315 | + {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) }, // 0x12CA 1316 | + {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 10) }, // 0x14CB 1317 | + {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 11) }, // 0x16CD 1318 | + {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 14) }, // 0x1CCE 1319 | + {6, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 3, 0, 16) }, // 0x20D1 1320 | + {7, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 19) }, // 0x26D4 1321 | + {8, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 3, 0, 22) }, // 0x2CD8 1322 | + {9, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 3, 0, 31) }, // 0x3EDC 1323 | + {10, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 2, 0, 31) }, // 0x3E92 1324 | + {11, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 2, 0, 51) }, // 0x669A 1325 | + {12, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 0, 0, 82) }, // 0xA410 1326 | + // The original PA value (12.5 dBm) has been rounded to an integer value. 1327 | + {13, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 0, 89) }, // 0xB224 1328 | + // This setting requires CCFG_FORCE_VDDR_HH = 1. 1329 | + {14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) }, // 0x013F 1330 | + RF_TxPowerTable_TERMINATION_ENTRY 1331 | +}; 1332 | + 1333 | + 1334 | +// 2400 MHz, 5 dBm 1335 | +RF_TxPowerTable_Entry txPowerTable_2400_pa5[TXPOWERTABLE_2400_PA5_SIZE] = 1336 | +{ 1337 | + {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) }, // 0x04C6 1338 | + {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) }, // 0x06C8 1339 | + {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) }, // 0x06CA 1340 | + {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) }, // 0x0ACC 1341 | + {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) }, // 0x0ACF 1342 | + {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) }, // 0x0AD0 1343 | + {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) }, // 0x10D4 1344 | + {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) }, // 0x12D6 1345 | + {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) }, // 0x1893 1346 | + {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) }, // 0x2853 1347 | + {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) }, // 0x2856 1348 | + {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) }, // 0x3259 1349 | + {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) }, // 0x385D 1350 | + {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) }, // 0x4E63 1351 | + {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) }, // 0x7217 1352 | + RF_TxPowerTable_TERMINATION_ENTRY 1353 | +}; 1354 | + 1355 | +// 2400 MHz, 5 + 20 dBm 1356 | +RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[TXPOWERTABLE_2400_PA5_20_SIZE] = 1357 | +{ 1358 | + {-20, RF_TxPowerTable_DEFAULT_PA_ENTRY(6, 3, 0, 2) }, // 0x04C6 1359 | + {-18, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 3) }, // 0x06C8 1360 | + {-15, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 3) }, // 0x06CA 1361 | + {-12, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 5) }, // 0x0ACC 1362 | + {-10, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 3, 0, 5) }, // 0x0ACF 1363 | + {-9, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 5) }, // 0x0AD0 1364 | + {-6, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 0, 8) }, // 0x10D4 1365 | + {-5, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 9) }, // 0x12D6 1366 | + {-3, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 2, 0, 12) }, // 0x1893 1367 | + {0, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 1, 0, 20) }, // 0x2853 1368 | + {1, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 1, 0, 20) }, // 0x2856 1369 | + {2, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 25) }, // 0x3259 1370 | + {3, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 1, 0, 28) }, // 0x385D 1371 | + {4, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 1, 0, 39) }, // 0x4E63 1372 | + {5, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 0, 0, 57) }, // 0x7217 1373 | + 1374 | + // CUSTOM: allow transmit power 6 - 13 dbm 1375 | + {6, .value.rawValue = (0x144f2a), .value.paType = RF_TxPowerTable_HighPA }, 1376 | + {7, .value.rawValue = (0x14285f), .value.paType = RF_TxPowerTable_HighPA }, 1377 | + {8, .value.rawValue = (0x10335a), .value.paType = RF_TxPowerTable_HighPA }, 1378 | + {9, .value.rawValue = (0x103f5f), .value.paType = RF_TxPowerTable_HighPA }, 1379 | + {10, .value.rawValue = (0x104f66), .value.paType = RF_TxPowerTable_HighPA }, 1380 | + {11, .value.rawValue = (0x3021cb), .value.paType = RF_TxPowerTable_HighPA }, 1381 | + {12, .value.rawValue = (0x3f27cc), .value.paType = RF_TxPowerTable_HighPA }, 1382 | + {13, .value.rawValue = (0x3fc3cd), .value.paType = RF_TxPowerTable_HighPA }, 1383 | + 1384 | + {14, RF_TxPowerTable_HIGH_PA_ENTRY(22, 3, 1, 19, 27) }, // 0x1B27D6 1385 | + {15, RF_TxPowerTable_HIGH_PA_ENTRY(26, 3, 1, 23, 27) }, // 0x1B2FDA 1386 | + {16, RF_TxPowerTable_HIGH_PA_ENTRY(30, 3, 1, 28, 27) }, // 0x1B39DE 1387 | + {17, RF_TxPowerTable_HIGH_PA_ENTRY(37, 3, 1, 39, 27) }, // 0x1B4FE5 1388 | + {18, RF_TxPowerTable_HIGH_PA_ENTRY(32, 3, 1, 35, 48) }, // 0x3047E0 1389 | + {19, RF_TxPowerTable_HIGH_PA_ENTRY(34, 3, 1, 48, 63) }, // 0x3F61E2 1390 | + {20, RF_TxPowerTable_HIGH_PA_ENTRY(53, 3, 1, 58, 63) }, // 0x3F75F5 1391 | + RF_TxPowerTable_TERMINATION_ENTRY 1392 | +}; 1393 | + 1394 | + 1395 | + 1396 | +//********************************************************************************* 1397 | +// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8 1398 | +// 1399 | +// PHY: ieee154 1400 | +// Setting file: setting_ieee_802_15_4.json 1401 | +//********************************************************************************* 1402 | + 1403 | +// PARAMETER SUMMARY 1404 | +// Channel - Frequency (MHz): 2405 1405 | +// TX Power (dBm): 20 1406 | + 1407 | +// TI-RTOS RF Mode Object 1408 | +RF_Mode RF_prop_ieee154 = 1409 | +{ 1410 | + .rfMode = RF_MODE_AUTO, 1411 | + .cpePatchFxn = &rf_patch_cpe_ieee_802_15_4, 1412 | + .mcePatchFxn = 0, 1413 | + .rfePatchFxn = 0 1414 | +}; 1415 | + 1416 | +// Overrides for CMD_RADIO_SETUP_PA 1417 | +uint32_t pOverrides_ieee154[] = 1418 | +{ 1419 | + // override_ieee_802_15_4.json 1420 | + // Rx: Set LNA bias current offset to +15 to saturate trim to max (default: 0) 1421 | + (uint32_t)0x000F8883, 1422 | + // Tx: Set DCDC settings IPEAK=3, dither = off 1423 | + (uint32_t)0x00F388D3, 1424 | + (uint32_t)0xFFFFFFFF 1425 | +}; 1426 | + 1427 | +// Overrides for CMD_RADIO_SETUP_PA 1428 | +uint32_t pOverrides_ieee154TxStd[] = 1429 | +{ 1430 | + // override_txstd_placeholder.json 1431 | + // TX Standard power override 1432 | + TX_STD_POWER_OVERRIDE(0x7217), 1433 | + // The ANADIV radio parameter based on LO divider and front end settings 1434 | + (uint32_t)0x05320703, 1435 | + // override_txstd_settings.json 1436 | + // Set RTIM offset to default for standard PA 1437 | + (uint32_t)0x00008783, 1438 | + // Set synth mux to default value for standard PA 1439 | + (uint32_t)0x050206C3, 1440 | + // Set TXRX pin to 0 in RX and high impedance in idle/TX. 1441 | + HW_REG_OVERRIDE(0x60A8,0x0401), 1442 | + (uint32_t)0xFFFFFFFF 1443 | +}; 1444 | + 1445 | +// Overrides for CMD_RADIO_SETUP_PA 1446 | +uint32_t pOverrides_ieee154Tx20[] = 1447 | +{ 1448 | + // override_tx20_placeholder.json 1449 | + // TX HighPA power override 1450 | + TX20_POWER_OVERRIDE(0x003F75F5), 1451 | + // The ANADIV radio parameter based on LO divider and front end settings 1452 | + (uint32_t)0x01C20703, 1453 | + // override_tx20_settings.json 1454 | + // Set RTIM offset to 3 for high power PA 1455 | + (uint32_t)0x00038783, 1456 | + // Set synth mux for high power PA 1457 | + (uint32_t)0x010206C3, 1458 | + // Set TXRX pin to 0 in RX/TX and high impedance in idle. 1459 | + HW_REG_OVERRIDE(0x60A8,0x0001), 1460 | + (uint32_t)0xFFFFFFFF 1461 | +}; 1462 | + 1463 | + 1464 | + 1465 | +// CMD_RADIO_SETUP_PA 1466 | +// Radio Setup Command for Pre-Defined Schemes 1467 | +const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154 = 1468 | +{ 1469 | + .commandNo = 0x0802, 1470 | + .status = 0x0000, 1471 | + .pNextOp = 0, 1472 | + .startTime = 0x00000000, 1473 | + .startTrigger.triggerType = 0x0, 1474 | + .startTrigger.bEnaCmd = 0x0, 1475 | + .startTrigger.triggerNo = 0x0, 1476 | + .startTrigger.pastTrig = 0x0, 1477 | + .condition.rule = 0x1, 1478 | + .condition.nSkip = 0x0, 1479 | + .mode = 0x01, 1480 | + .loDivider = 0x00, 1481 | + .config.frontEndMode = 0x0, 1482 | + .config.biasMode = 0x1, 1483 | + .config.analogCfgMode = 0x0, 1484 | + .config.bNoFsPowerUp = 0x0, 1485 | + .config.bSynthNarrowBand = 0x0, 1486 | + .txPower = 0xFFFF, 1487 | + .pRegOverride = pOverrides_ieee154, 1488 | + .pRegOverrideTxStd = pOverrides_ieee154TxStd, 1489 | + .pRegOverrideTx20 = pOverrides_ieee154Tx20 1490 | +}; 1491 | + 1492 | +// CMD_FS 1493 | +// Frequency Synthesizer Programming Command 1494 | +const rfc_CMD_FS_t RF_cmdFs_ieee154 = 1495 | +{ 1496 | + .commandNo = 0x0803, 1497 | + .status = 0x0000, 1498 | + .pNextOp = 0, 1499 | + .startTime = 0x00000000, 1500 | + .startTrigger.triggerType = 0x0, 1501 | + .startTrigger.bEnaCmd = 0x0, 1502 | + .startTrigger.triggerNo = 0x0, 1503 | + .startTrigger.pastTrig = 0x0, 1504 | + .condition.rule = 0x1, 1505 | + .condition.nSkip = 0x0, 1506 | + .frequency = 0x0965, 1507 | + .fractFreq = 0x0000, 1508 | + .synthConf.bTxMode = 0x0, 1509 | + .synthConf.refFreq = 0x0, 1510 | + .__dummy0 = 0x00, 1511 | + .__dummy1 = 0x00, 1512 | + .__dummy2 = 0x00, 1513 | + .__dummy3 = 0x0000 1514 | +}; 1515 | + 1516 | +// CMD_IEEE_TX 1517 | +// IEEE 802.15.4 Transmit Command 1518 | +const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154 = 1519 | +{ 1520 | + .commandNo = 0x2C01, 1521 | + .status = 0x0000, 1522 | + .pNextOp = 0, 1523 | + .startTime = 0x00000000, 1524 | + .startTrigger.triggerType = 0x0, 1525 | + .startTrigger.bEnaCmd = 0x0, 1526 | + .startTrigger.triggerNo = 0x0, 1527 | + .startTrigger.pastTrig = 0x0, 1528 | + .condition.rule = 0x1, 1529 | + .condition.nSkip = 0x0, 1530 | + .txOpt.bIncludePhyHdr = 0x0, 1531 | + .txOpt.bIncludeCrc = 0x0, 1532 | + .txOpt.payloadLenMsb = 0x0, 1533 | + .payloadLen = 0x1E, 1534 | + .pPayload = 0, 1535 | + .timeStamp = 0x00000000 1536 | +}; 1537 | + 1538 | +// CMD_IEEE_RX 1539 | +// IEEE 802.15.4 Receive Command 1540 | +const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154 = 1541 | +{ 1542 | + .commandNo = 0x2801, 1543 | + .status = 0x0000, 1544 | + .pNextOp = 0, 1545 | + .startTime = 0x00000000, 1546 | + .startTrigger.triggerType = 0x0, 1547 | + .startTrigger.bEnaCmd = 0x0, 1548 | + .startTrigger.triggerNo = 0x0, 1549 | + .startTrigger.pastTrig = 0x0, 1550 | + .condition.rule = 0x1, 1551 | + .condition.nSkip = 0x0, 1552 | + .channel = 0x00, 1553 | + .rxConfig.bAutoFlushCrc = 0x0, 1554 | + .rxConfig.bAutoFlushIgn = 0x0, 1555 | + .rxConfig.bIncludePhyHdr = 0x0, 1556 | + .rxConfig.bIncludeCrc = 0x0, 1557 | + .rxConfig.bAppendRssi = 0x1, 1558 | + .rxConfig.bAppendCorrCrc = 0x1, 1559 | + .rxConfig.bAppendSrcInd = 0x0, 1560 | + .rxConfig.bAppendTimestamp = 0x0, 1561 | + .pRxQ = 0, 1562 | + .pOutput = 0, 1563 | + .frameFiltOpt.frameFiltEn = 0x0, 1564 | + .frameFiltOpt.frameFiltStop = 0x0, 1565 | + .frameFiltOpt.autoAckEn = 0x0, 1566 | + .frameFiltOpt.slottedAckEn = 0x0, 1567 | + .frameFiltOpt.autoPendEn = 0x0, 1568 | + .frameFiltOpt.defaultPend = 0x0, 1569 | + .frameFiltOpt.bPendDataReqOnly = 0x0, 1570 | + .frameFiltOpt.bPanCoord = 0x0, 1571 | + .frameFiltOpt.maxFrameVersion = 0x3, 1572 | + .frameFiltOpt.fcfReservedMask = 0x0, 1573 | + .frameFiltOpt.modifyFtFilter = 0x0, 1574 | + .frameFiltOpt.bStrictLenFilter = 0x0, 1575 | + .frameTypes.bAcceptFt0Beacon = 0x1, 1576 | + .frameTypes.bAcceptFt1Data = 0x1, 1577 | + .frameTypes.bAcceptFt2Ack = 0x1, 1578 | + .frameTypes.bAcceptFt3MacCmd = 0x1, 1579 | + .frameTypes.bAcceptFt4Reserved = 0x1, 1580 | + .frameTypes.bAcceptFt5Reserved = 0x1, 1581 | + .frameTypes.bAcceptFt6Reserved = 0x1, 1582 | + .frameTypes.bAcceptFt7Reserved = 0x1, 1583 | + .ccaOpt.ccaEnEnergy = 0x0, 1584 | + .ccaOpt.ccaEnCorr = 0x0, 1585 | + .ccaOpt.ccaEnSync = 0x0, 1586 | + .ccaOpt.ccaCorrOp = 0x1, 1587 | + .ccaOpt.ccaSyncOp = 0x1, 1588 | + .ccaOpt.ccaCorrThr = 0x0, 1589 | + .ccaRssiThr = 0x64, 1590 | + .__dummy0 = 0x00, 1591 | + .numExtEntries = 0x00, 1592 | + .numShortEntries = 0x00, 1593 | + .pExtEntryList = 0, 1594 | + .pShortEntryList = 0, 1595 | + .localExtAddr = 0x12345678, 1596 | + .localShortAddr = 0xABBA, 1597 | + .localPanID = 0x0000, 1598 | + .__dummy1 = 0x000000, 1599 | + .endTrigger.triggerType = 0x1, 1600 | + .endTrigger.bEnaCmd = 0x0, 1601 | + .endTrigger.triggerNo = 0x0, 1602 | + .endTrigger.pastTrig = 0x0, 1603 | + .endTime = 0x00000000 1604 | +}; 1605 | + 1606 | +// CMD_IEEE_CSMA 1607 | +// IEEE 802.15.4 CSMA-CA Command 1608 | +const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154 = 1609 | +{ 1610 | + .commandNo = 0x2C02, 1611 | + .status = 0x0000, 1612 | + .pNextOp = 0, 1613 | + .startTime = 0x00000000, 1614 | + .startTrigger.triggerType = 0x0, 1615 | + .startTrigger.bEnaCmd = 0x0, 1616 | + .startTrigger.triggerNo = 0x0, 1617 | + .startTrigger.pastTrig = 0x0, 1618 | + .condition.rule = 0x0, 1619 | + .condition.nSkip = 0x0, 1620 | + .randomState = 0x0000, 1621 | + .macMaxBE = 0x00, 1622 | + .macMaxCSMABackoffs = 0x00, 1623 | + .csmaConfig.initCW = 0x0, 1624 | + .csmaConfig.bSlotted = 0x0, 1625 | + .csmaConfig.rxOffMode = 0x0, 1626 | + .NB = 0x00, 1627 | + .BE = 0x00, 1628 | + .remainingPeriods = 0x00, 1629 | + .lastRssi = 0x00, 1630 | + .endTrigger.triggerType = 0x0, 1631 | + .endTrigger.bEnaCmd = 0x0, 1632 | + .endTrigger.triggerNo = 0x0, 1633 | + .endTrigger.pastTrig = 0x0, 1634 | + .lastTimeStamp = 0x00000000, 1635 | + .endTime = 0x00000000 1636 | +}; 1637 | + 1638 | +// CMD_IEEE_RX_ACK 1639 | +// IEEE 802.15.4 Receive Acknowledgement Command 1640 | +const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154 = 1641 | +{ 1642 | + .commandNo = 0x2C03, 1643 | + .status = 0x0000, 1644 | + .pNextOp = 0, 1645 | + .startTime = 0x00000000, 1646 | + .startTrigger.triggerType = 0x0, 1647 | + .startTrigger.bEnaCmd = 0x0, 1648 | + .startTrigger.triggerNo = 0x0, 1649 | + .startTrigger.pastTrig = 0x0, 1650 | + .condition.rule = 0x0, 1651 | + .condition.nSkip = 0x0, 1652 | + .seqNo = 0x00, 1653 | + .endTrigger.triggerType = 0x0, 1654 | + .endTrigger.bEnaCmd = 0x0, 1655 | + .endTrigger.triggerNo = 0x0, 1656 | + .endTrigger.pastTrig = 0x0, 1657 | + .endTime = 0x00000000 1658 | +}; 1659 | + 1660 | + 1661 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.h b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.h 1662 | new file mode 100644 1663 | index 000000000..8ab9a83da 1664 | --- /dev/null 1665 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/ti_radio_config.h 1666 | @@ -0,0 +1,83 @@ 1667 | +/* 1668 | + * ======== ti_radio_config.h ======== 1669 | + * Configured RadioConfig module definitions 1670 | + * 1671 | + * DO NOT EDIT - This file is generated for the CC1352P1F3RGZ 1672 | + * by the SysConfig tool. 1673 | + * 1674 | + * Radio Config module version : 1.18.0 1675 | + * SmartRF Studio data version : 2.31.0 1676 | + */ 1677 | +#ifndef _TI_RADIO_CONFIG_H_ 1678 | +#define _TI_RADIO_CONFIG_H_ 1679 | + 1680 | +#include 1681 | +#include DeviceFamily_constructPath(driverlib/rf_mailbox.h) 1682 | +#include DeviceFamily_constructPath(driverlib/rf_common_cmd.h) 1683 | +#include DeviceFamily_constructPath(driverlib/rf_ieee_cmd.h) 1684 | +#include 1685 | + 1686 | +/* SmartRF Studio version that the RF data is fetched from */ 1687 | +#define SMARTRF_STUDIO_VERSION "2.31.0" 1688 | + 1689 | +// ********************************************************************************* 1690 | +// RF Frontend configuration 1691 | +// ********************************************************************************* 1692 | +// RF design based on: LAUNCHXL-CC1352P-2 1693 | +#define LAUNCHXL_CC1352P_2 1694 | + 1695 | +// High-Power Amplifier supported 1696 | +#define SUPPORT_HIGH_PA 1697 | + 1698 | +// RF frontend configuration 1699 | +#define FRONTEND_SUB1G_DIFF_RF 1700 | +#define FRONTEND_SUB1G_EXT_BIAS 1701 | +#define FRONTEND_24G_DIFF_RF 1702 | +#define FRONTEND_24G_EXT_BIAS 1703 | + 1704 | +// Supported frequency bands 1705 | +#define SUPPORT_FREQBAND_868 1706 | +#define SUPPORT_FREQBAND_2400 1707 | + 1708 | +// TX power table size definitions 1709 | +#define TXPOWERTABLE_868_PA13_SIZE 22 // 868 MHz, 13 dBm 1710 | +#define TXPOWERTABLE_2400_PA5_SIZE 16 // 2400 MHz, 5 dBm 1711 | +// CUSTOM: account for extra entities in ti_radio_config.c txPowerTable_2400_pa5_20 1712 | +#define TXPOWERTABLE_2400_PA5_20_SIZE 31 // 2400 MHz, 5 + 20 dBm 1713 | + 1714 | +// TX power tables 1715 | +extern RF_TxPowerTable_Entry txPowerTable_868_pa13[]; // 868 MHz, 13 dBm 1716 | +extern RF_TxPowerTable_Entry txPowerTable_2400_pa5[]; // 2400 MHz, 5 dBm 1717 | +extern RF_TxPowerTable_Entry txPowerTable_2400_pa5_20[]; // 2400 MHz, 5 + 20 dBm 1718 | + 1719 | + 1720 | + 1721 | +//********************************************************************************* 1722 | +// RF Setting: IEEE 802.15.4-2006, 250 kbps, OQPSK, DSSS = 1:8 1723 | +// 1724 | +// PHY: ieee154 1725 | +// Setting file: setting_ieee_802_15_4.json 1726 | +//********************************************************************************* 1727 | + 1728 | +// PA table usage 1729 | +#define TX_POWER_TABLE_SIZE_ieee154 TXPOWERTABLE_2400_PA5_20_SIZE 1730 | + 1731 | +#define txPowerTable_ieee154 txPowerTable_2400_pa5_20 1732 | + 1733 | +// TI-RTOS RF Mode object 1734 | +extern RF_Mode RF_prop_ieee154; 1735 | + 1736 | +// RF Core API commands 1737 | +extern const rfc_CMD_RADIO_SETUP_PA_t RF_cmdRadioSetup_ieee154; 1738 | +extern const rfc_CMD_FS_t RF_cmdFs_ieee154; 1739 | +extern const rfc_CMD_IEEE_TX_t RF_cmdIeeeTx_ieee154; 1740 | +extern const rfc_CMD_IEEE_RX_t RF_cmdIeeeRx_ieee154; 1741 | +extern const rfc_CMD_IEEE_CSMA_t RF_cmdIeeeCsma_ieee154; 1742 | +extern const rfc_CMD_IEEE_RX_ACK_t RF_cmdIeeeRxAck_ieee154; 1743 | + 1744 | +// RF Core API overrides 1745 | +extern uint32_t pOverrides_ieee154[]; 1746 | +extern uint32_t pOverrides_ieee154TxStd[]; 1747 | +extern uint32_t pOverrides_ieee154Tx20[]; 1748 | + 1749 | +#endif // _TI_RADIO_CONFIG_H_ 1750 | diff --git a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/znp.syscfg b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1751 | index 060717f99..f7c0bd319 100644 1752 | --- a/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1753 | +++ b/workspace/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1754 | @@ -4,6 +4,10 @@ 1755 | * @cliArgs --board "/ti/boards/CC1352P_2_LAUNCHXL" --rtos "tirtos7" --product "simplelink_cc13xx_cc26xx_sdk@7.41.00.17" 1756 | * @versions {"tool":"1.19.0+3426"} 1757 | */ 1758 | +scripting.excludeFromBuild("ti_devices_config.c"); 1759 | +scripting.excludeFromBuild("ti_radio_config.c"); 1760 | +scripting.excludeFromBuild("ti_radio_config.h"); 1761 | +scripting.excludeFromBuild("ti_drivers_config.h"); 1762 | 1763 | /** 1764 | * Import the modules used in this configuration. 1765 | @@ -65,6 +69,7 @@ CCFG.enableBootloaderBackdoor = true; 1766 | CCFG.dioBootloaderBackdoor = 15; 1767 | CCFG.levelBootloaderBackdoor = "Active low"; 1768 | CCFG.forceVddr = true; 1769 | +CCFG.enableDCDC = false; 1770 | CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0"; 1771 | 1772 | rfdesign.rfDesign = "LAUNCHXL-CC1352P-2"; 1773 | @@ -87,8 +92,8 @@ ECDSA1.$name = "CONFIG_ECDSA_0"; 1774 | 1775 | NVS1.$name = "CONFIG_NVSINTERNAL"; 1776 | NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; 1777 | -NVS1.internalFlash.regionSize = 0x4000; 1778 | -NVS1.internalFlash.regionBase = 0x52000; 1779 | +NVS1.internalFlash.regionSize = 0x6000; 1780 | +NVS1.internalFlash.regionBase = 0x50000; 1781 | 1782 | NVS2.$name = "CONFIG_NVSEXTERNAL"; 1783 | NVS2.nvsType = "External"; 1784 | @@ -178,6 +183,7 @@ zstack.deviceTypeReadOnly = true; 1785 | zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0"; 1786 | zstack.pm.$name = "ti_zstack_pm_zstack_pm0"; 1787 | zstack.rf.$name = "ti_zstack_rf_zstack_rf0"; 1788 | +zstack.rf.txPower = "20"; 1789 | zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; 1790 | zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; 1791 | zstack.rf.coexSettings.$name = "ti_zstack_rf_zstack_coex_mod0"; 1792 | diff --git a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/.project b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/.project 1793 | index 546dd8fec..5abbb67b0 100644 1794 | --- a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/.project 1795 | +++ b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/.project 1796 | @@ -450,6 +450,11 @@ 1797 | 1 1798 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h 1799 | 1800 | + 1801 | + Stack/Config/preinclude.h 1802 | + 1 1803 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h 1804 | + 1805 | 1806 | Stack/MAC/mac_api.h 1807 | 1 1808 | @@ -715,6 +720,11 @@ 1809 | 1 1810 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h 1811 | 1812 | + 1813 | + Stack/nwk/nwk_util.c 1814 | + 1 1815 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c 1816 | + 1817 | 1818 | Stack/nwk/reflecttrack.h 1819 | 1 1820 | diff --git a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1821 | index 2a7704196..2e9e7ac6e 100644 1822 | --- a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1823 | +++ b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1824 | @@ -32,3 +32,5 @@ 1825 | -DMT_GP_CB_FUNC 1826 | 1827 | -DMT_APP_CNF_FUNC 1828 | + 1829 | +-include ../../../source/ti/zstack/stack/Config/preinclude.h 1830 | diff --git a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/znp.syscfg b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1831 | index 86adae3d1..6165052f4 100644 1832 | --- a/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1833 | +++ b/workspace/znp_CC26X2R1_LAUNCHXL_tirtos7_ticlang/znp.syscfg 1834 | @@ -62,6 +62,7 @@ CCFG.enableBootloader = true; 1835 | CCFG.enableBootloaderBackdoor = true; 1836 | CCFG.dioBootloaderBackdoor = 13; 1837 | CCFG.levelBootloaderBackdoor = "Active low"; 1838 | +CCFG.enableDCDC = false; 1839 | CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0"; 1840 | 1841 | Display1.$hardware = system.deviceData.board.components.XDS110UART; 1842 | @@ -82,8 +83,8 @@ ECDSA1.$name = "CONFIG_ECDSA_0"; 1843 | 1844 | NVS1.$name = "CONFIG_NVSINTERNAL"; 1845 | NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; 1846 | -NVS1.internalFlash.regionSize = 0x4000; 1847 | -NVS1.internalFlash.regionBase = 0x52000; 1848 | +NVS1.internalFlash.regionBase = 0x50000; 1849 | +NVS1.internalFlash.regionSize = 0x6000; 1850 | 1851 | NVS2.$name = "CONFIG_NVSEXTERNAL"; 1852 | NVS2.nvsType = "External"; 1853 | @@ -171,6 +172,7 @@ zstack.deviceTypeReadOnly = true; 1854 | zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0"; 1855 | zstack.pm.$name = "ti_zstack_pm_zstack_pm0"; 1856 | zstack.rf.$name = "ti_zstack_rf_zstack_rf0"; 1857 | +zstack.rf.txPower = "5"; 1858 | zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; 1859 | zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; 1860 | zstack.rf.coexSettings.$name = "ti_zstack_rf_zstack_coex_mod0"; 1861 | diff --git a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/.project b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/.project 1862 | index a1c7085b5..63a8481bc 100644 1863 | --- a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/.project 1864 | +++ b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/.project 1865 | @@ -450,6 +450,11 @@ 1866 | 1 1867 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h 1868 | 1869 | + 1870 | + Stack/Config/preinclude.h 1871 | + 1 1872 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h 1873 | + 1874 | 1875 | Stack/MAC/mac_api.h 1876 | 1 1877 | @@ -715,6 +720,11 @@ 1878 | 1 1879 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h 1880 | 1881 | + 1882 | + Stack/nwk/nwk_util.c 1883 | + 1 1884 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c 1885 | + 1886 | 1887 | Stack/nwk/reflecttrack.h 1888 | 1 1889 | diff --git a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1890 | index 2a7704196..2e9e7ac6e 100644 1891 | --- a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1892 | +++ b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1893 | @@ -32,3 +32,5 @@ 1894 | -DMT_GP_CB_FUNC 1895 | 1896 | -DMT_APP_CNF_FUNC 1897 | + 1898 | +-include ../../../source/ti/zstack/stack/Config/preinclude.h 1899 | diff --git a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/znp.syscfg b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/znp.syscfg 1900 | index 19fb762aa..d75acd21e 100644 1901 | --- a/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/znp.syscfg 1902 | +++ b/workspace/znp_LP_CC1352P7_4_tirtos7_ticlang/znp.syscfg 1903 | @@ -64,6 +64,7 @@ CCFG.enableBootloader = true; 1904 | CCFG.enableBootloaderBackdoor = true; 1905 | CCFG.dioBootloaderBackdoor = 15; 1906 | CCFG.levelBootloaderBackdoor = "Active low"; 1907 | +CCFG.enableDCDC = false; 1908 | CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0"; 1909 | 1910 | rfdesign.rfDesign = "LP_CC1352P7-4"; 1911 | @@ -86,8 +87,8 @@ ECDSA1.$name = "CONFIG_ECDSA_0"; 1912 | 1913 | NVS1.$name = "CONFIG_NVSINTERNAL"; 1914 | NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; 1915 | -NVS1.internalFlash.regionSize = 0x4000; 1916 | -NVS1.internalFlash.regionBase = 0xAA000; 1917 | +NVS1.internalFlash.regionSize = 0x8000; 1918 | +NVS1.internalFlash.regionBase = 0xA6000; 1919 | 1920 | NVS2.$name = "CONFIG_NVSEXTERNAL"; 1921 | NVS2.nvsType = "External"; 1922 | @@ -177,6 +178,7 @@ zstack.deviceTypeReadOnly = true; 1923 | zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0"; 1924 | zstack.pm.$name = "ti_zstack_pm_zstack_pm0"; 1925 | zstack.rf.$name = "ti_zstack_rf_zstack_rf0"; 1926 | +zstack.rf.txPower = "10"; 1927 | zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; 1928 | zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; 1929 | zstack.rf.coexSettings.$name = "ti_zstack_rf_zstack_coex_mod0"; 1930 | diff --git a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/.project b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/.project 1931 | index 7391bc144..21e0fb34b 100644 1932 | --- a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/.project 1933 | +++ b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/.project 1934 | @@ -450,6 +450,11 @@ 1935 | 1 1936 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h 1937 | 1938 | + 1939 | + Stack/Config/preinclude.h 1940 | + 1 1941 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h 1942 | + 1943 | 1944 | Stack/MAC/mac_api.h 1945 | 1 1946 | @@ -715,6 +720,11 @@ 1947 | 1 1948 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h 1949 | 1950 | + 1951 | + Stack/nwk/nwk_util.c 1952 | + 1 1953 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c 1954 | + 1955 | 1956 | Stack/nwk/reflecttrack.h 1957 | 1 1958 | diff --git a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1959 | index 2a7704196..11938012f 100644 1960 | --- a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1961 | +++ b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/Stack/Config/znp_cnf.opts 1962 | @@ -32,3 +32,5 @@ 1963 | -DMT_GP_CB_FUNC 1964 | 1965 | -DMT_APP_CNF_FUNC 1966 | + 1967 | +-include ../../../source/ti/zstack/stack/Config/preinclude.h 1968 | \ No newline at end of file 1969 | diff --git a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/znp.syscfg b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/znp.syscfg 1970 | index 25a951dcb..259337169 100644 1971 | --- a/workspace/znp_LP_CC2652R7_tirtos7_ticlang/znp.syscfg 1972 | +++ b/workspace/znp_LP_CC2652R7_tirtos7_ticlang/znp.syscfg 1973 | @@ -62,6 +62,7 @@ CCFG.enableBootloader = true; 1974 | CCFG.enableBootloaderBackdoor = true; 1975 | CCFG.dioBootloaderBackdoor = 13; 1976 | CCFG.levelBootloaderBackdoor = "Active low"; 1977 | +CCFG.enableDCDC = false; 1978 | CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0"; 1979 | 1980 | Display1.$hardware = system.deviceData.board.components.XDS110UART; 1981 | @@ -82,8 +83,8 @@ ECDSA1.$name = "CONFIG_ECDSA_0"; 1982 | 1983 | NVS1.$name = "CONFIG_NVSINTERNAL"; 1984 | NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; 1985 | -NVS1.internalFlash.regionSize = 0x4000; 1986 | -NVS1.internalFlash.regionBase = 0xAA000; 1987 | +NVS1.internalFlash.regionSize = 0x8000; 1988 | +NVS1.internalFlash.regionBase = 0xA6000; 1989 | 1990 | NVS2.$name = "CONFIG_NVSEXTERNAL"; 1991 | NVS2.nvsType = "External"; 1992 | @@ -171,6 +172,7 @@ zstack.deviceTypeReadOnly = true; 1993 | zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0"; 1994 | zstack.pm.$name = "ti_zstack_pm_zstack_pm0"; 1995 | zstack.rf.$name = "ti_zstack_rf_zstack_rf0"; 1996 | +zstack.rf.txPower = "5"; 1997 | zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; 1998 | zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; 1999 | zstack.rf.coexSettings.$name = "ti_zstack_rf_zstack_coex_mod0"; 2000 | diff --git a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/.project b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/.project 2001 | index 713e60098..29346400d 100644 2002 | --- a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/.project 2003 | +++ b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/.project 2004 | @@ -450,6 +450,11 @@ 2005 | 1 2006 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/ti154stack/common/boards/mac_user_config.h 2007 | 2008 | + 2009 | + Stack/Config/preinclude.h 2010 | + 1 2011 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/Config/preinclude.h 2012 | + 2013 | 2014 | Stack/MAC/mac_api.h 2015 | 1 2016 | @@ -715,6 +720,11 @@ 2017 | 1 2018 | COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.h 2019 | 2020 | + 2021 | + Stack/nwk/nwk_util.c 2022 | + 1 2023 | + COM_TI_SIMPLELINK_CC13XX_CC26XX_SDK_INSTALL_DIR/source/ti/zstack/stack/nwk/nwk_util.c 2024 | + 2025 | 2026 | Stack/nwk/reflecttrack.h 2027 | 1 2028 | diff --git a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/Stack/Config/znp_cnf.opts b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/Stack/Config/znp_cnf.opts 2029 | index 2a7704196..2e9e7ac6e 100644 2030 | --- a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/Stack/Config/znp_cnf.opts 2031 | +++ b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/Stack/Config/znp_cnf.opts 2032 | @@ -32,3 +32,5 @@ 2033 | -DMT_GP_CB_FUNC 2034 | 2035 | -DMT_APP_CNF_FUNC 2036 | + 2037 | +-include ../../../source/ti/zstack/stack/Config/preinclude.h 2038 | diff --git a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/znp.syscfg b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/znp.syscfg 2039 | index e7e6ef110..83b74db04 100644 2040 | --- a/workspace/znp_LP_CC2652RB_tirtos7_ticlang/znp.syscfg 2041 | +++ b/workspace/znp_LP_CC2652RB_tirtos7_ticlang/znp.syscfg 2042 | @@ -63,6 +63,7 @@ CCFG.enableBootloaderBackdoor = true; 2043 | CCFG.dioBootloaderBackdoor = 13; 2044 | CCFG.levelBootloaderBackdoor = "Active low"; 2045 | CCFG.srcClkLF = "Derived from HF XOSC"; 2046 | +CCFG.enableDCDC = false; 2047 | CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0"; 2048 | 2049 | Display1.$hardware = system.deviceData.board.components.XDS110UART; 2050 | @@ -83,8 +84,8 @@ ECDSA1.$name = "CONFIG_ECDSA_0"; 2051 | 2052 | NVS1.$name = "CONFIG_NVSINTERNAL"; 2053 | NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; 2054 | -NVS1.internalFlash.regionSize = 0x4000; 2055 | -NVS1.internalFlash.regionBase = 0x52000; 2056 | +NVS1.internalFlash.regionBase = 0x50000; 2057 | +NVS1.internalFlash.regionSize = 0x6000; 2058 | 2059 | NVS2.$name = "CONFIG_NVSEXTERNAL"; 2060 | NVS2.nvsType = "External"; 2061 | @@ -172,6 +173,7 @@ zstack.deviceTypeReadOnly = true; 2062 | zstack.touchlink.$name = "ti_zstack_touchlink_zstack_touchlink0"; 2063 | zstack.pm.$name = "ti_zstack_pm_zstack_pm0"; 2064 | zstack.rf.$name = "ti_zstack_rf_zstack_rf0"; 2065 | +zstack.rf.txPower = "5"; 2066 | zstack.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; 2067 | zstack.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; 2068 | zstack.rf.coexSettings.$name = "ti_zstack_rf_zstack_coex_mod0"; 2069 | -- 2070 | 2.41.0 2071 | 2072 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 20211115/20211116 2 | - Fix joining not working when joining is only permitted on specific router 3 | - Forward message to host even when profileID does not match 4 | - Turn on/off leds when joining is enabled/disabled 5 | - Fix CC2530 crashing when sending large messages via UART 6 | - Fix Xiaomi E1 devices not (fully) working 7 | 8 | # 20201127/20201128 9 | - Fix join failing after some uptime 10 | - Support PGC410EU 11 | - Fix incorrect route usage with source routing firmware 12 | 13 | # 20190619 14 | - Make source routing firmware identical to 20190315 MAX_STABILITY 15 | 16 | # 20190611 17 | - Attempt to improve source routing firmware 18 | 19 | # 20190608 20 | - One firmware doesn't seem to be feasible, also add source routing firmware 21 | 22 | # 20190608 23 | - Try with source routing disabled and more XDATA 24 | 25 | # 20190523 26 | - Re-enable source routing 27 | 28 | # 20190515 29 | - CC2530_CC2591 and CC2530_CC2592 only; fix transmit power (yes, again, finally) 30 | 31 | # 20190513 32 | - CC2530_CC2591 and CC2530_CC2592 only; fix transmit power (yes, again) 33 | 34 | # 20190507 35 | - CC2530_CC2591 and CC2530_CC2592 only; fix transmit power 36 | 37 | # 20190425 38 | - Unified firmwares, only one firmware for every device 39 | - Increased direct children to 25 for CC2531 and 21 for CC2530 40 | - Disabled source routing 41 | - Decreased XDATA size 42 | 43 | # 20190315 44 | - Restructured repo 45 | - Added `MAX_STABILITY` firmware 46 | 47 | # 20190223 48 | - Reduced memory footprint 49 | - Increased number of routes to remember to 40 50 | - Disabled route expiry 51 | 52 | # 20190222 53 | - Decreased binding and group table size to 1, allows for more memory allocated to the heap. It's not used by Zigbee2MQTT anyway. 54 | - Reverted size of data buffers to default, a buffer full error is now properly handled by Zigbee2MQTT. 55 | 56 | # 20190218 57 | - Fixed `MAXMEMHEAP` 58 | - Forward messages to endpoint 10 and 11 to 1. 59 | 60 | # 20190217 61 | - Forward incoming messages from all groups (not only the ones that are in the group list) 62 | 63 | # 20190215 64 | - Re-flash firmware without having to repair devices. 65 | - Fixed error 17 when executing many group commands at once. -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/COMPILE.md: -------------------------------------------------------------------------------- 1 | # Compiling the firmware 2 | 3 | ## Setup development environment 4 | 1. Download and install [Z-STACK-HOME 1.2.2a](http://www.ti.com/tool/z-stack-archive). 5 | 2. Download and install [IAR Embedded Workbench for 8051](https://www.iar.com/iar-embedded-workbench/#!?architecture=8051). 6 | 7 | *NOTE: For IAR Embedded Workbench for 8051 you need either the full (paid) version or the 30-days evaluation version.* 8 | 9 | ## Compiling 10 | 1. Copy `firmware.patch` to `Z-Stack Home 1.2.2a.44539` 11 | 2. Open Git Bash, go to `Z-Stack Home 1.2.2a.44539` and apply the patch using `git apply firmware.patch --ignore-space-change`. 12 | 3. Open `Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\znp.eww` with IAR Embedded workbench for 8051. 13 | 4. You will get a warning: *The project file 'CC253(0/1).ewp' is in an old format. Would you like to convert it for use with this version?*. Press **yes** for both. 14 | 5. Select the correct target: 15 | - For CC2531 select *CC2531 - X* 16 | - For CC2530, CC2530_CC2591, CC2530_CC2592 select *CC2530 - X* 17 | - Depending if you want to compile the `.hex` or SBL firmware select *- ProdHex* or *- ProdSBL* 18 | 6. Right-click on your target and press options. Go to C/C++ compiler -> preprocessor. **Remove** all *Defined symbols* and depending on what you want to compile, add the following symbols to *Defined symbols*: 19 | - Device type: `FIRMWARE_CC2530`, `FIRMWARE_CC2530_CC2591`, `FIRMWARE_CC2531` or `FIRMWARE_CC2530_CC2592` 20 | - If you chose for *- ProdSBL* add `FIRMWARE_SBL`. 21 | - In case you want to compile the source routing firmware, also add `SOURCE_ROUTING`. 22 | 7. Press OK. 23 | 8. Right-click on your target and click *Rebuild all*. 24 | 9. Once finished, you can find the `CC253(0|1)ZNP-Prod.(hex|bin)` file in `Z-Stack Home 1.2.2a.44539\Projects\zstack\ZNP\CC253x\dev`. 25 | -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20211115.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2591_DEFAULT_20211115.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20211115.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_CC2592_DEFAULT_20211115.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20211115.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/default/CC2530_DEFAULT_20211115.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20211115.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20211115.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20211116.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2591_SOURCE_ROUTING_20211116.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20211116.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_CC2592_SOURCE_ROUTING_20211116.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20211116.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2530_SOURCE_ROUTING_20211116.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20211116.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/coordinator/Z-Stack_Home_1.2/bin/source_routing/CC2531_SOURCE_ROUTING_20211116.zip -------------------------------------------------------------------------------- /coordinator/Z-Stack_Home_1.2/firmware.patch: -------------------------------------------------------------------------------- 1 | From fc5c41b902bc7171f8be1b89dcf79bc85d0ad91e Mon Sep 17 00:00:00 2001 2 | From: Koen Kanters 3 | Date: Tue, 28 Jul 2020 19:39:55 +0200 4 | Subject: [PATCH 1/1] Own changes 5 | 6 | --- 7 | Components/hal/include/hal_led.h | 1 + 8 | Components/hal/target/CC2530USB/hal_led.c | 6 + 9 | .../hal/target/CC2530ZNP/hal_board_cfg.h | 6 +- 10 | Components/hal/target/CC2530ZNP/hal_led.c | 6 + 11 | Components/mt/MT_SYS.c | 16 +++ 12 | Components/mt/MT_UTIL.c | 2 + 13 | Components/mt/MT_ZDO.c | 8 ++ 14 | Components/mt/revision_info.h | 1 + 15 | Components/stack/af/AF.c | 26 +++- 16 | Components/stack/zdo/ZDApp.c | 10 +- 17 | Components/stack/zdo/ZDObject.c | 14 ++ 18 | Components/stack/zdo/ZDSecMgr.c | 21 +++ 19 | Projects/zstack/ZMain/TI2530ZNP/OnBoard.c | 9 ++ 20 | Projects/zstack/ZMain/TI2530ZNP/OnBoard.h | 4 +- 21 | .../zstack/ZNP/CC253x/Source/preinclude.h | 126 ++++++++++++++++++ 22 | Projects/zstack/ZNP/Source/znp.cfg | 4 +- 23 | Projects/zstack/ZNP/Source/znp_app.c | 22 ++- 24 | 17 files changed, 269 insertions(+), 13 deletions(-) 25 | create mode 100644 Components/mt/revision_info.h 26 | create mode 100644 Projects/zstack/ZNP/CC253x/Source/preinclude.h 27 | 28 | diff --git a/Components/hal/include/hal_led.h b/Components/hal/include/hal_led.h 29 | index 217b8bf..ff0ce2f 100644 30 | --- a/Components/hal/include/hal_led.h 31 | +++ b/Components/hal/include/hal_led.h 32 | @@ -71,6 +71,7 @@ extern "C" 33 | #define HAL_LED_MODE_BLINK 0x02 34 | #define HAL_LED_MODE_FLASH 0x04 35 | #define HAL_LED_MODE_TOGGLE 0x08 36 | +#define HAL_LED_MODE_DISABLE 0x10 37 | 38 | /* Defaults */ 39 | #define HAL_LED_DEFAULT_MAX_LEDS 4 40 | diff --git a/Components/hal/target/CC2530USB/hal_led.c b/Components/hal/target/CC2530USB/hal_led.c 41 | index 2471fb7..4c14e58 100644 42 | --- a/Components/hal/target/CC2530USB/hal_led.c 43 | +++ b/Components/hal/target/CC2530USB/hal_led.c 44 | @@ -81,6 +81,7 @@ typedef struct 45 | 46 | 47 | static uint8 HalLedState; // LED state at last set/clr/blink update 48 | +static bool LedsDisabled; 49 | 50 | #if HAL_LED == TRUE 51 | static uint8 HalSleepLedState; // LED state at last set/clr/blink update 52 | @@ -136,6 +137,11 @@ void HalLedInit (void) 53 | ***************************************************************************************************/ 54 | uint8 HalLedSet (uint8 leds, uint8 mode) 55 | { 56 | + if (LedsDisabled == true) return ( HalLedState ); 57 | + if (mode == HAL_LED_MODE_DISABLE) { 58 | + LedsDisabled = true; 59 | + mode = HAL_LED_MODE_OFF; 60 | + } 61 | 62 | #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE) 63 | uint8 led; 64 | diff --git a/Components/hal/target/CC2530ZNP/hal_board_cfg.h b/Components/hal/target/CC2530ZNP/hal_board_cfg.h 65 | index 0459c86..1e40362 100644 66 | --- a/Components/hal/target/CC2530ZNP/hal_board_cfg.h 67 | +++ b/Components/hal/target/CC2530ZNP/hal_board_cfg.h 68 | @@ -314,7 +314,7 @@ extern unsigned char znpCfg0; 69 | */ 70 | 71 | /* ----------- RF-frontend Connection Initialization ---------- */ 72 | -#if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 73 | +#if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2590 || defined HAL_PA_LNA_CC2592 74 | extern void MAC_RfFrontendSetup(void); 75 | #define HAL_BOARD_RF_FRONTEND_SETUP() MAC_RfFrontendSetup() 76 | #else 77 | @@ -343,7 +343,7 @@ extern void MAC_RfFrontendSetup(void); 78 | #endif 79 | 80 | /* ----------- Board Initialization ---------- */ 81 | -#if defined (HAL_BOARD_CC2530EB_REV17) && !defined (HAL_PA_LNA) && !defined (HAL_PA_LNA_CC2590) 82 | +#if defined (HAL_BOARD_CC2530EB_REV17) && !defined (HAL_PA_LNA) && !defined (HAL_PA_LNA_CC2590) && !defined (HAL_PA_LNA_CC2592) 83 | 84 | #define HAL_BOARD_INIT() st \ 85 | ( \ 86 | @@ -362,7 +362,7 @@ extern void MAC_RfFrontendSetup(void); 87 | PREFETCH_ENABLE(); \ 88 | ) 89 | 90 | -#elif defined (HAL_BOARD_CC2530EB_REV13) || defined (HAL_PA_LNA) || defined (HAL_PA_LNA_CC2590) 91 | +#elif defined (HAL_BOARD_CC2530EB_REV13) || defined (HAL_PA_LNA) || defined (HAL_PA_LNA_CC2590)|| defined (HAL_PA_LNA_CC2592) 92 | 93 | #ifdef HAL_ENABLE_WIFI_COEX_PINS 94 | #define HAL_BOARD_ENABLE_WIFI_COEX_PINS() st \ 95 | diff --git a/Components/hal/target/CC2530ZNP/hal_led.c b/Components/hal/target/CC2530ZNP/hal_led.c 96 | index 2471fb7..4c14e58 100644 97 | --- a/Components/hal/target/CC2530ZNP/hal_led.c 98 | +++ b/Components/hal/target/CC2530ZNP/hal_led.c 99 | @@ -81,6 +81,7 @@ typedef struct 100 | 101 | 102 | static uint8 HalLedState; // LED state at last set/clr/blink update 103 | +static bool LedsDisabled; 104 | 105 | #if HAL_LED == TRUE 106 | static uint8 HalSleepLedState; // LED state at last set/clr/blink update 107 | @@ -136,6 +137,11 @@ void HalLedInit (void) 108 | ***************************************************************************************************/ 109 | uint8 HalLedSet (uint8 leds, uint8 mode) 110 | { 111 | + if (LedsDisabled == true) return ( HalLedState ); 112 | + if (mode == HAL_LED_MODE_DISABLE) { 113 | + LedsDisabled = true; 114 | + mode = HAL_LED_MODE_OFF; 115 | + } 116 | 117 | #if (defined (BLINK_LEDS)) && (HAL_LED == TRUE) 118 | uint8 led; 119 | diff --git a/Components/mt/MT_SYS.c b/Components/mt/MT_SYS.c 120 | index 35aae57..1f8ee82 100644 121 | --- a/Components/mt/MT_SYS.c 122 | +++ b/Components/mt/MT_SYS.c 123 | @@ -2141,6 +2141,21 @@ static void MT_SysSnifferParameters( uint8 *pBuf ) 124 | *****************************************************************************/ 125 | static void powerOffSoc(void) 126 | { 127 | +#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592) 128 | + HAL_DISABLE_INTERRUPTS(); 129 | + STIF = 0; //HAL_SLEEP_TIMER_CLEAR_INT; 130 | + if (ZNP_CFG1_UART == znpCfg1) 131 | + { 132 | + HalUARTSuspend(); 133 | + } 134 | + 135 | + /* Prep CC2530 power mode */ 136 | + //HAL_SLEEP_PREP_POWER_MODE(3); 137 | + SLEEPCMD &= ~PMODE; /* clear mode bits */ 138 | + SLEEPCMD |= 3; /* set mode bits to PM3 */ 139 | + while (!(STLOAD & LDRDY)); 140 | + SystemReset(); 141 | +#else 142 | HAL_DISABLE_INTERRUPTS(); 143 | 144 | /* turn off the RF front end device */ 145 | @@ -2181,6 +2196,7 @@ static void powerOffSoc(void) 146 | PCON = halSleepPconValue; 147 | asm("NOP"); 148 | } 149 | +#endif 150 | } 151 | #endif 152 | 153 | diff --git a/Components/mt/MT_UTIL.c b/Components/mt/MT_UTIL.c 154 | index bc5ba4a..338ed3b 100644 155 | --- a/Components/mt/MT_UTIL.c 156 | +++ b/Components/mt/MT_UTIL.c 157 | @@ -935,6 +935,8 @@ static void MT_UtilLedControl(uint8 *pBuf) 158 | Mode = HAL_LED_MODE_FLASH; 159 | else if ( iMode == 4 ) 160 | Mode = HAL_LED_MODE_TOGGLE; 161 | + else if ( iMode == 5 ) 162 | + Mode = HAL_LED_MODE_DISABLE; 163 | else 164 | Led = 0; 165 | 166 | diff --git a/Components/mt/MT_ZDO.c b/Components/mt/MT_ZDO.c 167 | index d43d7c0..db8d264 100644 168 | --- a/Components/mt/MT_ZDO.c 169 | +++ b/Components/mt/MT_ZDO.c 170 | @@ -54,6 +54,7 @@ 171 | #include "ZDApp.h" 172 | #include "OnBoard.h" 173 | #include "aps_groups.h" 174 | +#include "hal_led.h" 175 | 176 | #if defined ( MT_ZDO_EXTENSIONS ) 177 | #include "rtg.h" 178 | @@ -1626,6 +1627,11 @@ static void MT_ZdoMgmtPermitJoinRequest(uint8 *pBuf) 179 | ignoreIndication = TRUE; 180 | retValue = (uint8)ZDP_MgmtPermitJoinReq( &destAddr, duration, tcSignificance, 0); 181 | ignoreIndication = FALSE; 182 | + 183 | + // If joining is enabled via a router, ZDO_ProcessMgmtPermitJoinReq is never triggered thus 184 | + // ZDSecMgrPermitJoining is never called. Joining via a router would always fail now since 185 | + // ZDSecMgrPermitJoiningEnabled in zd_sec_mgr.c stays FALSE 186 | + ZDSecMgrPermitJoining(duration); 187 | 188 | MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_ZDO), cmdId, 1, &retValue); 189 | } 190 | @@ -1812,6 +1818,8 @@ static void MT_ZdoStartupFromApp(uint8 *pBuf) 191 | 192 | retValue = ZDOInitDevice(100); 193 | 194 | + HalLedSet(HAL_LED_3, HAL_LED_MODE_OFF); 195 | + 196 | if (MT_RPC_CMD_SREQ == (cmd0 & MT_RPC_CMD_TYPE_MASK)) 197 | { 198 | MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP|(uint8)MT_RPC_SYS_ZDO), cmd1,1, &retValue); 199 | diff --git a/Components/mt/revision_info.h b/Components/mt/revision_info.h 200 | new file mode 100644 201 | index 0000000..eb5b07c 202 | --- /dev/null 203 | +++ b/Components/mt/revision_info.h 204 | @@ -0,0 +1 @@ 205 | +#define CODE_REVISION_NUMBER 20211115 206 | \ No newline at end of file 207 | diff --git a/Components/stack/af/AF.c b/Components/stack/af/AF.c 208 | index c6183b6..dbcda1e 100644 209 | --- a/Components/stack/af/AF.c 210 | +++ b/Components/stack/af/AF.c 211 | @@ -372,10 +372,18 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16 Src 212 | #if !defined ( APS_NO_GROUPS ) 213 | // Find the first endpoint for this group 214 | grpEp = aps_FindGroupForEndpoint( aff->GroupID, APS_GROUPS_FIND_FIRST ); 215 | - if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) 216 | - return; // No endpoint found 217 | - 218 | - epDesc = afFindEndPointDesc( grpEp ); 219 | + if ( grpEp == APS_GROUPS_EP_NOT_FOUND ) { 220 | + // No endpoint found, default to endpoint 1. 221 | + // In the original source code there is a return here. 222 | + // This prevent the messags from being forwarded. 223 | + // For our use-case we want to capture all messages. 224 | + // Even if the coordinator is not in the group. 225 | + epDesc = afFindEndPointDesc( 1 ); 226 | + } 227 | + else { 228 | + epDesc = afFindEndPointDesc( grpEp ); 229 | + } 230 | + 231 | if ( epDesc == NULL ) 232 | return; // Endpoint descriptor not found 233 | 234 | @@ -392,6 +400,12 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16 Src 235 | epDesc = pList->epDesc; 236 | } 237 | } 238 | + else if ( aff->DstEndPoint == 10 || aff->DstEndPoint == 11 ) { 239 | + if ( (epDesc = afFindEndPointDesc( 1 )) ) 240 | + { 241 | + pList = afFindEndPointDescList( epDesc->endPoint ); 242 | + } 243 | + } 244 | else if ( (epDesc = afFindEndPointDesc( aff->DstEndPoint )) ) 245 | { 246 | pList = afFindEndPointDescList( epDesc->endPoint ); 247 | @@ -422,7 +436,9 @@ void afIncomingData( aps_FrameFormat_t *aff, zAddrType_t *SrcAddress, uint16 Src 248 | // if the Wildcard ProfileID is received the message should not be sent to ZDO endpoint 249 | if ( (aff->ProfileID == epProfileID) || 250 | ((epDesc->endPoint == ZDO_EP) && (aff->ProfileID == ZDO_PROFILE_ID)) || 251 | - ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) ) 252 | + ((epDesc->endPoint != ZDO_EP) && ( aff->ProfileID == ZDO_WILDCARD_PROFILE_ID )) || 253 | + // Forward messages to endpoint even with profileID mismatches 254 | + ((aff->ProfileID >= 0x100) && (aff->ProfileID <= 0xFC01)) ) 255 | { 256 | // Save original endpoint 257 | uint8 endpoint = aff->DstEndPoint; 258 | diff --git a/Components/stack/zdo/ZDApp.c b/Components/stack/zdo/ZDApp.c 259 | index 242be04..cfad5e9 100644 260 | --- a/Components/stack/zdo/ZDApp.c 261 | +++ b/Components/stack/zdo/ZDApp.c 262 | @@ -3148,6 +3148,14 @@ void ZDO_NetworkStatusCB( uint16 nwkDstAddr, uint8 statusCode, uint16 dstAddr ) 263 | // Routing error for dstAddr, this is informational and a Route 264 | // Request should happen automatically. 265 | } 266 | + 267 | + if ( (nwkDstAddr == NLME_GetShortAddr()) 268 | + && (statusCode == NWKSTAT_SOURCE_ROUTE_FAILURE) ) 269 | + { 270 | + // Received a source route failure, remove route and rediscover. 271 | + RTG_RemoveRtgEntry( dstAddr, 0 ); 272 | + NLME_RouteDiscoveryRequest( dstAddr, 0, 30 ); 273 | + } 274 | } 275 | 276 | /****************************************************************************** 277 | @@ -3463,7 +3471,7 @@ void ZDApp_NVUpdate( void ) 278 | */ 279 | uint16 ZDApp_CoordStartPANIDConflictCB( uint16 panid ) 280 | { 281 | - return ( panid + 1 ); 282 | + return ( panid ); 283 | } 284 | 285 | /********************************************************************* 286 | diff --git a/Components/stack/zdo/ZDObject.c b/Components/stack/zdo/ZDObject.c 287 | index 24bc9c3..bb4d3cb 100644 288 | --- a/Components/stack/zdo/ZDObject.c 289 | +++ b/Components/stack/zdo/ZDObject.c 290 | @@ -644,6 +644,20 @@ void ZDO_ProcessNodeDescReq( zdoIncomingMsg_t *inMsg ) 291 | 292 | if ( desc != NULL ) 293 | { 294 | + uint8 extAddr[Z_EXTADDR_LEN]; 295 | + // Respond with Xiaomi manufacturer code when ieeAddr is withing Xiaomi address space 296 | + // Otherwise some devices don't work 297 | + // https://github.com/Koenkk/zigbee2mqtt/issues/9274 298 | + if (APSME_LookupExtAddr(inMsg->srcAddr.addr.shortAddr, extAddr) == TRUE && 299 | + ((extAddr[7] == 0x04 && extAddr[6] == 0xcf && extAddr[5] == 0x8c) || 300 | + (extAddr[7] == 0x54 && extAddr[6] == 0xef && extAddr[5] == 0x44))) { 301 | + desc->ManufacturerCode[0] = 0x5f; 302 | + desc->ManufacturerCode[1] = 0x11; 303 | + } else { 304 | + desc->ManufacturerCode[0] = 0x0; 305 | + desc->ManufacturerCode[1] = 0x0; 306 | + } 307 | + 308 | ZDP_NodeDescMsg( inMsg, aoi, desc ); 309 | } 310 | else 311 | diff --git a/Components/stack/zdo/ZDSecMgr.c b/Components/stack/zdo/ZDSecMgr.c 312 | index 2eacc11..0c8a07c 100644 313 | --- a/Components/stack/zdo/ZDSecMgr.c 314 | +++ b/Components/stack/zdo/ZDSecMgr.c 315 | @@ -42,6 +42,8 @@ extern "C" 316 | { 317 | #endif 318 | 319 | +#define SLEEP(_count) do {volatile uint32 count = (_count); while (count--);} while (0) 320 | + 321 | /****************************************************************************** 322 | * INCLUDES 323 | */ 324 | @@ -58,6 +60,7 @@ extern "C" 325 | #include "APSMEDE.h" 326 | #include "ZDConfig.h" 327 | #include "ZDSecMgr.h" 328 | +#include "hal_led.h" 329 | 330 | /****************************************************************************** 331 | * CONSTANTS 332 | @@ -1114,14 +1117,22 @@ ZStatus_t ZDSecMgrDeviceJoin( ZDSecMgrDevice_t* device ) 333 | ZStatus_t status = ZSuccess; 334 | uint16 ami; 335 | 336 | + // Add sleeps, see https://github.com/Koenkk/zigbee2mqtt/issues/3177 337 | + SLEEP(0x3E8); 338 | + 339 | // attempt to validate device that joined/rejoined without security 340 | if ( device->secure == FALSE ) 341 | { 342 | + SLEEP(0x3E8); 343 | status = ZDSecMgrDeviceValidate( device ); 344 | } 345 | + 346 | + SLEEP(0x3E8); 347 | 348 | if ( status == ZSuccess ) 349 | { 350 | + SLEEP(0x3E8); 351 | + 352 | // Add the device to the address manager 353 | ZDSecMgrAddrStore( device->nwkAddr, device->extAddr, &ami ); 354 | 355 | @@ -1129,18 +1140,25 @@ ZStatus_t ZDSecMgrDeviceJoin( ZDSecMgrDevice_t* device ) 356 | if ( ( device->devStatus & DEV_SEC_INIT_STATUS ) && 357 | ( device->secure == FALSE ) ) 358 | { 359 | + SLEEP(0x3E8); 360 | //send the nwk key data to the joining device 361 | status = ZDSecMgrSendNwkKey( device ); 362 | } 363 | + 364 | + SLEEP(0x3E8); 365 | 366 | if ( status != ZSuccess ) 367 | { 368 | + SLEEP(0x3E8); 369 | ZDSecMgrAddrClear( device->extAddr ); 370 | } 371 | } 372 | + 373 | + SLEEP(0x3E8); 374 | 375 | if ( status != ZSuccess ) 376 | { 377 | + SLEEP(0x3E8); 378 | // not allowed or transport key failed, remove the device 379 | ZDSecMgrDeviceRemove( device ); 380 | } 381 | @@ -1504,6 +1522,8 @@ uint8 ZDSecMgrPermitJoining( uint8 duration ) 382 | ZDSecMgrPermitJoiningEnabled = FALSE; 383 | } 384 | 385 | + HalLedSet(HAL_LED_3, ZDSecMgrPermitJoiningEnabled ? HAL_LED_MODE_ON : HAL_LED_MODE_OFF); 386 | + 387 | accept = TRUE; 388 | 389 | return accept; 390 | @@ -1522,6 +1542,7 @@ void ZDSecMgrPermitJoiningTimeout( void ) 391 | { 392 | if ( ZDSecMgrPermitJoiningTimed == TRUE ) 393 | { 394 | + HalLedSet(HAL_LED_3, HAL_LED_MODE_OFF); 395 | ZDSecMgrPermitJoiningEnabled = FALSE; 396 | ZDSecMgrPermitJoiningTimed = FALSE; 397 | } 398 | diff --git a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c 399 | index 7c6c77e..8265ff1 100644 400 | --- a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c 401 | +++ b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.c 402 | @@ -144,8 +144,17 @@ void InitBoard( uint8 level ) 403 | 404 | #if defined CC2531ZNP 405 | znpCfg1 = ZNP_CFG1_UART; 406 | +#elif defined FIRMWARE_CC2530_CC2591 || defined(FIRMWARE_CC2530_CC2592) 407 | + znpCfg1 = ZNP_CFG1_UART; 408 | + znpCfg0 = ZNP_CFG0_32K_OSC; 409 | #elif defined CC2530_MK 410 | + 411 | + #if defined FIRMWARE_CC2530 412 | + znpCfg1 = ZNP_CFG1_UART; 413 | + #else 414 | znpCfg1 = ZNP_CFG1_SPI; 415 | + #endif 416 | + 417 | znpCfg0 = ZNP_CFG0_32K_OSC; 418 | #else 419 | znpCfg1 = P2_0; 420 | diff --git a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.h b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.h 421 | index 9d035de..c850a66 100644 422 | --- a/Projects/zstack/ZMain/TI2530ZNP/OnBoard.h 423 | +++ b/Projects/zstack/ZMain/TI2530ZNP/OnBoard.h 424 | @@ -185,8 +185,8 @@ extern uint8 znpCfg1; 425 | #endif 426 | // SOC defines the ideal sizes in the individual _hal_uart_dma/isr.c modules. 427 | #define HAL_UART_FLOW_THRESHOLD 0 428 | -#define HAL_UART_RX_BUF_SIZE 0 429 | -#define HAL_UART_TX_BUF_SIZE 0 430 | +#define HAL_UART_RX_BUF_SIZE 1024 431 | +#define HAL_UART_TX_BUF_SIZE 1024 432 | #define HAL_UART_IDLE_TIMEOUT 0 433 | 434 | // Restart system from absolute beginning 435 | diff --git a/Projects/zstack/ZNP/CC253x/Source/preinclude.h b/Projects/zstack/ZNP/CC253x/Source/preinclude.h 436 | new file mode 100644 437 | index 0000000..356bce2 438 | --- /dev/null 439 | +++ b/Projects/zstack/ZNP/CC253x/Source/preinclude.h 440 | @@ -0,0 +1,126 @@ 441 | +// Shared accross all firmwares 442 | +#define ASSERT_RESET 443 | + 444 | +#if defined FIRMWARE_SBL 445 | + #define MAKE_CRC_SHDW 446 | +#else 447 | + #define FAKE_CRC_SHDW 448 | +#endif 449 | + 450 | +#define TC_LINKKEY_JOIN 451 | +#define SECURE 1 452 | +#define INCLUDE_REVISION_INFORMATION 453 | + 454 | +// Save memory 455 | +#undef APS_MAX_GROUPS 456 | +#define APS_MAX_GROUPS 1 457 | +#undef NWK_MAX_BINDING_ENTRIES 458 | +#define NWK_MAX_BINDING_ENTRIES 1 459 | + 460 | +/** 461 | + * Disabling MULTICAST is required in order for proper group support. 462 | + * If MULTICAST is not disabled, the group adress is not included in the APS header 463 | + */ 464 | +#define MULTICAST_ENABLED FALSE 465 | + 466 | +/** 467 | + * Reduce BCAST_DELIVERY_TIME and increase MAX_BCAST time. 468 | + * BCAST_DELIVERY_TIME is the length of time a broadcast message is kept in the broadcast table 469 | + * MAX_BCAST is the max number of messages that are in the broadcast table 470 | + * If e.g. BCAST_DELIVERY_TIME = 1 second and MAX_BCAST = 10; 10 broadcast messages per second can be send. 471 | + * 472 | + * Zigbee2mqtt has a fixed delay of 170ms between each command. 473 | + * Therefore a BCAST_DELIVERY_TIME = 20 (= 2 seconds) and MAX_BCAST = 12 allows us to send 474 | + * 2 / 12 = 1 group command per 166ms, which is just below the zigbee2mqtt delay. 475 | + * Therefore the broadcast table will never get full. 476 | + */ 477 | +#define BCAST_DELIVERY_TIME 20 478 | +#undef MAX_BCAST // avoids incompatible redefinition of macro warning 479 | +#define MAX_BCAST 12 480 | + 481 | +// See swra635.pdf 482 | +#define HAL_LCD FALSE 483 | +#define HAL_ADC FALSE 484 | + 485 | +/** 486 | + * Enable MTO routing/source routing 487 | + * Source routing could have issues: https://github.com/Koenkk/zigbee2mqtt/issues/1408 488 | + */ 489 | +#define CONCENTRATOR_ENABLE TRUE 490 | +#define CONCENTRATOR_DISCOVERY_TIME 60 491 | + 492 | +#if defined SOURCE_ROUTING 493 | + #define CONCENTRATOR_ROUTE_CACHE TRUE 494 | + #define MAX_RTG_SRC_ENTRIES 40 495 | + #undef MAX_RTG_ENTRIES 496 | + #define MAX_RTG_ENTRIES 40 497 | + #define MAX_NEIGHBOR_ENTRIES 16 498 | + #define SRC_RTG_EXPIRY_TIME 0 499 | +#else 500 | + #define CONCENTRATOR_ROUTE_CACHE FALSE 501 | + #define MAX_RTG_SRC_ENTRIES 1 // Source table is not used, reduce to minimal size 502 | + #undef MAX_RTG_ENTRIES 503 | + #define MAX_RTG_ENTRIES 30 504 | + #define MAX_NEIGHBOR_ENTRIES 12 505 | +#endif 506 | + 507 | +// CC2531 508 | +#if defined FIRMWARE_CC2531 509 | + #define CC2531ZNP 510 | + #if defined SOURCE_ROUTING 511 | + #define NWK_MAX_DEVICE_LIST 5 512 | + #define MAXMEMHEAP 3307 513 | + #else 514 | + #define NWK_MAX_DEVICE_LIST 20 515 | + #define MAXMEMHEAP 3283 516 | + #endif 517 | + 518 | +// CC2530 519 | +#elif defined FIRMWARE_CC2530 520 | + #define ENABLE_MT_SYS_RESET_SHUTDOWN 521 | + #define ZTOOL_P1 522 | + #define CC2530_MK 523 | + 524 | + #if defined SOURCE_ROUTING 525 | + #define HAL_UART_DMA_RX_MAX 128 526 | + #define NWK_MAX_DEVICE_LIST 5 527 | + #define MAXMEMHEAP 3189 528 | + #else 529 | + #define HAL_UART_DMA_RX_MAX 220 530 | + #define NWK_MAX_DEVICE_LIST 16 531 | + #define MAXMEMHEAP 2909 532 | + #endif 533 | + 534 | +// CC2530 + CC2591 535 | +#elif defined FIRMWARE_CC2530_CC2591 536 | + #define ENABLE_MT_SYS_RESET_SHUTDOWN 537 | + #define ZTOOL_P1 538 | + #define HAL_PA_LNA 539 | + 540 | + #if defined SOURCE_ROUTING 541 | + #define HAL_UART_DMA_RX_MAX 128 542 | + #define NWK_MAX_DEVICE_LIST 5 543 | + #define MAXMEMHEAP 3187 544 | + #else 545 | + #define HAL_UART_DMA_RX_MAX 220 546 | + #define NWK_MAX_DEVICE_LIST 16 547 | + #define MAXMEMHEAP 2907 548 | + #endif 549 | + 550 | +// CC2530 + CC2592 551 | +#elif defined FIRMWARE_CC2530_CC2592 552 | + #define ENABLE_MT_SYS_RESET_SHUTDOWN 553 | + #define ZTOOL_P1 554 | + #define HAL_PA_LNA_CC2592 555 | + 556 | + #if defined SOURCE_ROUTING 557 | + #define HAL_UART_DMA_RX_MAX 128 558 | + #define NWK_MAX_DEVICE_LIST 5 559 | + #define MAXMEMHEAP 3187 560 | + #else 561 | + #define HAL_UART_DMA_RX_MAX 220 562 | + #define NWK_MAX_DEVICE_LIST 16 563 | + #define MAXMEMHEAP 2907 564 | + #endif 565 | + 566 | +#endif 567 | diff --git a/Projects/zstack/ZNP/Source/znp.cfg b/Projects/zstack/ZNP/Source/znp.cfg 568 | index 7e524a9..d5b88a3 100644 569 | --- a/Projects/zstack/ZNP/Source/znp.cfg 570 | +++ b/Projects/zstack/ZNP/Source/znp.cfg 571 | @@ -101,4 +101,6 @@ 572 | -DMT_ZDO_EXTENSIONS 573 | 574 | /* MT_APP interface - useful when ZAP defines ZAP_ZNP_MT for MT_SYS_APP_MSG pass-through. */ 575 | --DMT_APP_FUNC 576 | \ No newline at end of file 577 | +-DMT_APP_FUNC 578 | + 579 | +--preinclude=preinclude.h 580 | \ No newline at end of file 581 | diff --git a/Projects/zstack/ZNP/Source/znp_app.c b/Projects/zstack/ZNP/Source/znp_app.c 582 | index 470ff12..e42ac65 100644 583 | --- a/Projects/zstack/ZNP/Source/znp_app.c 584 | +++ b/Projects/zstack/ZNP/Source/znp_app.c 585 | @@ -390,12 +390,23 @@ static void npInit(void) 586 | halUARTCfg_t uartConfig; 587 | 588 | uartConfig.configured = TRUE; 589 | + 590 | +#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592) 591 | + uartConfig.baudRate = HAL_UART_BR_115200; 592 | +#else 593 | uartConfig.baudRate = ZNP_UART_BAUD; 594 | -#ifdef ZNP_ALT 595 | +#endif 596 | + 597 | +#if defined(FIRMWARE_CC2530) || defined(FIRMWARE_CC2530_CC2591) || defined(FIRMWARE_CC2530_CC2592) 598 | uartConfig.flowControl = FALSE; 599 | #else 600 | + #ifdef ZNP_ALT 601 | + uartConfig.flowControl = FALSE; 602 | + #else 603 | uartConfig.flowControl = TRUE; 604 | + #endif 605 | #endif 606 | + 607 | uartConfig.flowControlThreshold = HAL_UART_FLOW_THRESHOLD; 608 | uartConfig.rx.maxBufSize = HAL_UART_RX_BUF_SIZE; 609 | uartConfig.tx.maxBufSize = HAL_UART_TX_BUF_SIZE; 610 | @@ -404,6 +415,15 @@ static void npInit(void) 611 | uartConfig.callBackFunc = npUartCback; 612 | HalUARTOpen(HAL_UART_PORT, &uartConfig); 613 | MT_UartRegisterTaskID(znpTaskId); 614 | + 615 | +#if defined FIRMWARE_CC2530_CC2591 || defined(FIRMWARE_CC2530_CC2592) 616 | + //Add TX Setting 617 | + #if defined HAL_PA_LNA || defined HAL_PA_LNA_CC2592 618 | + ZMacSetTransmitPower(TX_PWR_PLUS_19); 619 | + #else 620 | + ZMacSetTransmitPower(TX_PWR_PLUS_4); 621 | + #endif 622 | +#endif 623 | } 624 | else 625 | { 626 | -- 627 | 2.18.0.windows.1 628 | 629 | -------------------------------------------------------------------------------- /index.json: -------------------------------------------------------------------------------- 1 | { 2 | "index_version": "1724530770", 3 | "firmware_type": { 4 | "coordinator": { 5 | "stack": [ 6 | { 7 | "Z-Stack_3.0.x": "20190523" 8 | }, 9 | { 10 | "Z-Stack_3.x.0": "20221226" 11 | }, 12 | { 13 | "Z-Stack_3.x.0": "20230507" 14 | }, 15 | { 16 | "Z-Stack_3.x.0": "20240710" 17 | } 18 | ], 19 | "stack_default": "Z-Stack_3.x.0" 20 | }, 21 | "router": { 22 | "stack": [["Z-Stack_3.x.0", "20221102"]], 23 | "stack_default": "Z-Stack_3.x.0" 24 | } 25 | }, 26 | 27 | "boards": { 28 | "LAUNCHXL-CC26xR1": "CC2652R", 29 | "LAUNCHXL-CC1352P-2": "CC1352P2_CC2652P_launchpad", 30 | "zzh": "CC2652R", 31 | "zzhp": "CC1352P2_CC2652P_other", 32 | "zzhp-lite": "CC1352P2_CC2652P_other" 33 | }, 34 | 35 | "bsl-config": { 36 | "CC2652R": "0x00057FD8:0xC50DFEC5", 37 | "CC1352P2_CC2652P_launchpad": "0x00057FD8:0xC50FFEC5" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 20221102 2 | - Allow to set transmit power 3 | - Fix directly connected Xiaomi devices disconnecting 4 | - SimpleLink SDK 6.30.00.84 ([changelog](https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/6.30.00.84/exports/changelog.html)) 5 | 6 | # 20220125 7 | - SimpleLink SDK 5.30.01.01 ([changelog](https://software-dl.ti.com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/5.30.01.01/exports/changelog.html)) 8 | - Increase memory heap 9 | - Increase transmit power of CC1352P/CC2652P from 5dBm to 9dBm 10 | - Support routing table command 11 | 12 | # 20210128 13 | - Initial router firmwares -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/COMPILE.md: -------------------------------------------------------------------------------- 1 | # Compiling the firmware 2 | 3 | ## Setup development environment 4 | 1. Download and install [SIMPLELINK-CC13XX-CC26XX-SDK_6_30_00_84](https://www.ti.com/tool/download/SIMPLELINK-CC13XX-CC26XX-SDK) 5 | 1. Download and install [Code Composer Studio 12.1.0.00007](http://www.ti.com/tool/CCSTUDIO) 6 | 7 | ## Compiling 8 | 1. Start Code Composer Studio 9 | 1. Go to *File -> Import -> Code Composer Studio -> CCS Projects -> Select* search-directory: `simplelink_cc13xx_cc26xx_sdk_6_30_00_84/examples/rtos`. 10 | 1. Select: 11 | - `zr_genericapp_CC26X2R1_LAUNCHXL_tirtos7_ticlang` 12 | - `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos7_ticlang` 13 | - `zr_genericapp_LP_CC2652RB_tirtos7_ticlang` 14 | 4. Press *Finish*. 15 | 1. In Code Composer Studio, expand the 3 projects and for each open `zr_genericapp.syscfg`, expand `Power Management` and change `Minimal Poll Period (ms)` to `1000`, change it back to `100` immediately and save the file. 16 | 1. Go to your CCS workspace and copy `firmware.patch` to the root. 17 | 1. Open Git Bash, go to your CCS root and apply the patch using `git apply firmware.patch --ignore-space-change`. 18 | 1. Build the 3 projects; right click -> *Build project*. 19 | - **Important:** by default the **launchpad** variant of the CC1352P2_CC2652P (= `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos7_ticlang`) is build. To build the **other** variant comment `#define LAUNCHPAD_CONFIG 1` in `preinclude.h` (located under `Stack/Config/`), don't forget to save. 20 | 1. Once finished, the firmware can be found under `zr_genericapp_[CC26X2R1/CC1352P_2/CC2652RB]_LAUNCHXL_tirtos7_ticlang/default/zr_genericapp_[CC26X2R1/CC2652RB/CC1352P_2]_LAUNCHXL_tirtos7_ticlang.hex` 21 | - `zr_genericapp_CC26X2R1_LAUNCHXL_tirtos7_ticlang.hex` -> CC2652R 22 | - `zr_genericapp_LP_CC2652RB_tirtos7_ticlang.hex` -> CC2652RB 23 | - `zr_genericapp_CC1352P_2_LAUNCHXL_tirtos7_ticlang.hex` -> CC1352P-2 and CC2652P -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20221102.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20221102.zip -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_router_20221102.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_other_router_20221102.zip -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/bin/CC2652RB_router_20221102.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_3.x.0/bin/CC2652RB_router_20221102.zip -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/bin/CC2652R_router_20221102.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_3.x.0/bin/CC2652R_router_20221102.zip -------------------------------------------------------------------------------- /router/Z-Stack_3.x.0/bin/README.md: -------------------------------------------------------------------------------- 1 | # Z-Stack 3.x.0 router firmwares 2 | 3 | ## What firmware to pick for my device? 4 | Same logic as the coordinator firmware applies. See [README.md of the coordinator firmware](../../../coordinator/Z-Stack_3.x.0/bin/README.md). 5 | 6 | ## Pairing 7 | After reflashing the router will automatically pair. 8 | 9 | ## Factory reset 10 | To factory reset single press the button on your device. 11 | 12 | Notes: 13 | - Launchpads have 2 buttons, it doesn't matter which one you press 14 | - Slaesh's CC2652RB stick has 2 buttons, press the one furthest away from the USB connector. 15 | - SMLIGHT SLZB-06 adapter - pairing mode activated through web interface: System and Tools - System Control - Router Reconnect -------------------------------------------------------------------------------- /router/Z-Stack_Home_1.2/README.md: -------------------------------------------------------------------------------- 1 | # Z-Stack_Home 1.2 router firmware 2 | Firmwares have been taken from: https://ptvo.info/ , no sources and compilation instructions are available. Credits go to [ptvoinfo](https://github.com/ptvoinfo). 3 | 4 | ## Buttons 5 | 6 | * S1 button: only changes the state of the green LED. 7 | * S2 button: repairs CC2531 (see below) 8 | 9 | ## Lights 10 | 11 | * Short fast blinks (one per second) – the router is connecting to a network. 12 | * Short long blinks (one per 4 seconds) – normal operations. 13 | * Three short blinks – the router cannot send a report to a coordinator. 14 | 15 | ## Pairing 16 | 17 | Flash firmware and permit joining to a network on your coordinator. 18 | 19 | ## Re-pairing 20 | 21 | * CC2530, CC2531: Power on, wait 2 seconds, power off, repeat this cycle three times. 22 | * CC2531: Power on, press and hold down the S2 button for 5 seconds. 23 | -------------------------------------------------------------------------------- /router/Z-Stack_Home_1.2/bin/CC2530_CC2591_router_2020_09_29.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_Home_1.2/bin/CC2530_CC2591_router_2020_09_29.zip -------------------------------------------------------------------------------- /router/Z-Stack_Home_1.2/bin/CC2530_CC2592_router_2020_09_29.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_Home_1.2/bin/CC2530_CC2592_router_2020_09_29.zip -------------------------------------------------------------------------------- /router/Z-Stack_Home_1.2/bin/CC2530_router_2020_09_29.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_Home_1.2/bin/CC2530_router_2020_09_29.zip -------------------------------------------------------------------------------- /router/Z-Stack_Home_1.2/bin/CC2531_router_2020_09_29.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/14cd338d263a1f6344e20167b96f5ca55895553c/router/Z-Stack_Home_1.2/bin/CC2531_router_2020_09_29.zip --------------------------------------------------------------------------------