Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 4.93 KB

Samples.md

File metadata and controls

85 lines (58 loc) · 4.93 KB
layout title permalink
default
Tomu Samples
/samples

Tomu is all about being open and hackable. It's important to have a good starting point. Below we have a selection of precompiled programs, along with links to their source code.

To try out these samples, download the .dfu file and load it with dfu-util --download.

Project DFU Description
bare-minimum bare-minimum.dfu Does nothing, forever, without crashing.
miniblink miniblink.dfu Blink the two LEDs using the SysTick timer.
usb-hid usb-hid.dfu Emulate a USB mouse, and wiggle the cursor back and forth.
usb-msc usb-msc.dfu Emulate a very small "USB Mass Storage" disk drive.
usb-midi usb-midi.dfu Provide a USB MIDI device that continuously sends NoteOn and NoteOff events.
usb-cdcacm usb-cdcacm.dfu Communicate with Tomu over a virtual serial port.
opticspy opticspy.dfu Interactive shell to communicate with an OpticSpy

Installing dfu-util

The dfu-util suite of programs is used to talk to Toboot, the Tomu bootloader. Most package managers have some form of dfu-util available.

Ubuntu and Debian

sudo apt-get install dfu-util

Create /etc/udev/rules.d/10-tomu.rules and populate it with the following:

ATTRS{idProduct}=="70b1", ATTRS{idVendor}=="1209", MODE="777"

(Note: you can give it a more restrictive mode if you also give it a group that you're in)

Fedora

sudo yum install dfu-util

Arch

sudo pacman -Sy dfu-util

Windows

Download dfu-util-static.exe from the dfu-util repository and rename it to dfu-util.exe. Place it somewhere in your $PATH for convenience. To build examples, you'll also want to get dfu-suffix.exe and put it in your $PATH.

Mac

Install Homebrew and run:

brew install dfu-util

Compiling Samples

To compile the samples, you will need an ARM compiler, make, and dfu-util. The steps to install these files vary depending on your operating system:

Platform ARM Toolchain Make dfu-util
Windows GNU Arm Embedded Toolchain GNU Win32 Make precompiled binaries
macOS GNU Arm Embedded Toolchain Xcode Homebrew brew install dfu-util
Debian/Ubuntu sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi sudo apt-get install make sudo apt-get install dfu-util
Fedora sudo dnf install arm-none-eabi-newlib arm-none-eabi-gcc-cs-c++ sudo dnf install make sudo dnf install dfu-util
Arch sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib sudo pacman -S make sudo pacman -S dfu-util

Additionally, you may want to install git, or at least have a way to checkout git repositories.

To compile a sample, simply change into its directory and type make. This will produce a variety of files, including a .dfu file that you can upload with dfu-util --download

Creating a new Project

To create a new project, simply create a new directory in the quickstart directory and copy over the Makefile from an existing project. Then start adding .c files.

To see a simple example of this, look at bare-minimum, which does nothing but compile and run forever.