Burning the Taranis Firmware under linux

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Burning the Taranis Firmware under linux

Post by Rob Thomson »

So...

I have df-util and companion working under windows. Easy.

Under linux... df-util always complains.

Anyone got any hints on how to configure it?

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Burning the Taranis Firmware under linux

Post by Kilrah »

Dfu-util is only needed for flashing the firmware, NOT for transferring the eeprom.
Eeprom is accessed as a disk drive when the radio is on.

On linux you should be able to install dfu-util from your favorite package source, or dowbload/build as usual.

Sent via mobile
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Burning the Taranis Firmware under linux

Post by Romolo »

dfu-util supplied by several distributions is rather old...

You need at least 0.6, but 0.7 will be your friend....
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

OK. I am on 0.5

That may well be the issue.

Yes.. Well aware needed for flashing only :)

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

Right. I have some success.

To get this all working, the first thing you MUST have is the right version of dfu-util.

Version 0.7 works well. Download it from here: http://dfu-util.gnumonks.org/

You will need to compile this. (assume you have compile software installed)

So...

Code: Select all

tar -xvzf dfu-util-0.7.tar.gz
cd dfu-util-0.7/
./configure
sudo make install
It should have ended up in /usr/local/bin/dfu-util

Now.. a few things need to be done for companion. First things first - you need to run with elevated privileges. As this is a gui app, we will use a gui version of sudo.

Edit your launcher for companion too:

Code: Select all

gksudo -k /usr/bin/companion9x
This starts companion with elevated privileges. The -k option tells gksudo to keep the profile settings in your home folder!

Now. Once you have setup a profile in companion for taranis, you need to edit the burn preferences.

By default these are set to use /usr/bin/dfu-util

Change the path to /usr/local/bin/dfu-util

Done!
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

dfu-util uses libusb, which opens the USB devices raw. Most distros don't allow that to non root users.

Running c9x as root works. Better would be to fix the permissions of the USB devices. Either by udev rule for that specific device, or I think some distros have a group names usb or so that has permissions to access raw devices.
I ran c9x on my mates Ubuntu computer (btw Ubuntu has a dfu-util package as has probably any other distro) that is why I went the easy route to run it via sudo.
Once I do the same in my on computer, I will fix the permissions right...

Harmless compared to how it went with Windows8. I pity the fool who tries. The kind of hoops you have to jump to install unsigned drivers is insane. Once I got avdrude working (force the driver) and running avrdude as Administrator I tried dfu-util. Forget it!
I gave up after three hours or so. No idea if it is possible. I went with Win because I thought that will be the easiest way. 10min later I had it all done on Ubuntu.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

Agreed

Then reason I suggested the option is because most people don't have a clue how to setup udev.

The Sudo option is generally easy for all :shock:

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

PS: Perhaps I should mention that somewhere else. But I thought I mention it. The c9x workflow of upfating firmware and backing up models before is broken.
Because for one the radio has to be running and USB plugged in. And for the other the radio needs to be off. It will have to prompt the user to put the radio in the right mode, or have a way to do that via USB.
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

Rob Thomson wrote:Agreed

Then reason I suggested the option is because most people don't have a clue how to setup udev.
We should write a udev rule for that and add it to the linux build of c9x.
Once one has build one that works. :)
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Burning the Taranis Firmware under linux

Post by Kilrah »

Backup is disabled if the radio is a Taranis - not sure it has made it to release yet though.

Sent via mobile
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

Kilrah wrote:Backup is disabled if the radio is a Taranis - not sure it has made it to release yet though.
Oh well, that solves that problem. :)
Taranis will no longer need model memories to be merged after being upgraded?
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

tilmanb wrote:
Rob Thomson wrote:Agreed

Then reason I suggested the option is because most people don't have a clue how to setup udev.
We should write a udev rule for that and add it to the linux build of c9x.
Once one has build one that works. :)
You fancy writing it?

I am sure Romolo would be happy if you supplied it for him .

Rob

Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Burning the Taranis Firmware under linux

Post by Kilrah »

Eeprom only needed to be processed by c9x when the format changed maybe once or twice a year, the rest of the time the process is only to restore the exact same as eeprom got wiped when flashing the avr.

Sent via mobile
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

I suppose we can still expect that to happen again?
I would rather have the migration in the radio. I have never seen the code which did that, but would you think it would be possible to have that same code running on the TX with Taranis? Would make things a lot more robust. Especially if you share models via SD card.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Burning the Taranis Firmware under linux

Post by Kilrah »

Yes there is already a mechanism in place to upgrade eeprom within the TX.
IMO at some point a backup of the full EEPROM to card will be needed though, as having everything on the radio means a bug in the conversion would cause damage.
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

Sweet
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Burning the Taranis Firmware under linux

Post by Romolo »

Anyway about udev rules.
I do not agree that companion changes them during install or at runtime.
I hate programs modding system settings without explaining.
Maybe we can supply a small standalone tool to install the rules, explaining what we are doing and for which reasons...
(Once we will have understood how to modify them).
norty303
Posts: 2
Joined: Tue Nov 20, 2012 8:51 pm
Country: -
Location: Eastbourne, East Sussex
Contact:

