Skip to content

Building the OpenDeck firmware

paradajz edited this page Mar 4, 2024 · 38 revisions

This document will explain how to build the OpenDeck firmware. Building the firmware is needed only when creating own board variants since compiled binaries are the part of OpenDeck releases.

Prerequisites

  • Ensure you have docker-ce and docker-compose packages installed before continuing.
  • Ensure that your user account is in docker group so that docker command can be executed without root privileges.

This guide can be followed.

Cloning the OpenDeck repository

Start by cloning the OpenDeck repository:

git clone https://github.com/shanteacontrols/OpenDeck.git

Starting the development environment

From the root repository directory, execute the following:

./scripts/dev.sh

This script will pull the latest container and after that, the container will be started in which it is possible to compile the firmware.

Building the firmware

The firmware can be compiled for several targets. To see which targets are available, open config/target directory in root directory of repository.

The following syntax must be used:

make TARGET=<target>

To compile the firmare for Arduino Mega2560 as an example, make sure the current directory is OpenDeck (root directory of the repository). Next, run the following command:

make TARGET=mega2560

If the command run was successful, output should look like the following:

ubuntu@opendeck ~/workspace/OpenDeck master
> make TARGET=mega2560
Generating CMake files
Generating configuration for MCU: atmega2560
Generating project-specific configuration for MCU: atmega2560
Generating configuration for target: mega2560
Generating HW test config...
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opendeck-deps/arduino/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opendeck-deps/arduino/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /opendeck-deps/arduino/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc
-- Configuring done (3.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ubuntu/workspace/OpenDeck/build/mega2560/release
[91/92] Linking CXX executable application.elf
Memory region         Used Size  Region Size  %age Used
            text:       70236 B       256 KB     26.79%
            data:        5065 B      65024 B      7.79%
          eeprom:          0 GB        64 KB      0.00%
            fuse:          0 GB          3 B      0.00%
            lock:          0 GB         1 KB      0.00%
       signature:          0 GB         1 KB      0.00%
 user_signatures:          0 GB         1 KB      0.00%
Converting elf file to hex
Appending firmware metadata to hex file
Adding firmware CRC at the end of application flash
Converting hex file to bin
[92/92] Generating merged.hex, merged.bin
-- Merging all firmware binary files into a single hex file
-- Appending: /home/ubuntu/workspace/OpenDeck/build/mega2560/release/application.elf.hex
-- Converting merged hex file to bin

Build process creates binaries in build directory. For instructions on how to flash compiled binary to the board, follow this page.

Clone this wiki locally