klondi / badge2018

The BornHack 2018 badge and related info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bornhack Badge 2018

About the hardware

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.

Binary firmware files for quick programming or restore

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.

Develop software for the Happy Gecko

1. Install dependencies

Archlinux
pacman -S arm-none-eabi-gcc arm-none-eabi-newlib make
Debian/Ubuntu
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.

Fedora
dnf install arm-none-eabi-gcc arm-none-eabi-newlib make
OSX

Download an arm-none-eabi toolchain from ARM here. Unpack the tarball and update your PATH variable to point to the unpacked bin directory.

Windows
Option 1

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.

Option 2

Use Windows Subsystem for Linux with Ubuntu 16.04 Xenial or newer and proceed as on Ubuntu above.

2. Get the source code

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

3. Build the code

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.

4. Program the badge with your compiled code

Option 1

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:

  1. Connect the USB cable to the board and your computer.
  2. Press the BOOT button on the badge.
  3. Copy the generated out/code.bin-file to the GECKOBOOT USB stick that appeared on your computer.
  4. Eject (or unmount) the USB stick, and watch your code run.
Option 2

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.

About

The BornHack 2018 badge and related info


Languages

Language:C 98.1%Language:C++ 1.7%Language:Makefile 0.1%Language:Assembly 0.1%