Re: Burning the Taranis Firmware under linux

Post by norty303 »

Has the 'check firmware compatibility' tick been removed for Taranis too, as that suffers the same issue as Tilman raised re: Tx needing to be on and off at the same time
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Burning the Taranis Firmware under linux

Post by Romolo »

norty303 wrote:Has the 'check firmware compatibility' tick been removed for Taranis too, as that suffers the same issue as Tilman raised re: Tx needing to be on and off at the same time
thanks for highlighting...
User avatar
tilmanb
Posts: 347
Joined: Thu Oct 11, 2012 9:36 pm
Country: Germany
Location: Karlsruhe, Germany

Re: Burning the Taranis Firmware under linux

Post by tilmanb »

Romolo wrote:Anyway about udev rules.
I do not agree that companion changes them during install or at runtime.
I hate programs modding system settings without explaining.
Maybe we can supply a small standalone tool to install the rules, explaining what we are doing and for which reasons...
(Once we will have understood how to modify them).
I strongly disagree.
First we don't modify rules, we add them. (rules.d/)

And c9x is a hardware near programme, practically a driver. Drivers bring their own udev rules of course.

And secondly we can't just fully open permissions Willi Nilly. Either we give the devices to the plugdev group or we install a companion group. The user still has to add himself to that group.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Burning the Taranis Firmware under linux

Post by rperkins »

I concur with tilmanb. A properly written udev rule will not affect other devices and give the permissions needed to access the hardware. The rule will even stay in place if udev or the OS is upgraded
tilmanb wrote:
Romolo wrote:Anyway about udev rules.
I do not agree that companion changes them during install or at runtime.
...snip..
I strongly disagree.
First we don't modify rules, we add them. (rules.d/)

And c9x is a hardware near programme, practically a driver. Drivers bring their own udev rules of course.

And secondly we can't just fully open permissions Willi Nilly. Either we give the devices to the plugdev group or we install a companion group. The user still has to add himself to that group.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

So who is going to write us a little rule? :-)

My UDEV skills are rubbish!
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Burning the Taranis Firmware under linux

Post by rperkins »

this page is a good start
https://code.google.com/p/eepe/#Fixes_in_Linux/Ubuntu

and the above link has already accounted for changes in udev noted here
http://openrcforums.com/forum/viewtopic ... hilit=udev

# this one is for my usbasp

Code: Select all

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05dc", MODE="0666"
What is needed for the Taranis is the idVendor and idProduct which could be found by running 'lsusb'

My assumption is that the DEVTYPE is still "usb_device". If the above line doesnt work by inserting the proper idVendor and idProduct of the Taranis, the DEVTYPE would be the first thing to investigate
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

Right.... got it working.

Rule as follows:

Code: Select all

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \
    MODE:="0666"
To sort. Create a file in

/etc/udev/rules.d

Call it: 45-taranis.rules

Insert the code above!

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Burning the Taranis Firmware under linux

Post by jhsa »

How easy it is to use Linux? :evil: :(
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Burning the Taranis Firmware under linux

Post by rperkins »

great
now if the software developers choose to add this file to their linux packages, their application will have access to the users hardware without the application running at an elevated privilege level.

I have been reading that the taranis either needs to be on or off to update the device depending on whether it is the flash or the eeprom that is being updated. Is the idVendor and IdProduct the same under both conditions ?
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Burning the Taranis Firmware under linux

Post by Kilrah »

No but when it is on the SD card and EEPROM both appear as more-than-standard mass storage drives. So no problem there.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Burning the Taranis Firmware under linux

Post by Rob Thomson »

rperkins wrote:great
now if the software developers choose to add this file to their linux packages, their application will have access to the users hardware without the application running at an elevated privilege level.
Romolo already sorting this :)


Sent from my GT-I9300 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Burning the Taranis Firmware under linux

Post by Romolo »

The rule has been added in the new c9x packages...
User avatar
dvogonen
Posts: 453
Joined: Tue Jan 31, 2012 9:38 pm
Country: Sweden
Location: Stockholm

Re: Burning the Taranis Firmware under linux

Post by dvogonen »

Rob Thomson wrote:Right. I have some success.

To get this all working, the first thing you MUST have is the right version of dfu-util.

Version 0.7 works well. Download it from here: http://dfu-util.gnumonks.org/

You will need to compile this. (assume you have compile software installed)

So...

Code: Select all

tar -xvzf dfu-util-0.7.tar.gz
cd dfu-util-0.7/
./configure
sudo make install
I am using trying to flash Taranis using Linux Mint. Thanks to this thread I found out that I need to build dfu-util to get version 0.7 rather than 0.5.
My problem is that the configuration step fails. I get this:
...
checking pkg-config is at least version 0.9.0... yes
checking for USB... no
configure: error: *** Required libusb-1.0 >= 1.0.0 not installed ***

But libusb is installed. To be more exact libusb-1.0-0 version 2:1.0.12-2ubuntu1 is installed. This is the latest version available via Synaptic.
Anyone has any idea about what to do?

Post Reply

Return to “openTx for FrSky radios”