-
-
Notifications
You must be signed in to change notification settings - Fork 796
OpenTX 2.3 Docker Build Instructions
With Docker and the prepared build machine configuration, a reliable and cross-platform way of compiling the firmware exists.
These instructions will enable you to produce your own firmware binary files, which can be written to the radio via the OpenTX Companion app.
In order to run the Docker image, you need to install Docker on your machine. Docker is available as a Community Edition, which is free (free as in free beer). It's recommended to follow https://docs.docker.com/install/.
Clone the sources to your local development machine and switch to the '2.3' branch.
git clone https://github.com/opentx/opentx.git
cd opentx
git checkout 2.3
The provided image ensures consistent libraries and toolchain is used, in order to create reliable binaries.
cd radio/util
docker build -t opentx .
The following example assumes you've checked out the "2.3" development branch and want to compile the firmware for an X-Lite S radio.
# assuming you're in the project root folder of opentx,
# which is /your/project/root/folder/opentx --> this needs to be mounted as volume under /opentx
mkdir build-xlites
docker run -v /your/project/root/folder/opentx:/opentx -e "OPENTX_VERSION_SUFFIX=2.3" -w /opentx/build-xlites opentx cmake -DPCB=XLITES -DGVARS=YES -DLUA=YES -DLUA_COMPILER=YES -DHELI=NO -DDEBUG=NO -DCMAKE_BUILD_TYPE=Release ../
docker run -v /your/project/root/folder/opentx:/opentx -e "OPENTX_VERSION_SUFFIX=2.3" -w /opentx/build-xlites opentx make firmware
The firmware file is now ready to be written to the radio: firmware.bin
.
You can look up the -D...
compiler options in the wiki: OpenTX Compilation Options.
As an alternative, you can run the docker command with cmake -LH
to get all options.
IMPORTANT: When writing firmware to your radio, there's a risk you break/damage it. It's recommended to make a backup of your previous firmware first.
Once the firmware.bin
was successfully built, it's time to use the OpenTX Companion application.
If you don't have this application already installed, just get a fresh copy from https://www.open-tx.org/downloads.
In order to write the firmware to the radio, follow these steps
- connect your radio via USB
- start OpenTX Companion application
- within the OpenTX Companion application, go to the menu "Read/Write"
3.1. To make a backup, select "Read firmware from the radio" and follow the instructions. - click the menu item "Write Firmware to the radio".
- in the dialog, click the file chooser button on the right and select the
firmware.bin
file - verify the dialog shows the right version (2.3) and built timestamp from your firmware
- optionally: select a start screen image
- finally, click the "Write to TX" button