Page 1 of 1

Flash M128 Turnigy 9x

Posted: Wed Oct 31, 2018 11:01 pm
by akawaoku
Hi,

I had to change the original Atmega64 from my turnigy 9x and then I installed the Atmega128.
I was able to flash as follow:

Code: Select all

C:\Program Files (x86)\OpenTX\Companion 2.0>avrdude.exe -c usbasp -p m128 -B 100
 -U flash:w:C:/temp/opentx-9x128-frsky-en.hex:i

avrdude.exe: set SCK frequency to 8000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.07s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: set SCK frequency to 8000 Hz
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: reading input file "C:/temp/opentx-9x128-frsky-en.hex"
avrdude.exe: writing flash (50320 bytes):

Writing | ################################################## | 100% 34.22s



avrdude.exe: 50320 bytes of flash written
avrdude.exe: verifying flash memory against C:/temp/opentx-9x128-frsky-en.hex:
avrdude.exe: load data flash data from input file C:/temp/opentx-9x128-frsky-en.
hex:
avrdude.exe: input file C:/temp/opentx-9x128-frsky-en.hex contains 50320 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 29.93s



avrdude.exe: verifying ...
avrdude.exe: 50320 bytes of flash verified

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.
However after trying to power on the radio, nothing happens.
Somebody has any clue?

Re: Flash M128 Turnigy 9x

Posted: Wed Oct 31, 2018 11:10 pm
by Kilrah
On a new chip you need to "Reset Fuses".

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 1:24 am
by akawaoku
How can I do that?

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 6:47 am
by Kilrah
Look a bit in the menus... read/write -> fuses

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 11:15 am
by akawaoku
Hi Kilrah,

First of all thanks for your answers.
I just saw some old posts of yours that mention that I should use the the option -B 100 to slower down the clk and if I got the feedback "warning: cannot set sck period. please check for usbasp firmware update." it means that I should try other programmer (could you recommend any one?) .
As you can see at my log I am receiveing this message. But the Companion are not giving any error.
I did not try the configuration via menu yet. I will when got at home.

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 3:49 pm
by fxshoppe
Friend

You need to first burn fuses if you have changed processor.

Then write the firmware, the option you are mentioning is different green chip.

Ignore the usbasp firmware error

Ping me if you need further assistance.

regards

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 5:11 pm
by akawaoku
Thanks fxshoppe.

I'll try later and tell you the results.

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 9:35 pm
by akawaoku
I just tried the fuses on read/write menu but the companion is not understand that I am trying to write the M128 instead of M64:

Code: Select all

=================================================================================
Started AVRDUDE
C:/Program Files (x86)/OpenTX/Companion 2.0/avrdude.exe -c usbasp -p m64 -U lfuse:r:C:/Users/alvaro/AppData/Local/Temp/5580-ftemp.bin:r
=================================================================================

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

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

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

avrdude.exe done.  Thank you.
However I tried the same command with option m128 and got the following messages:

Code: Select all

C:\Program Files (x86)\OpenTX\Companion 2.0>avrdude.exe -c usbasp -p m128 -U lfu
se:r:C:/Users/alvaro/AppData/Local/Temp/9740-ftemp.bin:r

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware up
date.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: reading lfuse memory:

Reading | ################################################## | 100% 0.02s

avrdude.exe: writing output file "C:/Users/alvaro/AppData/Local/Temp/9740-ftemp.
bin"

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.
If I am understanding correctly this command just read the fuses.

What should I do next?

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 10:16 pm
by jhsa
You have the wrong processor selected.. Select m128 instead of the m64

João

EDIT: And NEVER, BUT NEVER, use the -F option. Unless you want to brick your radio of course. :) ;) :mrgreen:

Re: Flash M128 Turnigy 9x

Posted: Thu Nov 01, 2018 10:32 pm
by akawaoku
Hey João,

I did not find any setup up related to processor. Only the "settings" where I can choose the radio (settings->settings) and I did choose the "OpenTX for M128 / 9X board"

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 2:14 am
by jhsa
I don't use opentx. I use Er9x, so I am not familiar with companion.
Does it have some setting for radio type or something similar? I think I remember seeing it some time ago when I installed it.
I don't even recall seeing a setting to select the right programmer. For example, I do not normally use an USBASP. I use another one..

João

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 7:46 am
by Kilrah
Image

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 9:36 am
by jhsa
There you go, someone that knows companion way better than I do :mrgreen:

But, how do you enter the avrdude setting. I remember only seeing the option to select the radio.
What confuses me is that I thought companion had all configurations in only one menu, meaning that you select the radio type and all programming options are there.

João

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 12:36 pm
by Kilrah
I highlighted the icon in the bottom left...

Yup there is only one selecton for everything - BUT it seems it didn't work for fuses and nobody ever noticed that, the above is a workaround.
Setting fuses isn't a particularly frequent need...

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 3:43 pm
by hackerjoe
This is where you set it in eePe ---->
eePe.jpg

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 4:10 pm
by jhsa
He wants to flash OpenTX, not Er9x, so he needs to use companion, not eepe ;)

João

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 4:18 pm
by hackerjoe
jhsa wrote: Fri Nov 02, 2018 4:10 pm He wants to flash OpenTX, not Er9x, so he needs to use companion, not eepe ;)

João
Yes I realize that, I was just showing where it is in eepe :)

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 4:25 pm
by Kilrah
When someone needs help posting stuff that's not relevant to the question usually serves little purpose and just risks confusing the OP.

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 5:32 pm
by akawaoku
Thanks a lot.
But I think I made a mistake and got a short circuit between the vcc pin a the one just next, than I burnt out a track that will be hard to fix because is under the processor.

Again, thank you guys.

Re: Flash M128 Turnigy 9x

Posted: Fri Nov 02, 2018 7:55 pm
by jhsa
Can you please post a good picture of it??

João