Files
JIANT/BUILDING.md
T
Claude 3aff2d438e Retire SAMPLE, GRAIN and SLICE: 140 KB of flash and 32 KB of RAM freed
The sample engines go with their factory samples (and the build's sample
generator). Their engine numbers stay reserved (ENG_GONE, named "-", as
PHYS): a sound of theirs that arrives -- a project, a user preset, the
editor, a backup -- plays as ANALOG's first preset (core.h eng_gone; its
engine motion dropped), a SAMPLE PERC sound still as DRUM-X (converted
first). Image 433 -> 293 KB; RAM -4.5 KB, pool -28 KB, left for DRUM-X,
the effects and the punch-in FX. Goldens: 0 renders changed, the 10 of
the retired engines gone. Web editor and emulator follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-09 13:26:31 +00:00

5.2 KiB

Building Felucca

The build makes three files in build/:

File What
felucca.bin the firmware app
loader/ota.bin the update loader
felucca.fwsc the installable package (app + loader)

Prerequisites (macOS)

  • Python 3 with Pillow and fontTools: pip3 install Pillow fonttools (the UI font and icons are rasterised at build time)

  • Docker Desktop. The JieLi toolchain is Linux x86-64 only; the build runs each tool in a linux/amd64 debian:bookworm-slim container (Rosetta on Apple silicon). Keep the source tree in a folder Docker can share, e.g. under /Users.

  • The JieLi Linux toolchain (clang 4.0.1 for pi32v2, from JieLi's package server):

    tools/get_toolchain.sh            # installs to ~/.jieli/toolchain
    
  • The JieLi AC79 SDK (Apache-2.0). The package uses three of its files (cpu/wl82/tools/uboot.boot, cfg_tool.bin, cfg/eq_cfg_hw.bin); they are not part of this tree.

    git clone --depth 1 --branch AC79NN_SDK_V1.2.1_2023-12-13 \
        https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK.git ~/fw-AC79_AIoT_SDK
    
  • Node.js (optional, for the web tests).

  • Emscripten (optional, emcc: the browser emulator, web/emu/).

On Linux x86-64 the toolchain runs natively and Docker is not needed.

Build

./build.sh

JIELI_TOOLCHAIN and AC79_SDK override the default locations (~/.jieli/toolchain, ~/fw-AC79_AIoT_SDK).

./build.sh --release 1.0 makes a release build: the package identity becomes FM-1_910 and the version string v1.0; the package is build/felucca-1.0.fwsc, and build/release-1.0/ holds what a release ships: the package, the app (felucca-1.0-app.bin), SHA256SUMS, LICENSE, LICENSING.md and LICENSES/ (the package contains Apache-2.0 SDK files, so the licence texts travel with it).

Build options (environment, 0 or 1; defaults in firmware/src/felucca.c, core.h and icons.c):

Flag Default
FELUCCA_FLASH 1 settings, presets and projects in flash
FELUCCA_OTA 1 update entry (needs FELUCCA_FLASH)
FELUCCA_CDC 1 USB serial console
FELUCCA_CDC_DEFAULT 1 0: the console is built in but left out of USB from boot (as MENU > USB SERIAL OFF)
FELUCCA_UAC 1 USB audio input (the master output, stereo, 44.1 or 48 kHz)
FELUCCA_UAC_48K 1 0: the USB audio input at 44.1 kHz only, as up to 1.0.5.2 (firmware/src/usb.c)
FELUCCA_UART 1 TRS MIDI IN
FELUCCA_ICONS 1 parameter icons on the knob cards
FELUCCA_FM4 0 the retired DIGITAL engine (4-operator FM) instead of its FM6 conversion

FELUCCA_USB_LAYOUT (0 to 3, default 0) picks other USB descriptor layouts for testing; see firmware/src/usb.c.

Browser emulator

./build.sh
web/emu/build.sh
python3 -m http.server -d build/emu 8790     # open http://localhost:8790/

web/emu/felucca_web.c builds the firmware's sources as the host tests do, against a simulated FM-1, and Emscripten compiles it to WebAssembly (build/emu/felucca.wasm, with index.html, worklet.js and the font in fonts/). The page keeps the flash's storage sectors (projects, user presets, settings) in the browser. Not emulated: USB (audio, MIDI out, the editor, updates) and TRS MIDI.

Tests

tests/run_tests.sh

Runs the host tests and, with Node.js, the web page tests (and, with Emscripten too, the browser emulator's). Run it after ./build.sh (it uses build/ and needs AC79_SDK set as for the build). The suites cover flash storage, user presets, projects of every format, backup, the keys and knobs, MIDI (USB, TRS, clock, control), USB audio, the update entry and loader, the command-line installer, the UI (the real drawing code against stubs: every screen in every palette is rendered and checked for clipped or overlapping text; PNGs land in build/ui_new/), every engine (DRUM, NOISE, FM6, the DIGITAL conversion), the chord keys, the modulation matrix, the FX layer, the reverbs, the SLICER and swing.

The regression suite (tests/regress.c) renders every engine and preset and compares a hash of each render with tests/golden.txt; it also checks levels, voices and the CPU cost (tests/cpu_baseline.txt, tests/target_budget.txt). After an intended change of the sound, GOLDEN_UPDATE=1 sh tests/run_tests.sh rewrites the hashes; BUDGET_UPDATE=1 does the same for the cost files.

Install

Use the web installer in Chrome or Edge: https://hugelton.github.io/Felucca/webapp/installer/. It installs the released package.

From the command line (needs pip3 install mido python-rtmidi):

python3 tools/fm1_install.py build/felucca.fwsc
python3 tools/fm1_install.py --info          # identity of the connected FM-1

Or, to install your own build from the web installer, make a local copy of the site and open it from localhost (Web MIDI needs a secure context):

python3 web/make_site.py build/felucca.fwsc dev /tmp/felucca-site
cd /tmp/felucca-site && python3 -m http.server 8000
# open http://localhost:8000/webapp/installer/

Installing firmware is at your own risk. If an install fails and the FM-1 no longer starts, recovery needs FM-1-transporter.