The hardware from Lab11 primarily uses the TI CC2538, TI CC2520, and Nordic nRF51822 microcontrollers and radios.
You need an ARM toolchain for embedded devices. Download the gcc-arm-embedded compiler for your machine.
# Need 32 bit libs if you don't have them sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 tar xf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 ### If you get permission errors with programming sudo usermod -a -G dialout <your username> #then logout and log back in
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2 tar xf gcc-arm-none-eabi-4_9-2015q3-20150921-mac.tar.bz2
Make sure the
bin folder is in your path.
To test this, run:
This will let you compile code for the CC2538 and nRF51822.
Git clone the Contiki Operating System. You want to do this recursively in order to fetch the BSL programming script as well.
git clone --recursive https://github.com/contiki-os/contiki.git
Contiki has code support for the CC2538. See the
Make sure that the version of cc2538-bsl in contiki is up to date. They sometimes have a really old version.
cd contiki/tools/cc2538-bsl git pull origin master
Git clone the Atum github repository. This has Contiki code for the Atum platform.
git clone https://github.com/lab11/atum.git
It also contains board files and BOMs for the hardware.
Git clone the ACme++ repository. This has Contiki code and board files for the ACme++ power meter.
git clone https://github.com/lab11/ACmepp.git
The nRF51822 is based on three main parts: the "softdevice" from Nordic, the SDK from Nordic, and an application. The softdevice is essentially the BLE stack and the SDK is a library for the device peripherals. There are multiple softdevices: the S110 is for a BLE peripheral, the S120 is for a BLE master node, and the S130 supports both modes.
Download and the Segger flashing tools for your platform. If you want to do GDB debugging be sure to also download and install the debugging tools.
If you are using Squall, git clone the Squall repository. This has some config files and applications for the nRF51822. Again, do this recursively to get the programming script.
git clone --recursive https://github.com/helena-project/squall
If you are using nucleum, use the nucleum repo:
git clone --recursive https://github.com/lab11/nucleum
Test that things are setup correctly.
You should be able to compile
blink for the Atum board.
cd atum/contiki/apps/blink make
If you get an error, make sure that
CONTIKI = points to where the Contiki repo
is checked out in the Makefile.
Similarly, you should be able to compile
blink for the Nordic platforms.
squall/software/apps/blink make nucleum/software/apps/blink make
If you get an error about no rule to build a .o file, make sure that you have all the git submodules checked out.
Loading code onto the hardware should be pretty straightforward.
Programming the nRF51822 requires loading the softdevice (BLE stack) and then loading the actual code.
Make sure that the blue LED is on on the programming adapter board. If not:
$ JLinkExe > power on perm > ctrl+d
To load the app:
The softdevice will automatically be flashed.
Be sure to check out the https://github.com/lab11/nrf5x-base repo. There are some library functions that make creating a service and advertisements much easier than using the raw Nordic APIs.