Like last year the Bornhack 2018 badge has a SiLabs Happy Gecko microcontroller, but this year it also sports a Nordic nRF51 Bluetooth enabled microcontroller.
The Happy Gecko is a Cortex-M0+ with built in USB, specifically we are using the EFM32HG322F64G. You can download the Happy Gecko reference manual and datasheet directly from SiliconLabs.
The Nordic chip as a nRF51822 that has a built-in Cortex-M0 that you can also program.
We have separated the hardware design files from the code and put them in the hardware branch for you to have a look at and build on.
If you just need to check the pinout or want to see how stuff is connected, you can have a look at the schematic as a pdf file.
We have also made a bunch of different add-on boards, and those are to be found in the breakoutboards branch, which also includes a bit of information about the parts needed for each boards.
To program the nRF51822 radio controller, you can use the nRF51 programmer and if you don't want to compile that yourself, you can download a binary ready to be programmed on your badge.
This piece of firmware runs at full speed and is not power optimized, so to have a decent battery life, you can put back the default firmware on the Happy Gecko, when you have finished programming the nRF51822.
For doing a restore of the firmware that the badge was delivered with, you can either checkout and compile this master branch, or simply download the binary version and program the badge with it using the bootloader.
pacman -S arm-none-eabi-gcc arm-none-eabi-newlib make
apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi make
Unfortunately the toolchain in Ubuntu Trusty 14.04 is too old to work out of the box.
dnf install arm-none-eabi-gcc arm-none-eabi-newlib make
Download an arm-none-eabi toolchain from ARM here.
Unpack the tarball and update your PATH variable to point to the unpacked bin
directory.
Download the apropriate installer from ARM here. Install it and update your path. You'll also need GNU Make installed. A pre-built version can be downloaded here.
Use Windows Subsystem for Linux with Ubuntu 16.04 Xenial or newer and proceed as on Ubuntu above.
If you already have git installed
git clone https://github.com/bornhack/badge2018.git
cd badge2018
Otherwise you can download a tarball or zip file from https://github.com/bornhack/badge2018
Simply type make
in the downloaded directory.
If the build fails (fx. on Debian Jessie and Ubuntu Xenial)
try editing the Makefile
and uncommenting the line which says OLD=1
.
If there are no compilation errors this will result in a code.bin
in the out
directory.
The bootloader emulates a USB mass storage device with a fat12 filesystem. Writing a .bin file to this filesystem will program the chip. To use it:
- Connect the USB cable to the board and your computer.
- Press the BOOT button on the badge.
- Copy the generated
out/code.bin
-file to theGECKOBOOT
USB stick that appeared on your computer. - Eject (or unmount) the USB stick, and watch your code run.
Alternatively you can install a program called dfu-util. With this program installed
you can simply put the badge in bootloader mode by pressing the BOOT button,
and then type make dfu
. Usually your dfu-util package comes with rules to give
your user (and hence dfu-util) access to the raw USB device. If not you might need
sudo make dfu
.