Tuesday, July 21, 2015

Setup Compile Environment on Windows Cygwin For CC2650/CC2538 Contiki 6LowPAN

The following step-by-step guide shows you how to setup compile environment on Win 7 Cygwin to build Contiki 6LowPAN For CC2650STK, CC2650DK, and CC2538DK.

1. Download and install Cygwin. During Cygwin installation, you have to stop at "Select Packages", put "make" in the seach box, and make sure you select make utility in Devel Category.



2. Install ARM GNU Compiler toolchain. Download and install gcc-arm-none-eabi-4_9-2015q2-20150609-win32.exe. It would be installed to C:\Program Files (x86)\GNU Tools ARM Embedded\4.9 2015q2 and you have to add the path of the installed ARM GNU compiler binaries to PATH environment variable in the Cygwin terminal. To do this, you can add the following line to .bashrc file.

export PATH=/cygdrive/c/Program\ Files\ \(x86\)/GNU\ Tools\ ARM\ Embedded/4.9\ 2015q2/bin/:$PATH

You have to restart Cygwin to enable PATH varibale and type "which arm-none-eabi-gcc" to confirm Cygwin uses correct arm-none-eabi-gcc version.

3. Download and install Msysgit from http://msysgit.github.io/. Remember to select "Use Git Bash only" during installion.





you also have to add the path of the installed Git binaries to PATH environment variable in the Cygwin terminal. To do this, you can add the following line to .bashrc file. You have to restart Cygwin to enable PATH varibale

export PATH=/cygdrive/c/Program\ Files/GNU/bin/:$PATH

4. Switch to C drive by run "cd /cygdrive/c/" under Cygwin. Then, run "git clone --recursive https://github.com/contiki-os/contiki"



5. To build cc26xx-web-demo for CC2650STK, run "cd /cygdrive/c/contiki/examples/cc26xx/cc26xx-web-demo/" and then "make BOARD=sensortag/cc2650 cc26xx-web-demo.bin".



6. After finishing, you will have cc26xx-web-demo.bin under C:\contiki\examples\cc26xx\cc26xx-web-demo

7. You can download cc26xx-web-demo.bin to CC2650STK by using TI Flash Programmer2.

8. For CC2538DK, you can do similar steps to make it work.