GitHub Digital Lab

Fox Red Labs / Builds / Smart home and radio

Update a board's firmware by radio

A CC2340R5 took a signed update over Bluetooth from a computer in 43 s; a CC35X1 installed one over Wi-Fi in 8 s. The Zigbee update from Home Assistant has not finished.

HardNo wiringabout 2 min to build

The CC2340R5 this build runs on, drawn from its user guide. Drag to turn it.

What you need

Works on this board
On Linux or WindowsThe steps were recorded on a Mac; paths and port names in them are the Mac ones.

macOS (recorded)

TI's tools
/Applications/ti, or ~/ti
Serial port
/dev/cu.usbmodem<serial>1
Probe access
nothing to do

Linux

TI's tools
~/ti (also searched: /opt/ti)
Serial port
/dev/ttyACM0 (by name: /dev/serial/by-id/*<serial>*-if00*)
Probe access
one udev rule, how

Windows

TI's tools
C:\ti (also searched: %USERPROFILE%\ti)
Serial port
COM<n>, named "XDS110 Class Application/User UART" in Device Manager
Probe access
the XDS110 USB driver from UniFlash or CCStudio

Your probe's serial on any system: python3 tools/frl/frl.py detect. Not run on a board under Linux or Windows. Everything else that differs: the full table.

Steps

  1. Set up Python and point at TI's public key.TERMINAL

    Make a Python environment with bleak, then set the path of the public key compiled into TI's MCUboot (change the SDK path if yours differs). The client uses the key to check the signature.

    python3 -m venv ~/ble && ~/ble/bin/pip install bleak export KEYS=/Applications/ti/simplelink_lowpower_f3_sdk_9_21_00_36_LTS/source/third_party/mcuboot/boot/ti/source/mcuboot_app/keys.c

    You should see: bleak installs without errors.

  2. Build both images.TERMINAL

    From the repository root. The script builds two copies of TI's basic_ble_oad_dual_image example and signs them: v1 is named FRL OAD 1 and toggles the green LED every second, v2 is FRL OAD 2 and toggles the red LED four times a second. build.sh uses the macOS form sed -i ''. GNU sed (Linux) wants sed -i there. Not run on Linux or Windows.

    PY=~/ble/bin/python cc2340r5/oad/build.sh

    You should see: About two minutes: 'v1 built in 65 s', 'v2 built in 49 s'. cc2340r5/oad/images/ holds mcuboot_dual_image.hex, frl_oad_v1.bin and frl_oad_v2.bin (236 kB each).

  3. Check the update image without a board.TERMINAL

    A dry run parses the image header, recomputes the SHA-256 and checks the signature against TI's key.

    ~/ble/bin/python tools/oad/oad_client.py --dry-run --keys-c $KEYS cc2340r5/oad/images/frl_oad_v2.bin

    You should see: sha256_ok True, signature_ok True, version 2.0.0+0, a transfer plan of 1024 blocks of 236 data bytes, then dry run OK.

  4. Back up the board.TERMINAL

    Before writing, read the whole flash and the boot configuration to a folder outside the repo (the board may hold a Zigbee network key). DSLite's memory -r takes the length as a count of 32-bit words, not bytes. Then merge them into a restore file. In the DSLite path, osx is the Mac folder; on Linux or Windows use the one UniFlash made there.

    export DSLITE=/Applications/ti/uniflash_9.6.0/deskdb/content/TICloudAgent/osx/ccs_base/DebugServer/bin/DSLite CCXML=cc2340r5/CC2340R5.ccxml BK=$HOME/cc2340r5-oad-backup && mkdir -p $BK $DSLITE memory -c $CCXML -r 0x0,0x20000 -o $BK/main_flash.bin $DSLITE memory -c $CCXML -r 0x4E020000,0x200 -o $BK/ccfg.bin python3 cc2340r5/oad/images.py merge $BK/restore.hex $BK/main_flash.bin@0x0 $BK/ccfg.bin@0x4E020000

    You should see: main_flash.bin is 512 kB and ccfg.bin is 2 kB.

  5. Flash the bootloader and v1.TERMINAL

    One command writes both files, because UniFlash erases the whole chip at the start of every program load.

    $DSLITE flash -c $CCXML -e -f -u cc2340r5/oad/images/mcuboot_dual_image.hex cc2340r5/oad/images/frl_oad_v1.bin,0x6000

    You should see: About 13 s. The green LED toggles once a second and FRL OAD 1 is advertising.

  6. Send v2 over the air.TERMINAL

    The client finds the board by name, sends the 1,024 blocks, sends the enable command and waits for the new name.

    ~/ble/bin/python tools/oad/oad_client.py --name "FRL OAD 1" --expect-name "FRL OAD 2" --keys-c $KEYS --json oad-run.json cc2340r5/oad/images/frl_oad_v2.bin

    You should see: The running version, progress every 5% with kbit/s, then the download time, the time from enable to the new name and the new version. Recorded run: 31.4 s, 7.8 s, version 2.0.0, packet size 251.

  7. Check by probe.TERMINAL

    Read the image header at 0x6000; the version is byte 20.

    $DSLITE memory -c $CCXML -r 0x6000,0x8 -o $BK/hdr.bin && xxd $BK/hdr.bin

    You should see: Byte 20 reads 02 after the update and 01 before. The red LED should now toggle four times a second (not watched on the recorded run).

  8. Put the board back.TERMINAL

    The same chip erase clears the flash first, then the backup is written.

    $DSLITE flash -c $CCXML -e -f -u $BK/restore.hex

    You should see: The board is as it was before step 5.

What to build next

Switch a board's LED from Home Assistant over ZigbeeThe board's own LED, switched on and off from Home Assistant
Add a low-power temperature sensor to Home AssistantA low-power Zigbee sensor that sleeps between readings and shows up on your dashboard
Send a sensor reading to a phone over BluetoothA reading your phone or Mac picks up over Bluetooth, no pairing

Every build

If something goes wrong

The build in the next step uses this environmentIts command sets PY to it.
It stops on a missing pathThe SDK, SysConfig and compiler paths are at the top of build.sh; change them to your install.
A line says FalseRebuild; the check was tested on five deliberately broken copies and refused all of them.
main_flash.bin is not 512 kBYou gave the length in bytes; use 0x20000 words.
The probe reports error -615 when it runs the appMCUboot was not flashed with it; run the same command again with both files.
More troubleshooting
It stops before sending with 'ATT MTU ... would corrupt the image'Your computer agreed a packet size under 243; try again, or see the protocol section of cc2340r5/oad/README.md.
It still reads 01MCUboot did not install the image; it refuses an image that is not newer than the running one.
It does not startRead cc2340r5/FAQ.md before writing again.

Every fix for this board: the FAQ.

Get the code

Ran here, with steps. Over Bluetooth from a laptop: 43 s for the whole update, with TI's dual-image example. How it ran on this board.

Start it

Paste this in a terminal. It hands off to an AI assistant with this board's notes.

./start.sh cc2340r5 ota-update --assistant claudegit clone --depth 1 --filter=blob:none https://github.com/Fox-Red-Labs/fox-red-labs.git && cd fox-red-labs ./start.sh cc2340r5 ota-update --assistant claude
Not Claude Code? Copy this prompt instead.
Clone https://github.com/Fox-Red-Labs/fox-red-labs and read cc2340r5/AGENTS.md first. Then run Update a board's firmware over the air on my LP-EM-CC2340R5. Tell me when to plug in the board and what you saw at each step.
Only the code for this board
git sparse-checkout set cc2340r5 tools mac-setupgit clone --depth 1 --filter=blob:none --sparse https://github.com/Fox-Red-Labs/fox-red-labs.git cd fox-red-labs git sparse-checkout set cc2340r5 tools mac-setup
Or take the whole repository
git clone https://github.com/Fox-Red-Labs/fox-red-labs.git
Reports from others, and the report forms

Clone the repository and open the board's folder below. AGENTS.md is a plain text file of notes for AI coding assistants, and llms.txt at the root indexes the site for one.

git clone https://github.com/Fox-Red-Labs/fox-red-labs.git

Code is BSD-3-Clause, writing is CC BY 4.0; third-party folders keep their own licenses.

Built it? Tell us

Built this, or got stuck? Report it on GitHub with a few short answers. Your report shows here in your words, marked as yours. A failure that repeats on the bench gets its fix here.

Evidence and limits43 s over Bluetooth on the CC2340R5; over Wi-Fi on the CC35X1 it installed in 8 s; the Zigbee update has not finished. Results, sources, timing and limits.

Update a CC2340R5 over Bluetooth from a computer's terminal

Expected result: The client prints a clean transfer of 1,024 blocks with no retries, then the board resets and advertises FRL OAD 2, and the version read back is 2.0.0.

What this shows

  • A CC2340R5 can take a signed firmware update over Bluetooth from a terminal: 31.4 s transfer, 7.8 s to the new name, one run on an Intel Mac.
  • TI's dual-image example keeps your app running during the download; each slot is 236 kB and the app uses 192 kB.
  • The image check (SHA-256 and signature) runs on your computer before any radio is used.
What this does not establish, and limits

What this does not establish

  • A repeat: one run, one Mac.
  • That the red LED toggles: the name, version and header say v2 runs, but the LED was not watched.
  • A Zigbee update from Home Assistant: it did not finish (88.7% of the image at best), and this page has no steps for it.
  • Wi-Fi: the CC2340R5 has none.

Limits to keep in mind

  • TI documents OAD with a phone app or a Windows tool; the terminal client here is this repository's own, written from the SDK source.
  • The dual-image layout halves the room for the app (236 kB per slot).
  • Checked on one Intel Mac, macOS 15.7.9.

Sources

Versions, sizes and timing

Speed61.5 kbit/s of image data: 236 kB in 31.4 s, ATT MTU 251README notes
Image236 kB sent, 18.5% of it 0xFF paddingREADME notes

Evidence

  • 2026-10-07, one run: 31.4 s transfer of 1,024 blocks, 7.8 s from the enable command to the new name, version 2.0.0 read back. About 41 s from scan to new name, 43 s with the version read. README notes
  • The run's console and JSON output.
  • The image header at 0x6000 read byte 20 = 02 after the update. README notes

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Update a CC35X1 over Wi-Fi from a computer

Expected result: The driver prints each phase with its time, the board reboots into version 0.0.2.0, and the slot table after shows the new version active.

What this shows

  • A CC35X1 downloads, verifies, installs and boots a new signed image over Wi-Fi from a Mac server: install and reboot in 8 s on the 2026-10-09 attempt.
  • A reset without accepting rolls the board back to the OTA app, as TI documents.
  • Four rounds on 2026-10-22 (update, go back, update and keep, update into the other slot) all ended as expected.
What this does not establish, and limits

What this does not establish

  • A repeat of the 8 s figure: it is one attempt with a 27.7 kB image.
  • Updates from Home Assistant or the internet: the server was a Mac on the home network.
  • Safety against power loss mid-update: not tested.

Limits to keep in mind

  • The chip must be activated first, which burns fuses and cannot be undone.
  • The chip cannot be read back, so a restore needs a saved signed bundle.
  • Checked on one Intel Mac and one board.

Sources

Versions, sizes and timing

Installdownload about 1 s, install and reboot 8 s, 27.7 kB image, one attemptNotes for an AI coding assistant working in this repository
Phases (1.29 MB image)scan 1.9 s, join 2.2 to 2.7 s, download 3.6 s, restart 3.1 sNotes for an AI coding assistant working in this repository

Evidence

Other boards

What the status words mean

Works ran here and did what it shouldCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Result grid

Project
LP-MSPM0G3507MSPM0G3507 chip
LP-MSPM0L1306MSPM0L1306 chip
LP-EM-CC2340R5CC2340R52 chip
LAUNCHXL-F2800137TMS320F2800137 chip
Update a board's firmware over the air
LP-MSPM0G3507Not for this chipNo radio
LP-MSPM0L1306Not for this chipNo radio
LP-EM-CC2340R5Could workOver Bluetooth from a laptop:
Details43 s for the whole update, with TI's dual-image example. Over Zigbee from Home Assistant: starts, then stalls: 88.7% of a 200 kB image at best (12 transfers, none finished). suspected cause: radio environment.
LP-EM-CC2340R5 OAD notes
LAUNCHXL-F2800137Not for this chipNo radio on this chip

Works ran here and did what it shouldShould work it builds; only naming, packaging or build glue is in the way; hover for whichCould work some of it ran; real porting effort is left; hover for whatNot for this chip the chip or its vendor software cannot; hover for why

Experiments (1)

StatusWhat was triedResult
Could workCan Home Assistant update a TI LP-EM-CC2340R5 Zigbee device over the air?
CC2340R5, 2026-10-05
Best 88.74% of 200 kB, which is 177.5 kB in 92 minutes at 33 bytes a second, with a Zigbee plug beside the board. It stopped when the board's block requests stopped reaching Home Assistant for 30 s. Twelve transfers,...

Source files