Contiki OS on Mac OSX + Zolertia Z1 MOTES(msp430-gcc-47)

 It is possible to run Contiki OS on OSX, but it took me several days to do so. Fortunately it is easy as eating pie, so here it goes:

 

 

http://zolertia.com/products/z1

 

1 ) Get Contiki OS

 

git clone https://github.com/contiki-os/contiki.git contikiOS

 

or 

 

wget https://sourceforge.net/projects/contiki/files/Contiki/Contiki%202.7/contiki-2.7.zip

 

for the latest 2.7 version of contiki.

 

 

2 ) Compile/install the TOOLCHAIN for msp430 processors

 

It is crucial that you use the development version, as the long term supported toolchain msp430, on version 4.6.3, has a bug on the display of the mote's readings in the console (as shown in the image):

 

sudo port install msp430-binutils-devel msp430-gcc-devel msp430-gdb-devel msp430-libc-devel msp430mcu-devel mspdebug 

 

This is MANDATORY, and, at the end, you should have the following packages installed:

msp430-addr2line  

msp430-cpp        

msp430-gcc-ar     

msp430-ld         

msp430-ranlib     

msp430mcu-config

msp430-ar         

msp430-elfedit    

msp430-gcc-nm     

msp430-ld.bfd     

msp430-readelf    

mspdebug

msp430-as         

msp430-g++        

msp430-gcc-ranlib 

msp430-nm         

msp430-size        

msp430-c++        

msp430-gcc        

msp430-gcov       

msp430-objcopy    

msp430-strings      

msp430-c++filt    

msp430-gcc-4.7.0  

msp430-gprof      

msp430-objdump    

msp430-strip       

 

 

3 ) Install the support for the Zolertia Z1 hardware

 

Install the latest VCI drivers from SiLabs:

"CP210x USB to UART Bridge VCP Drivers

 

The CP210x USB to UART Bridge Virtual COM Port (VCP) drivers are required for device operation as a Virtual COM Port to facilitate host communication with CP210x products. These devices can also interface to a host using the USBXpress direct access driver."

http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx

 

BSL (Bootstrap Loader).

You have more than one option (see http://processors.wiki.ti.com/index.php/BSL_(MSP430)), but I chose mine, based on python as contikiOS itself

 

PySerial

pyserial (download from http://pypi.python.org/pypi/pyserial)

(in command line:) python setup.py install

 

PYTHON-MSP430-TOOLS

python-msp430-tools (not mandatory, but it helped me debuging several problems)

download ActivePython (https://code.activestate.com/pypm/python-msp430-tools/)

(in command line:) pypm install python-msp430-tools

 

In order to fix the following error while "make login" into the mote: 

"... serialdump-linux: cannot execute binary file"

we need to do the extra steps:

 

 

4 ) Recompile the file contiki/tools/sky/serialdump.c

 

This is so because the serialdump-linux was compiled for 32bit environments:

 

cd contiki/tools/sky

 

edit serialdump.c file:

 

mate serialdump.c

 

edit the following lines:

 

#define BAUDRATE B57600

#define BAUDRATE_S "57600"

 

for Z1's correct baudrate:

 

"#define BAUDRATE B115200

#define BAUDRATE_S "115200""

 

(in command line:)  gcc -o serialdump-macos serialdump.c

 

 

5 ) Edit the file contiki/platform/z1/Makefile.common

 

In the line 63: 

 

"SERIALDUMP = $(CONTIKI)/tools/sky/serialdump-linux"

 

and put your compilation:

 

"SERIALDUMP = $(CONTIKI)/tools/sky/serialdump-macos"

 

 

 

 

Published by fxsf às 20:02