Skip to content

git-developer/ti-cc-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ti-cc-tool

Docker image for JelmerT/cc2538-bsl

  • This project allows to flash a TI SoC with a single line of code.

  • Firmware files are supported as URL or local file, in native (bin/hex) and zipped format.

Usage

Docker

Example: download firmware and flash to SONOFF Dongle Plus

$ docker run --rm --device /dev/ttyUSB0:/dev/ttyUSB0 -e FIRMWARE_URL=https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip ckware/ti-cc-tool -ewv -p /dev/ttyUSB0 --bootloader-sonoff-usb

Example: flash local firmware file to SONOFF Dongle Plus

This example expects the file CC1352P2_CC2652P_launchpad_coordinator_20230507.hex in the local directory

$ docker run --rm --device /dev/ttyUSB0:/dev/ttyUSB0 -v CC1352P2_CC2652P_launchpad_coordinator_20230507.hex:/firmware.hex -e FIRMWARE_FILE=/firmware.hex ckware/ti-cc-tool -ewv -p /dev/ttyUSB0 --bootloader-sonoff-usb

docker-compose

  1. Create a docker-compose.yml for your environment

  2. Run docker-compose run --rm ti-cc-tool

Example: download firmware and flash to SONOFF Dongle Plus

---
services:
  ti-cc-tool:
    image: "ckware/ti-cc-tool"
    environment:
      FIRMWARE_URL: "https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip"
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
    command: [ "-ewv", "-p", "/dev/ttyUSB0", "--bootloader-sonoff-usb" ]

Example: flash local firmware file to SONOFF Dongle Plus

---
services:
  ti-cc-tool:
    image: "ckware/ti-cc-tool"
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
    environment:
      FIRMWARE_FILE: "/firmware.hex"
    volumes:
      - "./CC1352P2_CC2652P_launchpad_coordinator_20230507.hex:/firmware.hex"
    command: [ "-ewv", "-p", "/dev/ttyUSB0", "--bootloader-sonoff-usb" ]

Requirements

Software

  • Required: Docker

  • Optional: Docker Compose

The Docker Compose documentation contains a comprehensive guide explaining several install options. On recent debian-based systems, Docker Compose may be installed by calling

$ sudo apt-get install docker-compose-plugin

Troubleshooting

Permissions

Problem: The command terminates with an error message similar to

could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'

The cause is most likely that the user in the container lacks permission to use the USB device. The solution is then to permit the container user to access the device. To add the user to the device’s group, add --group-add "$(stat -c %g /dev/ttyUSB0)" to the docker arguments. Full Example:

$ docker run --rm --device /dev/ttyUSB0:/dev/ttyUSB0 --group-add "$(stat -c %g /dev/ttyUSB0)" -e FIRMWARE_URL=https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_coordinator_20230507.zip ckware/ti-cc-tool -ewv -p /dev/ttyUSB0 --bootloader-sonoff-usb

References

This project is an integration of