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

@eizemazal
Copy link

eizemazal commented Mar 13, 2023

why this doesn't work
cc-tool-master % which boost boost not found

because boost is a set of C++ libraries, there is no 'boost' binary in this package AFAIK. which is a tool to show path to binary that will be executed on given command, but there is no binary named boost

cc-tool-master % which cc-tool cc-tool not found

you have to put cc-tool in your path by adding directory with it to your PATH environment variable, or you can just create a symlink to it in a directory that is present in PATH:

sudo ln -s /path/to/your/cc-tool /usr/local/bin/cc-tool

@heartinstaller
Copy link

Thank you @eizemazal,
my CC2541 board is not getting recognized by ccdebugger(status led = RED) after i compiled using this following command and flashed(code was simple led blink). What do you think? i'm guessing i have accidentally erased the bootloader routine due to incorrect command. Please comment.
MacBook-Air Application code % sdcc -mmcs51 --code-loc 0x0000 --data-loc 0x0000 --iram-size 256 -I /usr/local/share/sdcc/include -I . -o ledblink.hex main.c

@eizemazal
Copy link

@gaurav3015 sorry I do not know. In fact I have no experience with CC2541 except for compiling tool for it, so you may better ask someone else about it)

@heartinstaller
Copy link

Thanks @eizemazal

@vkrzt
Copy link

vkrzt commented Dec 28, 2023

Hi guys, trying now on Sonoma 14.0 and getting that error, any suggestions? Thanks

checking for the toolset name used by Boost for /usr/bin/clang++... xgcc42 -xgcc
checking for boost/program_options.hpp... yes
checking for the Boost program_options library... no
configure: error: cannot find the flags to link with Boost program_options

@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