DIY & Hardware
Development in Linux (and MacOS)
Install system dependencies
With apt, pacman, brew, or the equivalent package manager of your system, we have to install:
Downloading the firmware source code
git clone https://github.com/inputlabs/alpakka_firmware
Install additional libraries
This script will install the Pico C SDK, and the ARM architecture toolchain. It may take a while since the ARM toolchain download is big and slow.
cd alpakka_firmware make install # It may take several minutes.
To setup the build environment and to compile for first time:
If the build was successful then the firmware file is created at build/alpakka.uf2. After this point we can use reuse the compiling environment and cache to compile faster (even if we change the source code):
Load the firmware into the controller
With the controller in Bootsel mode or having an active Session, we can now flash the firmware into the controller memory with:
Connect via session
For development purposes or just to troubleshot problems, it is possible to establish a bidirectional communication with the controller via the Developer Port (the JST port above the USB) using a TTL serial cable (see Developer Kit), so then the controller can output data into your terminal, and the controller listen to commands sent from the terminal.
Using make session will create a GNU Screen session, with a log similar to this:
make session ╔════════════════════════════╗ ║ Input Labs Oy. ║ ║ Alpakka - firmware 0.82.10 ║ ╚════════════════════════════╝ Config NVM: config_version=6 os_mode=0 profile=1 sensitivity=0 deadzone=0 Config I2C: I2C bus I2C_IO_0 ack=1 I2C_IO_1 ack=1 Config SPI Config thumbstick Config touch Config rotary Config profiles Config IMU: IMU_0: CTRL2_G=0x10100000 IMU_1: CTRL2_G=0x10100000 Profile: 1 USB: tud_ready TRUE
Now in another terminal we can also use make restart or make bootsel instead of using the Developer Kit reset button (as long as the controller program did not crash). And also some other tooling will automatically use this communication channel if active.
Developer quality of life
Additionally, for faster development cycles we can use make reload, which will automatically rebuild the firmware, put the controller into bootsel mode, and flash the controller. Now that's convenient!
make reload = make rebuild + make bootsel + make load
make reload [ 16%] Completed 'ELF2UF2Build' [ 64%] Built target ELF2UF2Build [100%] Built target alpakka Expecting drive at: /media/RPI-RP2 Requesting controller to go into Bootsel Waiting for RPI-RP2 drive UF2 loaded into Pico
To check all other developer commands, check the Firmware repository Readme.