Page 1 of 1

9XR flashing with USBASP issues!

Posted: Sun Jan 06, 2019 5:19 pm
by TW882
Hi, so im trying to flash openTx onto my 9XR with the usbasp programmer but I think it appears as though the usbasp isn't connected correctly to the 9XR and its giving me this error when I try to do any function with companiontx or eepe such as read firmware or read models.
=================================================================================

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


avrdude.exe done. Thank you.


=================================================================================

I have installed the drivers for the usbasp with zadig and there didnt seem to be any errors there. The usbasp that im using is the "lc technology usbasp v2.0". The radio is getting power from the programmer so I believe the 6 pin cable is in the correct orientation. Ive also verified that the usbasp is outputting 4.5-5v on the logic pins.
So im a bit stuck on where to go next with this....

Toby

Re: 9XR flashing with USBASP issues!

Posted: Sun Jan 06, 2019 7:07 pm
by Kilrah
Are you supplying proper power to the radio? Power from the programmer typically isn't enough.

Re: 9XR flashing with USBASP issues!

Posted: Sun Jan 06, 2019 7:40 pm
by TW882
the radio becomes powered on when I plug the programmer in, and all of the menus are accessible, so I would assume its powered correctly.

Re: 9XR flashing with USBASP issues!

Posted: Sun Jan 06, 2019 7:41 pm
by Kilrah
It is not, you also need a battery installed and power switch on. Flashing on programmer power only is known to be insufficient and potentially render the processor unusable.

Re: 9XR flashing with USBASP issues!

Posted: Sun Jan 06, 2019 7:58 pm
by TW882
Ok so ive just tried it with the battery in, and powered on, seems to be giving the same problem.
However, the first time the programmer is plugged into the pc and I try to read the firmware, I get this message
avrdude.exe: AVR device initialized and ready to accept instructions

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

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: current erase-rewrite cycle count is -50462977 (if being tracked)
avrdude.exe: reading flash memory:

Reading | ################

when it finishes reading, the file it generates cannot be opened.

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 12:25 am
by jhsa
Where are you trying to open the file?

João

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 8:41 am
by Kilrah
The resulting file is a firmware, not a settings document, it's normal you can't open it with companion.

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 4:08 pm
by TW882
Alright ok I didn't quite get that thanks for clarifying,
It seems as though it is the same error for the other functions though, such as trying to read the models and settings and when trying to flash the firmware to the radio. It still appears as though the usbasp is not connected correctly to the transmitter. I read on another forum about a particular resistor pack causing problems when trying to flash the 9xr, could this be my issue?

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 6:13 pm
by Kilrah
Yep certain usbasp programmers do cause issues, especially the ones with the 4-pack resistor.

Been a long time since I touched a 9X(R)..

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 7:02 pm
by ReSt
There normally is a small smd resistor pack between the processor and the output pins of the board with 4 resistors (8 pins) that is marked with "101" that is 100 Ohm. These are (normally) ok. The problematic resistor packs were marked 102, that is 1kOhm, IIRC
Another possibility for problems sometimes is the position of (at least) the throttle switch. Some of the switches, depending on their position (ON/OFF) may put an additional load onto one or another signal of the USBASP, as they are connected to the same pins. This additional load can pull signals furthermore down. Try with all switches down/away from you.

And one WARNING !!!
Do NOT, NEVER use the -F option of avrdude to try to overcome the problems. Trying this option has a high chance of bricking your radio.

Reinhard

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 8:04 pm
by TW882
Ok, no luck when trying with the switches down/in different positions.
Ive just checked my programmer against its schematic and with a multimeter, and it seems as though I don't have any resistors between the 6 pin connector and MISO/MOSI/SCK/RESET. Maybe I will try to update the firmware on the usbasp if I can as it was a cheap one from amazon.
Thanks for the help.

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 10:35 pm
by ReSt
One mor possibility.
Try to slow down the communication speed of AVRDude
In opentx companion in settings - Configure Communications... in the "Extra Arguments" field use the parameter
-b xxxxx
This overrides the baudrate that is used. (if I remember correctly then the lowest value I have read of is -b 100)
I don't know what values you can use, but try to search for it in the forum.

Reinhard

Re: 9XR flashing with USBASP issues!

