Skip to content

Bootloaders

3djc edited this page Oct 21, 2019 · 5 revisions

Bootloaders

Users are often confused by the various ways the Taranis radio can connect to computers via USB port. The terminology is also confusing since we are talking about two different bootloaders. This page is an attempt to clear things up.

This instruction are valid for OpentTX 2.0 and newer versions.

Some basic explanations first

The OpenTX firmware

The OpenTX radio firmware is usually down-loadable by the OpenTX Companion program and is distributed in a file form with a .bin extension. This file is made of two parts:

  • The first part (32kB) is the OpenTX Bootloader.
  • The second part is the OpenTX main radio firmware, which is placed right behind the first part.

Which part of the radio firmware is invoked depends on the way the Taranis radio is powered on:

  • Both horizontal trim switches held inwards while the radio is switched on - the OpenTX Bootloader is run.
  • Any other switch/trim combination - the OpenTX main firmware is started, this is the normal mode.

Three modes of USB connection

The Taranis radio has three ways of connecting to computer by USB port, each gives different end result. For the average user who wants to update firmware or edit models and settings from the OpenTX Companion the Mode 2 is recommended (OpenTX bootloader), because it should not require any additional drivers to be installed on the computer. If for whatever reason the Mode 2 is not working, then use other options (either Mode 1 or the methods that do not use the USB connection).

Mode 1: The factory installed STM32 DFU Bootloader

This mode is built in into the STM32 CPU that is in the radio. It is a part of the "silicon firmware" and can not be erased or damaged in any way. This is a good thing and means that Taranis radio can not be "bricked". This mode should always work regardless of what the user has done/flashed to the radio.

In this mode, with appropriate software, one can have a full control over the whole FLASH area of the Taranis radio. The FLASH is the non-volattile storage space where OpenTX firmware gets written.

The OpenTX Companion (with appropriate driver) can use this mode and can read and write OpenTX firmware to the radio. In this mode the whole OpenTX firmware gets written to the radio, that means that both OpenTX Bootloader and OpenTX main radio firmware get written. So for example this mode is a fast way to change both the OpenTX Bootloader and the main firwmare to the same version.

To enter into this mode, turn the Taranis radio off. In some cases (bad previous firmware) the radio can not be powered of. It may appear powered of, but in fact it might still be on, because the power is ultimately controlled by the CPU inside the radio and not the mechanical switch. In such cases remove the battery from the radio. This insures that the radio is trully off.

Now, with the radio powered off, plug in the USB cable and connect it to the computer. The USB is providing all the power to the radio in this case.

The radio should respond to computer and identify itself as:

Vendor ID =  "0x0483"
Product ID = "0xdf11" 
Product: "STM32  BOOTLOADER" 

How to use this mode depends on the operating system used on the computer:

Windows

The device manager will recognize the new device and will try to install a new driver for it. The correct driver for this mode is Zadig. More details http://open-txu.org/home/undergraduate-courses/fund-of-opentx/using-zadig/

Linux and MAC

The kernel should recognize the device by itself. You will see this in dmesg:

Aug 16 16:22:35 mambo kernel: [80267.747202] usb 2-1.8: New USB device found, idVendor=0483, idProduct=df11
Aug 16 16:22:35 mambo kernel: [80267.747206] usb 2-1.8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 16 16:22:35 mambo kernel: [80267.747209] usb 2-1.8: Product: STM32  BOOTLOADER
Aug 16 16:22:35 mambo kernel: [80267.747211] usb 2-1.8: Manufacturer: STMicroelectronics

If you have your udev rules set right (they should be if Companion is installed) the user will be able to access this new device with the program called dfu-util.

Mode 2: The OpenTX Bootloader

This is the OpenTX Bootloader written by OpenTX team and is a part of OpenTX firmware. The name is perhaps too similar to the STM Bootloader from case 1. and this often leads to user confusion.

In this mode the radio will present itself to the computer as two disk drives. The first one is virtual, meaning its contents are not existing in file form on the radio. This drive will contain two files: EEPROM.BIN and FIRMWARE.BIN.

EEPROM.BIN file has the contents of the radio EEPROM which is used to store all radio settings and all model settings. Reading and writing this file enables Companion to download models and settings from the radio and to upload them back.

FIRMWARE.BIN file represents the FLASH storage area of the radio where the OpenTX firmware is stored. Writing into this is used by the Companion to flash the radio with the new version of OpenTX firmware. The limitation of this mode is that only the OpenTX main radio firmware part is written/flashed. The OpenTX Bootloader part stays unchanged, because the OpenTX Bootloader is currently the active program and can not erase/overwrite itself. This is also to prevent users from inadvertently overwriting their working OpenTX Bootloader with some other non-working version. So if user upgrades firmware in this mode, only the OpenTX main radio firmware part gets upgraded. The OpenTX Bootloader can be upgraded via SD card, more on that later.

