Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Created February 25, 2019 16:10
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kidpixo/ef1a26ae953e3939a4eebe1b6fd2f07c to your computer and use it in GitHub Desktop.
Save kidpixo/ef1a26ae953e3939a4eebe1b6fd2f07c to your computer and use it in GitHub Desktop.
How I got cc-tool to compile on my macosx (10.12.6)

Use CC-tool for CC253X on my mac

Links

  1. Flashing the firmware on the CC2531 USB stick | zigbee2mqtt.io
  2. dashesy/cc-tool: Mirror of cc-tool from SourceForge
  3. compiling - What is the correct syntax to add CFLAGS and LDFLAGS to "configure"? - Unix & Linux Stack Exchange
  4. Compiling Boost with GCC or Clang on macOS | Solarian Programmer

Compile cc-tool

Following 1 :

brew install autoconf automake libusb boost pkgconfig libtool ##install needed tools to compile the tool :-D
git clone https://github.com/dashesy/cc-tool.git
cd cc-tool\

Then, be sure to use clang++ instead g++ from macport or wathever you have in path. Include boost (c++) library from system (homebrew automagically symlink them under /opt/local/{bin,include}) like:

CC=/opt/local/bin/clang \
CXX=/opt/local/bin/clang++ \
LDFLAGS=-I/usr/local/include \
CPPFLAGS=-I/usr/local/include \
 ./bootstrap

CC=/opt/local/bin/clang \
CXX=/opt/local/bin/clang++ \
LDFLAGS=-I/usr/local/include \
CPPFLAGS=-I/usr/local/include \
 ./configure

make

## now test the executable
./cc-tool --help

Texas Instruments 8051-based System-On-Chip device programmer
 Version: 0.26

 Command line options:
  -h [ --help ]                  produce help message
  --log arg                      create log of all operations
  -d [ --device ] arg            set programmer deivce usb address 'bus:device'
  -f [ --fast ]                  set fast debug interface speed (by default:
                                 slow)
  -n [ --name ] arg              specify target name e.g. CC2530 etc.
  --allow-overlapping-records    allow overlapping records in hex files, the
                                 last one wins (by default: they are
                                 disallowed)
  -i [ --read-info-page ] arg    read info pages
  -a [ --read-mac-address ]      read mac address(es)
  -b [ --write-mac-address ] arg write (secondary) mac address
  -p [ --preserve-mac-address ]  preserve (secondary) mac address across
                                 writing
  -r [ --read ] arg              read flash memory
  -e [ --erase ]                 erase flash memory
  -w [ --write ] arg             write flash memory.
  -v [ --verify ] arg            verify flash after write, method '(r)ead' or
                                 '(c)cr' (used by default)
  --reset                        perform target reset
  -t [ --test ]                  search for programmer and target
  -l [ --lock ] arg              specify lock data in hex numbers or by string:
                                 debug[;pages:xx]
  -s [ --flash-size ] arg        specify target flash size in KB

 Supported targets:
   CC2530 CC2531 CC2533 CC2540 CC2541 CC2543 CC2544 CC2545 CC2510 CC2511 CC1111 CC1110 CC2430 CC2431

 Supported programmers:
  VID: 0x0451 PID: 0x16a2 Description: CC Debugger
  VID: 0x11a0 PID: 0xdb20 Description: SmartRF04 Evaluation Board
  VID: 0x11a0 PID: 0xeb20 Description: SmartRF04 Evaluation Board (Chinese)
  VID: 0x0451 PID: 0x16a0 Description: SmartRF05 Evaluation Board

@mdczaplicki
Copy link

mdczaplicki commented Jan 23, 2024

I'm on Sonoma 14.3 and get this error:

error: cannot find Boost headers version >= 1.74.0

I have to run bootstrap & configure with sudo to get here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment