Backup of turnigy 9xr stock firmware

A fork of eePe. It's aim is to provide one tool that works with ALL firmwares!
Post Reply
steved907
Posts: 2
Joined: Wed Jan 01, 2014 6:32 pm
Country: -

Backup of turnigy 9xr stock firmware

Post by steved907 »

Hello. I just got a new 9xr and wanted to flash opentx to it. Before I did that I wanted to back up the stock firmware to files (the flash and eeprom). I am getting the following message:

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 9X board

Then I see the message:
/usr/bin/avrdude -c usbasp -p m64 -U eeprom:r:/tmp/temp.hex:i
=================================================================================

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9702
avrdude: Expected signature for ATMEGA64 is 1E 96 02
Double check chip, or use -F to override this check.

avrdude done. Thank you.


=================================================================================
AVRDUDE done - exit code 1

It's good that I got a 128, but it looks like it came with the 64 firmware by default.

When I try to write the stock eeprom to a file (read eeprom memory to file), I get the following message:

Started AVRDUDE
/usr/bin/avrdude -c usbasp -p m64 -U eeprom:r:/home/steve/Companion9x/stock 9xr eeprom mem:a
=================================================================================

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.


=================================================================================
AVRDUDE done - exit code 1

So I changed the mcu to m128 in the advanced configuration and tried to save the stock eeprom (using eeprom file type) again, and got the following message and a zero byte file. It gave a progress bar and looked like it was writing.

Reading | ################################################## | 100% 1.06s

avrdude: writing output file "/home/steve/Companion9x/stock 9xr eeprom mem"
avrdude: error opening /home/steve/Companion9x/stock 9xr eeprom mem: No such file or directory
avrdude: output file /home/steve/Companion9x/stock 9xr eeprom mem auto detected as invalid format
avrdude: invalid output file format: -1
avrdude: write to file '/home/steve/Companion9x/stock 9xr eeprom mem' failed

avrdude done. Thank you.


=================================================================================
AVRDUDE done - exit code 1

One other thing, if I don't unplug and plug the usbasp back in after each attempt, I get the error:

Started AVRDUDE
/usr/bin/avrdude -c usbasp -p m128 -U eeprom:r:/tmp/temp.hex:i
=================================================================================

avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.


avrdude done. Thank you.


=================================================================================
AVRDUDE done - exit code 1

This is on Ubuntu, and I am stumped because sometimes the PC and radio appear to be communicating,and sometimes not. I don't want to try to burn anything to the radio until I figure this out.

Should I be using a 64 or 128 mcu in config?
Is eeprom/flash not the proper file type to back up the stock eeprom/flash mem (other options are bin or hex)?
Why do I have to unplug and replug the usbasp each time to not get the target doesn't answer error?

Thanks for any tips or advice!

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

Re: Backup of turnigy 9xr stock firmware

Post by Kilrah »

The 9xr comes read protected, so whatever you read will be invalid, you just can't back it up.
What usbasp do you have?

Envoyé de mon GT-I8190N en utilisant Tapatalk
steved907
Posts: 2
Joined: Wed Jan 01, 2014 6:32 pm
Country: -

Re: Backup of turnigy 9xr stock firmware

Post by steved907 »

I have the betemcu.cn with the 100 ohm resistor. It shows 4.6v when connected, but everytime I try a 2nd read or unplug and replug I get the throttle switch error. I read the "known problematic usbasp" thread but many seem ok with that one and it seems like it can connect if you unplug and replug it back in. That is consistent. It also throws a invalid eeprom file /tmp/temp.hex message when I read eeprom from tx with the m128 selected in the advanced options. I say ok, and then it lets me configure models.

There is a youtube video where someone (cpo heli) backed up the stock firmware without any problems. Seemed like a good step before writing new firmware. Since I don't know er9x or opentx, I thought I would start with opentx in case I end up on a taranis, and models should be portable that way.

Thanks for your input.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Backup of turnigy 9xr stock firmware

Post by rperkins »

steved907 wrote: /usr/bin/avrdude -c usbasp -p m64 -U eeprom:r:/home/steve/Companion9x/stock 9xr eeprom mem
====
avrdude: writing output file "/home/steve/Companion9x/stock 9xr eeprom mem"
avrdude: error opening /home/steve/Companion9x/stock 9xr eeprom mem: No such file or directory
avrdude: output file /home/steve/Companion9x/stock 9xr eeprom mem auto detected as invalid format
avrdude: invalid output file format
He is right the stock firmware is protected. you should be able to run the read command but all you will get is jibberish.

I wouldnt use spaces in filenames in this scenerio. That may be your 'invalid format ' error.

Having to unplug before each programming attempt doesnt happen much anymore. did you buy your programmer recently ? I dont see the typical chinese .' Cant set sck' error so I think you have one of my programmers.

I would be sure to plug the 9xr into the usbasp before plugging the usbasp into the computer and do your programming with all switches in the off position.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: Backup of turnigy 9xr stock firmware

Post by rperkins »

steved907 wrote: One other thing, if I don't unplug and plug the usbasp back in after each attempt, I get the error:
this will also happen on a 9xr if you use the 2011 version of usbasp firmware from http://www.fischl.de/usbasp/
It is caused by a combination of an error in the code and the capacitor on the reset line

look around here for the patched 2009 version of usbasp firmware. That is what I use now and works well

Post Reply

Return to “companion9x”