The second drive is the contents of installed SD card.

To enter this mode: start with the radio turned off, USB cable unconnected. Hold both horizontal trim switches inwards and switch on the radio. The "Taranis Bootloader - " will appear on LCD screen. Now connect the USB cable.

The radio represents itself as a USBmass storage device. Every modern operating system has bult-in drivers for such devices and should work out of the box. The radio will identify itself as:

Vendor ID =  "0x0483" 
Product ID = "0x5720" 
Product: "FrSky Taranis Bootloader" 
SerialNumber: "00000000001B"

Note for Windows users having trouble seeing the two drives

I have seen a couple of incidents where user somehow got Zadig driver installed for this mode. In such case the best thing to do is to connect the radio in this mode, go to the Windows Device Manager, find the Taranis radio device and delete its driver. After the USB reconnection of the radio the Windows should now install built-in driver again and two (one on Horus) disk drives should appear.

Mode 3: The OpenTX main firmware USB mode

This mode is used when the normally started Taranis radio is connected to the computer via USB cable. The USB symbol appears on the radio LCD in the top bar of the main screen. What kind of USB device the radio represents in this mode is dependent on the options that user chooses when he downloads the OpenTX radio firmware in Companion:

Vendor ID =  "0x0483"
Product ID = "0x5710"
Product: "FrSky Taranis Joystick" 
  • nojoystick option - the radio will represent itself the same as in case 2. it will appear as two (maybe just one) disk drives and can be used to edit model settings with the Companion. Some users prefer this mode to avodi going into the OpenTX Bootloader to be able to edit their models with Companion. After the USB cable is disconnected the radio will reboot.

  • in future we will have other modes available...

Other ways of upgrading Taranis firmware

This methods only work for OpenTX version 2.0 or newer. The radio must also function, it must have a working OpenTX Bootloader and main firmware already installed. Otherwise there is no other option but to use the Mode 1.

Upgrading OpenTX Bootloader via SD card

This is a way to update the OpenTX Bootloader on the Taranis radio without USB connection.

Steps to upgrade:

  • Download the OpenTX firmware via Companion and remember where you saved it.
  • Turn off the Taranis radio and take out the SD card, put it in a SD card reader and connect to computer.
  • Copy downloaded file (it will have .bin extension) to the SD card into the FIRMWARES directory (FIRMWARE for OpenTX 2.2). Make sure that the file name is no longer than 32 characters (including the dot and extension which take 4 characters)! Rename it if it is longer otherwise the file will not be visible on the radio.
  • With the SD card installed back in the radio and the new firmware on it, turn on the radio normally. Long press the MENU key and navigate to the SD CARD page. Navigate into FIRMWARES directory (FIRMWARE for OpenTX 2.2), select the new firmware file and with ENT key select option "Flash BootLoader". This will overwrite the Bootloader part of the radio FLASH with the new version from the selected file.

Upgrading OpenTX main radio firmware via SD card

This is a way to upgrade the OpenTX main radio firmware without USB connection. Some of the steps are very similar to the instructions in previous section. In fact the same file on the SD card can be used for both steps.

Steps to upgrade:

  • Download the OpenTX firmware via Companion and remember where you saved it.
  • Turn off the Taranis radio and take out the SD card, put it in a SD card reader and connect to computer.
  • Copy downloaded file (it will have .bin extension) to the SD card into the FIRMWARES directory (FIRMWARE for bootloader 2.2). Make sure that the file name is no longer than 32 characters long (including the dot and extension which take 4 characters)! Rename it if it is longer otherwise the file will not be visible on the radio.
  • With the SD card installed in the radio and the new firmware on it, turn on the radio in OpenTX Bootloader (both horizontal trims held inwards while switching on).
  • Select option "Write Firmware"
  • Select the new firmware file and then hold ENT key to start writing it.

Alternative way of editing radio settings and models in OpenTX Companinon without USB connection

