Skip to content

Blog

Freetribe Release

Freetribe is a free, open-source firmware for Electribe 2, built from the ground up using original code and open-source projects. I've been saying 'soon' all year, so here it is.

Project status is 'pre-alpha' and will remain so for the foreseeable future. See the documentation and tutorials for an overview of the system, detailed code documentation can be generated with Doxygen.

Features

In terms of user-facing features, Freetribe doesn't do much, but there is enough here to start building apps, without worrying about how the underlying hardware works. We can process audio and MIDI, handle input from the control panel, print data to the screen and set LEDs.

Architecture

There are two separate firmwares, one for the ARM CPU and the other for the Blackfin DSP. Everything is compiled into the CPU firmware binary, including the DSP firmware and user application. Both systems are currently restricted to their processor's internal RAM. I plan to have the kernels run in the internal RAM, giving user code free rein of the external RAM.

Each kernel is built in layers, dealing with individual peripherals, system devices and higher level services. The DSP firmware is less developed, but will gradually be made more similar to the CPU firmware.

Hacking

To run a Freetribe app we must load it directly into RAM manually. Attaching a debugger is a fairly involved process and requires soldering, but the latest version of Hacktribe allows executing a Freetribe app via MIDI system exclusive. If you're comfortable getting a debugger attached, or you don't mind guessing why the code is broken, set up the toolchain, check out the tutorial examples and build your own app.

Hopefully I can get a scripting engine working so we can hack via the MIDI port, or USB (once we have the drivers). I'll probably start with Lua, because it's fast and relatively simple to implement, then hopefully add MicroPython as it's easier to code.

Future Plans

I'd like to have a virtual modular system attached to a MIDI sequencer, rendering audio to the SD card. There is a long way to go before this is feasible, but the groundwork is there.

If we write low-level drivers for TinyUSB and FatFS we get a lot of functionality for free. For deterministic timing we'll need a real-time scheduler, I think FreeRTOS is the right choice. Drivers for the CPU's External Memory Interface and the DSP's HostDMA port will give us a high speed parallel link for controlling audio parameters, and DMA drivers will reduce the overhead of handling peripheral data.

I want to separate the startup code into a bootloader, allowing us to choose either the factory firmware, Hacktribe, or a Freetribe app at power on. The API and build system will need updating so we can compile position independent apps separately from the kernel and load them at runtime. We probably also want a C++ application framework, so we're not implementing inheritance and virtual functions in C.

Tests and benchmarks might be nice too...