Help flashing 9xr with telemetry

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
User avatar
Geoffs
Posts: 7
Joined: Sun Dec 22, 2013 5:43 pm
Country: United States
Location: New York, NY

Help flashing 9xr with telemetry

Post by Geoffs » Sat Jan 11, 2014 6:59 pm

Hello all. I'm trying to flash my 9xr for the first time and set it up with telemetry (via orange open lrs module).

I'm trying to start by flashing OpenTX (with Mavlink support) but when I flash the firmware the tx no longer boots at all (Power button is lit up, but nothing on the screen).

I am able to get it to boot if I use eepe and flash it with er9x.

I'm attaching a screenshot of my settings - I've tried with *only* mavlink selected, and also other options like frsky just to see if it would work, but none of them work when flashing with companion 9x.

I have seen an error when reading the eeprom: "Your radio probably uses a wrong firmware, eeprom size is 4096 but only the first 2048 are used" but that's after I flash the OpenTX firmware and the controller doesn't boot any more. Could it be possible that the eeprom is still the old (er9x) version and that is incompatible with OpenTX?

If that's the case, is there a way to simply erase/format the eeprom?

Any suggestions would be appreciated!

The rest of my setup is:
- Mac running Mavericks, 10.9
- Latest companion 9x (1.52 r2387)
- USBASP, have tried both with power from the usbasp (5v) and via a battery without the power jumper on the USBASP, neither works
- I've updated avrdude manually to v. 6.0.1 (and it works with eepe, so I don't think that's the issue)
Attachments
Screen Shot 2014-01-11 at 1.55.17 PM.png
Last edited by Geoffs on Mon Jan 13, 2014 1:15 am, edited 1 time in total.


User avatar
Eagle71
Posts: 12
Joined: Fri Sep 07, 2012 3:01 pm
Country: -

Re: Help flashing 9xr with telemetry

Post by Eagle71 » Sun Jan 12, 2014 5:06 pm

Hello Geoffs

You selekt in the Screenshot an 9xr with M128Mod!!!!

Try the normal 9xr (openTx for 9xr).

Good Luck
Eagle71

User avatar
Geoffs
Posts: 7
Joined: Sun Dec 22, 2013 5:43 pm
Country: United States
Location: New York, NY

Re: Help flashing 9xr with telemetry

Post by Geoffs » Sun Jan 12, 2014 9:56 pm

My 9xr is new, and apparently for the last 6 months they have been making them with the ATMega128 chip instead of the 64.

I'm attaching a pic of the chip with the label visible - so I believe the setting is correct. Just for kicks I tried the non-128 build, and I get this error when trying to flash it:
Your radio uses a Atmega 128 CPU!!!

Please select an appropriate firmware type to program it.
ie: OpenTX for M128 / 9X board or OpenTX for 9XR board with M128 chip
You are currently using:
openTx for 9XR
Attachments
9xrboard.jpg

User avatar
Geoffs
Posts: 7
Joined: Sun Dec 22, 2013 5:43 pm
Country: United States
Location: New York, NY

Re: Help flashing 9xr with telemetry

Post by Geoffs » Mon Jan 13, 2014 12:28 am

Well, I just tried it using Windows 7 (Running via Virtualbox on my mac[1]) to flash OpenTX (with only mavlink, same settings as I was using on the mac) and it worked!

So at this point either the problem is with the Mac Companion9x version and it's downloading the wrong build, or my mac version of avrdude (v6.0.1) is not working correctly. I'm going to copy the firmware build from my windows vm and try it with the mac companion9x/avrdude to see what happens. Will report back.


[1] p.s. for you mac users out there, this is a really helpful tip if you need to run windows but don't want to do a complete boot camp install:
Virtualbox is free, and MS gives out free windows images for testing websites with Internet Explorer, but the windows image files are full installs, so you can use them for times when you need to run windows. I use it to run the Naza config stuff for my phantom (and now apparently also to flash my 9xr)

Get it here:
https://github.com/xdissent/ievms

User avatar
Geoffs
Posts: 7
Joined: Sun Dec 22, 2013 5:43 pm
Country: United States
Location: New York, NY

Re: Help flashing 9xr with telemetry

Post by Geoffs » Mon Jan 13, 2014 12:47 am

Ok! Here's the problem!

tl;dr version:
I was naming the downloaded firmware with a .bin on the end, and because of that, Comanion9x told avrdude that the file was binary, even though it was hex. avrdude thought the burn was successful, but really it was bad because of the file type mismatch.

Full explanation:
My avrdude is fine. On the mac version of Companion9x, when you download firmware, it doesn't fill in the file name for you automatically. It simply opens a dialog box that asks you to give it a name. Since I am new to this, I figure it's a firmware file and in my experience firmware is usually a .bin file. So I put in "opentx-mavlink.bin" and hit save.

Now, when using avrdude, you can specify the format of the file you are flashing (bin, hex, many others[1]), so when I saved the file as .bin and told Companion9x to flash it, somewhere along the way it thinks that since the file name is .bin, it must be a bin file and tells avrdude that the file format is binary instead of hex.

So the result is that the command to flash looks like this:

Code: Select all

$ avrdude -c usbasp -p m128 -U flash:w:/Users/geoff/Documents/eepe_9xr_files/not-really-a-bin-file.bin:r
See that ":r" on the end? That tells avrdude that I'm giving it a bin file, but really the file is a .hex file.

The correct command is:

Code: Select all

$ avrdude -c usbasp -p m128 -U flash:w:/Users/geoff/Documents/eepe_9xr_files/opentx-mavlink.hex:i
I did a quick test to see what would happen if I don't specify a file type when downloading + naming the file, and you get this:

Code: Select all

$ avrdude -c usbasp -p m128 -U flash:w:/Users/geoff/Documents/eepe_9xr_files/test:a
I didn't see if it would finish, but my guess is that it would correctly see that it's a hex file. So in the end it was my user error, but this kind of thing could be prevented very easily by having Companion9x always use ":a" (auto detect) mode - at least on Mac.

Hope this helps someone out some day :)

[1] You can see the full list here: http://www.nongnu.org/avrdude/user-manu ... ude_4.html


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

Re: Help flashing 9xr with telemetry

Post by Kilrah » Mon Jan 13, 2014 8:13 am

Geoffs wrote: I didn't see if it would finish, but my guess is that it would correctly see that it's a hex file. So in the end it was my user error, but this kind of thing could be prevented very easily by having Companion9x always use ":a" (auto detect) mode - at least on Mac.
Good to know, could you open an issue on the tracker?
https://github.com/opentx/opentx/issues


Post Reply

Return to “openTx”