There is a way to use the Taranis radio and OpenTX Companion without the USB connection. It involves a few more steps:

  • Turn on the radio in normal mode. Go into VERSION screen (long press MENU then PAGE three times)

  • Long press ENT key, this will make a copy of current EEPROM (this is where radio and model settings are stored) to the SD card into the EEPROMS directory (EEPROM for OpenTX 2.2). First make sure that you the directory exists on the SD card, otherwise you will get an error.

  • The file created on the SD card in the EEPROMS directory (EEPROM for OpenTX 2.2) will have name like eeprom-2014-08-17-18-04-40.bin. The name contains current date and time (uses radio's RTC time).

  • Turn off the radio, take out the SD card, put it into the SD card reader, connect to the computer.

  • Start OpenTX Companion and open the file you just created on the SD card drive. You now have your existing radio setup (including radio calibration) and any already defined models opened in Companion.

  • You can first make a copy of the configuration by using menu option Save as... to store that file somewhere on your local hard drive.

  • Then make your changes in OpenTX Companion.

  • When you are ready to transfer your new models and settings to the radio, use the Save as.. menu option again, but this time save a new file to the SD card in EEPROMS directory (EEPROM for OpenTX 2.2). Take care not to exceed the file name length limit of 32 characters (which includes 4 charaters for ".bin") (in reality the OpenTX Bootloader supprots longer file names, but they won't be visible in the OpenTX main radio firmware (normal mode)). Remember the name of the new file.

  • Put the SD card back into the radio and turn it on into the OpenTX Bootloader (by holding both horizontal trim switches inwards while switching on the radio).

  • In the OpenTX Bootloader menu select Restore EEPROM option, select your new file and follow instructions on LCD.

  • The radio now has in its EEPROM the new setup that you just created in the OpenTX Companion. Restart the radio in normal mode to use it.

Each time you want to add something in Companion I suggest you repeat the whole process. This way ensures that you don't loose radio calibration settings and any model trim or other changes since the radio was last edited with Companion.

Troubleshooting

Try another USB cable! Even if it works with something else, there are a number of USB cables that are not suitable to power the radio during this type of operation.

Some people have reported issues getting the Taranis Radios to be detected, regardless of any of the above methods. It should be noted that if the factory installed boot loader (using Mode 1) isn't recognized by your machine, it is not a problem with OpenTX. The STM32 firmware isn't touched by OpenTX, and thus should always work. Thus this points likely to incompatibility between your computer's USB chipset and whatever firmware is embedded into the STM32 chip in the Taranis.

Below, are some notes and suggestions that may assist with troubleshooting

Does the User Need to Install Zadig or Dfu-util Separately when Connecting Using OpenTX Bootloader Mode

Use this table to determine if additional drivers need to be installed prior to connecting the transmitter in bootloader mode and launching Companion.

Tx OpenTX Boot Loader PC OS Add PC Driver
X-Lite 2.2 Any No
X7 2.2 Any No
X9D 1.x Windows Zadig
X9D 1.x Linux *
X9D 1.x Mac *
X9D 2.x Any No
X9D+ 2.x Any No
X9E 2.x Any No
X10 FrOS Windows Zadig
X10 2.2.1 Windows Zadig
X10 2.2.2 + later Windows No+
X10 2.2 + later Linux *
X10 2.2 + later Mac *
X12S FrOS Windows Zadig
X12S 2.2.1 Windows Zadig
X12S 2.2.2 + later Windows No+
X12S 2.2 + later Linux *
X12S 2.2 + later Mac *

*MAC Note: Companion 2.2 for Mac comes with Dfu-util. So while Dfu-util is required it comes with Companion on a mac and hence does not need a separate install by the user.

*Linux Note: Precompiled Companion 2.2 binaries for Linux obtained from the OpenTX website comes with a Dfu-util dependency. If it is not present it will be installed. So while Dfu-util is required it does not usually need a separate install by the user. If you get a command not found error then install Dfu-util. You may need to post in the forums to get help since there are many distributions and package variations for Linux.

+X10/X12S Note: To install OpenTX 2.2.2 or later on the Horus series Zadig is required. Once installed Zadig is no longer required.

Dfu-util http://dfu-util.sourceforge.net

MAC

Some users have reported problems with USB connections on various Mac platforms. For example, some users of the MacBook Air have reported that direct connection fails. While this may be an issue around the STM32 and USB 3.0 chipsets, valid work arounds include using a Cinema or Thunderbolt Display's USB ports, or using a third party USB hub

Reported problematic chipsets:

Model: MacBook Air 13" (Early 2015)
Chipset: BRCM20702 USB 3.0
Product ID: 0x4500
Vendor: 0x0a5c  (Broadcom Corp.)
Version: 1.0

Windows

Some users have problems with USB connections especially when using USB 3.0 ports. The page https://github.com/libusb/libusb/wiki/Windows might hold a solution for them.

Clone this wiki locally