Turnigy 9x mod: firmware flashing - Errors and Fixes

Started by hyd_quads, June 24, 2015, 03:21:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hyd_quads

I know it's too late to post this now, because the 9xr pro comes pre-flashed with er9x, but this may help those trying to flash their 9x with either er9x or openTX. I just flashed my 9x with openTX after a LOT of struggle, trying to figure out what went wrong. I followed this guide.

My setup: Turnigy 9X, USBasp (ATMega 8 ) programmer from a local shop (THE CULPRIT!), eePe with avrdude, Win7 32bit.
This is a list of errors I came across while flashing and here are their fixes.

#1.
Problem: USBasp shows up in Device Manager (without a yellow (!) triangle) with drivers properly installed, BUT avrdude says
avrdude.exe: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

Issue: It's your programmer. It probably has a jumper for toggling between 3.3V/5V and an associated resistor - its value is a bit too high causing the MCU to get low voltage. My programmer had this jumper, and several others do. Eg. Betemcu USBasp

Fix: (temporary, didn't work perfectly in my case) plug in Turnigy 9x into your programmer first and then connect the programmer to your computer.
(permanent, worked like a treat!) - Figure out which resistor that is, and short it out. You'll find this resistor near the jumper for toggling 3.3V/5V.
Refernce: here

#2.
Problem: avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.

Issue: The programmer sets the sck period automatically. That's how its programmed to function.  (References: this and several others)

Fix: YOU CAN IGNORE THIS ERROR.

#3.
Problem: avrdude.exe: Device signature = 0x000102
avrdude.exe: Expected signature for ATmega64 is 1E 96 02
            Double check chip, or use -F to override this check.

Issue: It's your programmer. (Refernce: here
Fix: (might sound silly, but worked for me.) Put all the Tx switches in their default positions (as in you would to eliminate the infamous switch error with the stock firmware!) but the throttle stick in Max. position. (Reference: here)

#4.
Problem:

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9602
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
            To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "C:/Users/XYZ/ABC/er9x.hex"
avrdude.exe: writing flash (60724 bytes):

Writing | ################################################## | 100% 23.97s

avrdude.exe: 60724 bytes of flash written
avrdude.exe: verifying flash memory against C:/Users/XYZ/ABC/er9x.hex:
avrdude.exe: load data flash data from input file C:/Users/XYZ/ABC/er9x.hex:
avrdude.exe: input file C:/Users/XYZ/ABC/er9x.hex contains 60724 bytes
avrdude.exe: reading on-chip flash data:

Reading | avrdude.exe: error: usbasp_transmit: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning.
................

Issue: Your programmer has several (in my case, three) inline resistors (of a high value - reportedly ~100/150ohm) on the target side (turnigy 9x, in this case) whereas they should be of 0-30ohm.
Fix: Short these resistors out with a plain peice of wire. In my local programmer, there were 3 of them. One at MISO, one at MOSI, one at LED. Its better to swap the 100ohms with ~30ohms but shorting them out worked for me.

Attached pics show my programmer and the resistors I had to short.
1: The "jumper" resistor shorted using a wire.
2: The "jumper resistor removed cmopletely and ckt completed with a wire
3: Three inline resistors removed.
4: Ckt completed using 3 pieces of wire.

GD

Today I try to flash my 9x using usbasp purchased from eBay, and another different problem I am facing. Here is the screenshot of the error message i am getting.

Note: I have double checked connection, all find good.

Suspecting firmware problem as per the readings.

Further advice will be appreciated.

Thanks and regards
Dhanasekar

AshwinRwt

@GD ji, do as it says, check the connections, again. I changed the uC from m64 to m128, I was pretty confident about my soldering, but there was a problem (a3 leaking into a1) which was only solved by removing the chip, cleaning the board and starting from scratch.
@hyd-quads ji, about the issue no.2, did you try -b and -B options in avrdude? I believe that you should never ignore a problem, especially with avr chips.

xlnzee

Quote from: hyd_quads on June 24, 2015, 03:21:50 PM


Hi, I have  FlySky TH9X that I would like to install OpenTX or ER9X on but i am stuck with a error that "target doesn't answer. 1" and asks me to check the connections. I have checked the soldering and also resoldered the wires thrive but get the same error.

I am from Hyderabad, can you help me in getting OpenTX flashed in my receiver? I would really appreciate your help.

Thank you.

xlnzee

Quote from: AshwinRwt on December 30, 2015, 02:52:14 PM
@GD ji, do as it says, check the connections, again. I changed the uC from m64 to m128, I was pretty confident about my soldering, but there was a problem (a3 leaking into a1) which was only solved by removing the chip, cleaning the board and starting from scratch.
@hyd-quads ji, about the issue no.2, did you try -b and -B options in avrdude? I believe that you should never ignore a problem, especially with avr chips.

Hi, please see my post above, I see that you are from Hyderabad too, is it possible for you to help me with the flashing as I suspect it's my programmer which is to blame, do let me know, thanks!