Posted: Mon Jan 07, 2019 11:33 pm
by jhsa
I think it is -B100 instead of -b100.. :) There is a difference between the two of them.. :)
João

Re: 9XR flashing with USBASP issues!

Posted: Tue Jan 08, 2019 8:39 am
by ReSt
You may be right.

and there is a difference, as you say.

According to the help display from Preferences in eePe
-b <baudrate> Override RS-232 baud rate
-B <bitclock> Specify JTAGS/STK500v2 bit clock period (us).

I don't know which one is the one to be used. I only remember that a low number was suggested to slow down, and a low number at bitclock would probably speed up ??
But I think, communication is done via the JTAG/STK interface and so -B is the more probable one.

Reinhard

Re: 9XR flashing with USBASP issues!

Posted: Tue Jan 08, 2019 9:59 am
by Kilrah
It's -B. As mentioned that specifies period so a bigger one means lower freq.

Re: 9XR flashing with USBASP issues!

Posted: Tue Jan 08, 2019 12:57 pm
by ReSt
Searching the forum, I found suggestions of -B100 up to -B10000

Reinhard

Re: 9XR flashing with USBASP issues!

Posted: Tue Jan 08, 2019 2:23 pm
by jhsa
-B100 is a good start and got me out of trouble a couple times :)

João

Re: 9XR flashing with USBASP issues!

Posted: Tue Jan 08, 2019 7:20 pm
by TW882
Ahh fantastic, seems like the -B100 parameter has done some good. I tired -B10000 also however it didn't work. I am now able to complete a read/write process which is great... but when companion has finished flashing firmware, the radio seems to have the original firmware still :o .
Andddd when reading models and settings from the tx, I get an error in companion saying 'eeprom size is invalid' and 'eeprom file system is invalid'
Thanks for the help on the communication speed.

Re: 9XR flashing with USBASP issues!

Posted: Wed Jan 09, 2019 1:14 am
by jhsa
Please try flashing your radio with er9x and see if it makes any difference. You find it at www.er9x.com
Make sure you download the right version for your radio's processor..
Also, download and install "eepe" which is the eeprom editor for er9x.
go to the "Burn menu / configure" and select your programmer, com port and the correct radio processor.
Also in "File/Preferences" select the right processor.
All the rest should be the same as with companion.
Before all this, please backup your radio's firmware and eeprom using companion, if you have any models that you don't want to lose..

João

Re: 9XR flashing with USBASP issues!

Posted: Wed Jan 09, 2019 7:44 pm
by TW882
Thanks everyone so much for the help, yes, flashing with eepe to er9x and using -B100 seems to have done the job, strange that companion didn't seem to work. Ill keep playing around and post if I manage openTx.

Re: 9XR flashing with USBASP issues!

Posted: Wed Jan 09, 2019 8:22 pm
by jhsa
Funny, if it worked with er9x, it should have worked also with openTX, unless there is a problem with it or companion.
Unfortunately the openTX team seems not to be supporting radios with AVR processors anymore so I wouldn't be surprised if something was broken. Er9x is still being maintained and also supports more features like for example the multiprotocol module over serial..

João

Re: 9XR flashing with USBASP issues!

Posted: Thu Jan 10, 2019 8:04 am
by TW882
Ok, so Ive now managed to get openTx working through eepe :D but yes, it looks like er9x have many more features on my radio so I will switch back to that. Companion now seems to be able to flash the radio but still isn't liking models and settings so I think I will just stick to using eepe too.

Re: 9XR flashing with USBASP issues!

Posted: Thu Jan 10, 2019 8:46 am
by ReSt
Sometimes it helps flashing, when the cable between programmer and the processor of the radio is as short as possible.

Reinhard

Re: RE: Re: 9XR flashing with USBASP issues!

Posted: Thu Jan 10, 2019 11:13 am
by jhsa
TW882 wrote:Ok, so Ive now managed to get openTx working through eepe :D but yes, it looks like er9x have many more features on my radio so I will switch back to that. Companion now seems to be able to flash the radio but still isn't liking models and settings so I think I will just stick to using eepe too.
Well, it might be that as I said something is broken in Companion concerning the AVR radios.
I think I have read that the support for these processors was actually removed from latest Companion???

João

Sent from my BLN-L21 using Tapatalk