Code Monkey home page Code Monkey logo

joco-2018-badge's Introduction

joco-2018-badge

Code and documentation for the unofficial electronic badge for the JoCo Cruise 2018.

This is based on the excellent work that the AND!XOR team produced for the DEFCON 25 Bender Badge.

All code and hardware design files are closed until Feb 26th, 2018 and then are licensed under the Apache license 2.0 unless superceded by notices in individual files or directories.

Getting Started

Some resources must be installed outside of this source tree. One of these is the Nordic SDK.

Choose a place to install these on your file system. For example, we'll use "/src/joco-support/".

Download the version 12.3 of the Nordic SDK from here and unzip it into the directory you chose.

It's known that later versions of the SDK are not compatible with the existing badge code. We may work on fixing that, which is why we don't install the SDK in the source tree for the project.

Now edit your shell init or rc file to set the following environment variable when you create a shell, substituting your chosen path:

export SDK_ROOT=/src/joco-support/nRF5_SDK_12.3.0_d7731ad

Ubuntu Installation (non-ARM host)

Download the GNU ARM Embedded Toolchain. Choose one of these methods:

Then edit $SDK_ROOT/components/toolchain/gcc/Makefile.posix and change the value for GNU_INSTALL_ROOT to the directory where your toolchain was installed.

If you plan to hook up hardware for programming and debugging, you'll need the Segger JLink software. It's available from https://www.segger.com/downloads/jlink/ for a variety of host platforms. We used version V6.18b, but the latest version is probably fine. To install on Ubuntu on an Intel PC:

sudo dpkg -i <path-to-downloads>/JLink_Linux_V618b_x86_64.deb

You'll also need a couple of command line tools from Nordic. These are available from http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.tools/dita/tools/nrf5x_command_line_tools/nrf5x_installation.html?cp=5_1_1. We used version 9.7.0, but the latest version is probably fine. Install them in a location outside this project, like the Nordic SDK. For example using the location "/src/joco-support", you can do the following:

mkdir -p /src/joco-support/bin
cd /src/joco-support/bin
tar xvf <path-to-downloads>/nRF5x-Command-Line-Tools_9_7_0_Linux-x86_64.tar

Now edit your shell init or rc file to set the following environment variable when you create a shell, substituting your chosen path:

export NRFJ_BIN=/src/joco-support/bin

Ubuntu on an ARM Host

If you want to develop on an ARM-based host, most of the components are available.

The Nordic SDK is the same.

You should be able to sudo apt-get install gcc-arm-none-eabi to get the toolchain.

You can get JLink software from Segger here

The command line tools nrfjprog and mergehex are not currently available for ARM hosts. You can use the JLink tools to program the device, so you can probably work around nrfjprog.

Build the code

cd firmware/manbearpig

make

cd ..

./update.sh

JTAG interface hardware

To flash the code to the badge and use the Ozone debugger, you'll need a JTAG hardware interface. The one that was used by the development team is the Segger J-Link EDU Mini.

It's much easier to connect to the board if you use a short flat cable and a mating header on the board end. All these can be purchased from these retailers:

Flashing the target

Two ways, either:

cd firmware

./provision.sh

or

cd firmware/manbearpig

make flash_softdevice

make flash

The make flash_softdevice can be omitted after the first time.

Setting up the Segger Ozone debugger

This was correct for Ubuntu 14.04.5 64 bit

Install the Ozone package from here

The manual is useful (same link)

IMPORTANT NOTE:

Ozone version 2.56 would not work for me. It would halt execution in seemingly random places and not load source code.

Version 2.54b works fine

If you're using the Segger edu device, Select the device as Nordic nRF52832_xxAA

Choose SWD for the debugger device and NOT USB.

open the badge .out file to bring in source files

joco-2018-badge's People

Contributors

amyh12 avatar mustbeart avatar n5ac avatar sconklin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joco-2018-badge's Issues

Score not saved after CHIP8 Game

Go into a CHIP8 game, say AIRPLANE, and let it run for more than a minute. Exit the game. You now have 20 points more than before, which you can see on the Score screen or on the Wall. Power off the badge, and power it back on. The 20 points are gone and your score is back to the previous saved value.

Make SD cards swappable without destroying progress

We need to be able to move SD cards between badges for swapping bad badges, and allow people to keep their score and bling unlocks. This is a bit problematic now because of the way we use the GAP address and device ID.

Hello and scoring pacing might be too short

The "Hello" pacing of one per minute, combined with a maximum score rate of one badge per minute, made it a little hard for new badge holders to navigate the menus if there were a lot of badges around. Every time a 'hello' or 'score' starts, you have to wait for it to finish before proceeding.

LEDs not cleared after hello or score

When hello/score interrupts a bling, LEDs are not cleared afterwards, and this leads to weird looking bling modes or LEDs stuck 'on'. The hello and score blings are asynchronous to any which are running, and we need to look at the entry/exit for these to make sure they play well together.

Characters appended to names

Sometimes names in the score list have appended characters from other badges. Occasionally you see a short badge name with trailing characters from a longer badge name.

Dispenser: "Where did you go"

This error displays after tagging in at the dispenser with a badge. Cycling power on the badge usually helped, and it seemed like keeping the badge very close to the dispenser until the trinket was dispensed also helped. It seemed worse when there were many (8-12) badges near the dispenser.

Badge names duplicated in the nearby list

Sometimes the same badge name appears in the list more than once. This is for people's names, not the default names, which means there's a failure to deduplicate somewhere. This could also be related to the 'score badges more than once" bug.

I/O pins on expansion port don't match TCL definitions

The list of IO pins that can be twiddled from TCL didn’t get updated to match the board layout.

This is because we reassigned some pins that were used for the Bender badge, in order to free up the NFC antenna pins.

Badge is too bright at night

We really need a night mode or light level sensor. And/or a was to turn off hello and score blings, or at least just the LEDs. In dark areas (like during concerts) the badges are very bright.

Frame rate too high if no LCD bling playing

When custom bling is selected with no LCD animation plus an LED animation, the LED play frame rate is high. Possibly because the LED callback is normally determined by the LCD refresh rate, but I haven't looked at the code.

Tilt switches are sticky and noisy

The tilt switches are kinda crappy and noisy. If we use the same switches, we should put a longer filter on them. An accelerometer would be way better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.