Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Feb 3, 2025
0 parents commit 896398e
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ot-ti"]
path = ot-ti
url = https://github.com/Koenkk/ot-ti.git
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# OpenThread-TexasInstruments-firmware

This repository contains OpenThread RCP firmwares for various Texas Instruments MCUs. The baudrate of the firmware is `460800`.

## Flashing

1. Download the firmware for your device from the [releases page](https://github.com/Koenkk/OpenThread-TexasInstruments-firmware/releases). Use the [adapters page](./docs/adapters.md) to figure out what firmware to use for your device.
1. Flash the firmware; use e.g. the [SMLIGHT firmware updater](https://smlight.tech/flasher/#other_cc) which allows for easy flashing via the webbrowser (can be used to flash any adapter). Other ways of flashing can be found on the [Zigee2MQTT docs](https://www.zigbee2mqtt.io/guide/adapters/zstack.html#firmware-flashing-cc2652-cc1352).

## Example usage: Home Assistant OpenThread Border Router add-on

After having flashed the firmware with the instructions above:

1. Install the add-on ([docs](https://github.com/home-assistant/addons/blob/master/openthread_border_router/DOCS.md#installation))
1. On the configuration page of the add-on, select the device and make sure the baudrate is set to `460800`.
1. Start the add-on.

## Compiling

The firmware can be compiled on any Linux x86_64 machine with Docker installed, instructions:


```bash
# Setup repository
git clone https://github.com/Koenkk/OpenThread-TexasInstruments-firmware.git
cd OpenThread-TexasInstruments-firmware
git submodule update --init --recursive

docker run -it --rm -v $(pwd):/data -w /data ubuntu:24.04 bash

# Bootstrap
bash scripts/bootstrap.sh

# Build
bash scripts/build.sh
```

The firmwares can now be found in the `./dist` directory.
37 changes: 37 additions & 0 deletions docs/adapters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Adapter firmware compatibility

Use this page to figure out what firmware to use for your device.

- `CC2652R_ot_rcp_*.zip`
- Electrolama zig-a-zig-ah! (zzh!)
- Vision CC2652 dongle
- Texas Instruments LAUNCHXL-CC26X2R1
- `CC2652RB_ot_rcp_*.zip`
- Slaesh's CC2652RB stick,
- `CC1352P2_CC2652P_launchpad_ot_rcp_*.zip`
- Tube's CC2652P2 USB Coordinator
- ZigStar Stick v4
- CircuitSetup's CC2652P2 USB Coordinator
- SONOFF ZBDongle-P
- Tube's Zigbee Gateways (CC2652P2 variant)
- cyijun OpenZ3Gateway
- XGG 52PZ2MGateway
- ZigStar LAN Coordinator
- ZigStar PoE Coordinator
- SMLIGHT SLZB-06
- cod.m Zigbee CC2652P RPi Module
- ZigStar ZigiHAT PoE
- Texas Instruments LAUNCHXL-CC1352P-2
- `CC1352P2_CC2652P_other_ot_rcp_*.zip`
- Egony Stick V4
- SMLIGHT SLZB-02
- SMLIGHT SLZB-05
- Gio-dot Z-Bee Duo with CC2652P
- `CC1352P7_ot_rcp_*.zip`
- SMLIGHT SLZB-07p7
- ZigStar UZG-01
- SMLIGHT SLZB-06p7
- cod.m Zigbee Coordinator CC2652P7
- Texas Instruments LP-CC1352P7
- `CC2652R7_ot_rcp_*.zip`
- Texas Instruments LP-CC2652R7
1 change: 1 addition & 0 deletions ot-ti
Submodule ot-ti added at 1c2d08
16 changes: 16 additions & 0 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash -e

# Install dependencies
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install git wget sudo tzdata make zip -y

# Bootstrap ot-ti
cd ot-ti
./script/bootstrap
mkdir -p $HOME/ti
ln -s /opt/ti/sysconfig_1.18.1 $HOME/ti/sysconfig_1.18.1

# Install ticlang (required for tiarmobjcopy)
cd /tmp
wget https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-ayxs93eZNN/4.0.1.LTS/ti_cgt_armllvm_4.0.1.LTS_linux-x64_installer.bin
chmod +x ti_cgt_armllvm_4.0.1.LTS_linux-x64_installer.bin
./ti_cgt_armllvm_4.0.1.LTS_linux-x64_installer.bin --mode unattended --prefix /opt/ti
44 changes: 44 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash -e

[ -z "$1" ] && echo "First argument is not set, set to the version, e.g. 2025.2.1" && exit 1
version=$1

echo "Remove dist dir"
dist_dir=$(realpath dist)
rm -rf $dist_dir
mkdir $dist_dir

echo "Clean before build"
cd ot-ti
git clean -dxf && \
git restore . && \
git submodule foreach 'git clean -dxf' && \
git submodule foreach --recursive 'git restore .'

items=(
# target name CC1352P_2_OTHER
"LP_CC2652RB,CC2652RB,false"
"CC1352P_2_LAUNCHXL,CC1352P2_CC2652P_launchpad,false"
"CC1352P_2_LAUNCHXL,CC1352P2_CC2652P_other,true"
"LP_CC1352P7_4,CC1352P7,false"
"CC26X2R1_LAUNCHXL,CC2652R,false"
"LP_CC2652R7,CC2652R7,false"
)

for target in "${items[@]}"; do
IFS=',' read -r -a values <<< "$target"
target="${values[0]}"
name="${values[1]}"
CC1352P_2_OTHER="${values[2]}"

echo "Compiling: target=$target name=$name CC1352P_2_OTHER=$CC1352P_2_OTHER"
file_name="${name}_ot_rcp_${version//./_}"
CC1352P_2_OTHER="$CC1352P_2_OTHER" FW_VERSION="$version" ./script/build $target
/opt/ti/ti-cgt-armllvm_4.0.1.LTS/bin/tiarmobjcopy build/bin/ot-rcp.out \
--output-target ihex build/bin/$file_name.hex
pushd build/bin
zip $dist_dir/$file_name.zip $file_name.hex
popd
done

echo "Done!"

0 comments on commit 896398e

Please sign in to comment.