9x wont turn on after flashing

Cant get your radio to work? General Hardware issues?
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

MikeB wrote:On eepe, there is an option under the BURN menu or "Review Output". This lets you look at and copy the Avrdude output.

Mike.
That is a good option to have. This poster is using opentx and I imagine it is still true that opentx uses companion and er9x uses eepe and that it is not the best idea to mix the 2 environments.

I havent used opentx except for brief testings but if it doesnt have the option to review avrdude output then it would be a good one to have. However for this poster who wants to update opentx on a gruvin he should maybe stick with opentx for the time being, at least until his radio starts working again.

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x wont turn on after flashing

Post by gruvin »

No one ever told me that the eBay USBASPs used an m8. :-/ How odd. I always just assumed they would use the same chip as the original author of USBASP -- the '88. D'oh!

@Koarl -- And yeah .. DO NOT EVER USE -F unless you REALLY know what you're doing. And OMG ... I put it in the code I sent you. D'OH! That'll be because I had ATmega48P's and not plain old 48's, probably. I'll edit that post above and remove it now. Sheesh. SORRY.

Keep reading all the AVRDUDE output carefully. Subtle things can change and you don't want to just assume that a failure is a failure, etc. ;-)

OH AND ... in Companion, you want OpenTX for gruvin9x board NOT gruvin9x for gruvin9x board ... assuming that old option is even still there. Hope not. Sorry, I do not have Companion available here to look myself, just now.

You really are nearly there!
User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x wont turn on after flashing

Post by gruvin »

It seems I am being the least helpful. I will try to do better! :-P
User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x wont turn on after flashing

Post by gruvin »

Koarl wrote:I tried to flash with epee cause it seems I got something wrong with console but epee won´t let me copy the output. When the window appears that avrdude finished correctly I hit ok and then the output disappears
eePe does not support the gruvin9x board to the best of my knowledge. It certainly didn't way back when I last checked nor would I expect it to, ever.

Was this a typo? Did you mean to say "Companion"? I know the latter is based on eePe. But the two programs are moonbeams apart nowadays -- again, last I checked. but surely this is still the case.
User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x wont turn on after flashing

Post by gruvin »

@Koarl -- can you post the AVRDUDE command used to read the firmware from the radio? Thanks.

I looked at the BIN dump from your radio (t9xread.bin) radio and compared it to the .HEX file you provided above. There appears to be no correlation what-so-ever. In fact, the data from the radio (t9xread.bin) appears to be just random junk.

Curiously, the file is also only 229, 376 bytes in size, where as I would have expected it to be 262,144 (256KB).

Equally curious is that every 2nd chunk of 32Kbytes is completely blank.

EDIT: AH!! And every 64K block *is* identical. So it must in fact be that USBASP bug. Strange that none of the data seems to match anything in the original HEX file, though. Are you sure you sent us the firmware HEX file that you were trying to Flash the radio, in order to get its contents as they currently are?

This may all be a red herring. But for what it's worth, here is the console command to read the radio's Flash, as it currently stands, which I would like to see (again, using this method) ...

Code: Select all

avrdude -c usbasp -P usb -p m2560 -U flash:r:t9xflash.bin:b
That should read the complete 256K of Flash and stick it into t9xflash.bin, as raw binary data.

I do note that the very first byte of the t9xread.bin file you provide does match the 0x08 that the verification error mentions in, '0x0c != 0x08'. That does suggest that the file you already provided was sound. But please, humour me anyway.

Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Jesus, so many answers at once! :o

Ok, step by step:

Gruvin told me the command! :twisted:

Thanks Mike, maybe updating my epee should help too...

Gruvin, where do I get the firmware? In companion I set the radio profile to gruvin9x board/ 9x and downloaded and let companion download the firmware. Where is the mistake?

Now I reflashed the programmer with the command rperkins posted, this is the avrdude output:


localhost:~ carloskammerlander$ avrdude -c usbasp -P usb -p m8 -U flash:w:firmware.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware.hex"
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: writing flash (3966 bytes):

Writing | ################################################## | 100% 2.29s



avrdude: 3966 bytes of flash written
avrdude: verifying flash memory against firmware.hex:
avrdude: load data flash data from input file firmware.hex:
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: input file firmware.hex contains 3966 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.04s



avrdude: verifying ...
avrdude: 3966 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

localhost:~ carloskammerlander$


And after flashing I tried to read the FW from the usbasp using epee, this is the output:

=================================================================================
Started AVRDUDE
/usr/local/bin/avrdude -c usbasp -p m64 -p m8 -U flash:r:/Users/carloskammerlander/Desktop/usbasprperkinscommand.bin:r
=================================================================================

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x000102
avrdude: Expected signature for ATMEGA8 is 1E 93 07
Double check chip, or use -F to override this check.

avrdude done. Thank you.


=================================================================================
AVRDUDE done - exit code 1
=================================================================================
User avatar
MikeB
9x Developer
Posts: 18000
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: 9x wont turn on after flashing

Post by MikeB »

If the USBASP is writing to locations twice, due to an addressing bug, then the flash contents won't look right. When flashing only logic 0s are written, the chip is erased to all 1s. If, for example, 0C is written, then FD is written to the same location you will end with 08 in the location as that is the only bit that is 1 in both written patterns.
I also suspect a reading address problem, so the read file doesn't properly refletc the contents of the chip anyway.

In these operations, eepe/companion are only being used as a "front end" for Avrdude, so either may be used. You only need the correct one for the EEPROM read/write if you want to use the editing/simulation functions.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Thanks Mike for your answer, but I don't understand anything. Was that chinese?
User avatar
MikeB
9x Developer
Posts: 18000
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: 9x wont turn on after flashing

Post by MikeB »

That was more for Gruvin to help understand what is going on.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Ah ok. I'm glad that you don't wan't me to get behind this. [emoji12]

But how should I proceed now? As I have said I flashed the programmer again and just tried to flash the radio with the same result.
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Is it possible that I habe bricked both of my programmers and now I'm not able to flash either of them? 'Cause it's very likely that I switched between them.
User avatar
MikeB
9x Developer
Posts: 18000
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: 9x wont turn on after flashing

Post by MikeB »

Try reading the firmware from the USB again, this time remove the "-p m64" before the "-p m8", and also add -B 100.
This will slow the programming clock, making the read more likely to work.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

viewtopic.php?f=95&t=7804&p=104751#p104740
According to this post you have updated yout usbasp properly.
It is confusing because within the same post you added output from trying to read the firmware from the radio whike using wrong parameters..

look at the linked post to use as a guideline to what a successful flash looks like. You should be able to use this usbasp to flash your radio. You should clearly mark which usbasp has good firmware on it or update your other usbasp.

My last comment will be that you no longer should be using eepe. You used eepe to attempt to update your usbasp as shown in the video you referenced when i entered this thread. that portion is complete although we ended up using the command line to update your usbasp. If you are going to run opentx on your radio then you should use companion to interact with it.

Now that gruvin and mike are here i will let them instruct you in updating your radio. You are in good hands.

You're almost there


use te
Last edited by rperkins on Tue Nov 10, 2015 12:21 pm, edited 1 time in total.
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Thanks Mike, here is the output and the file.


=================================================================================
Started AVRDUDE
/usr/local/bin/avrdude -c usbasp -p m64 -p m8 -B100 -U flash:r:/Users/carloskammerlander/Desktop/usbaspread1.bin:r
=================================================================================

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9307
avrdude: reading flash memory:

Reading | ################################################## | 100% 2.04s

avrdude: writing output file "/Users/carloskammerlander/Desktop/usbaspread1.bin"

avrdude done. Thank you.


=================================================================================
AVRDUDE done - SUCCESSFUL
=================================================================================
Attachments
usbaspread1.bin.zip
(2.62 KiB) Downloaded 197 times
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

@rperkins:

Thanks for your help! It seem´s we posted at the same time.

I have tried to flash the tx again. I also tried it with and without -B11 in the extra arguments. I still get the same error.
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

gruvin wrote:@Koarl -- can you post the AVRDUDE command used to read the firmware from the radio? Thanks.

I looked at the BIN dump from your radio (t9xread.bin) radio and compared it to the .HEX file you provided above. There appears to be no correlation what-so-ever. In fact, the data from the radio (t9xread.bin) appears to be just random junk.

Curiously, the file is also only 229, 376 bytes in size, where as I would have expected it to be 262,144 (256KB).

Equally curious is that every 2nd chunk of 32Kbytes is completely blank.

EDIT: AH!! And every 64K block *is* identical. So it must in fact be that USBASP bug. Strange that none of the data seems to match anything in the original HEX file, though. Are you sure you sent us the firmware HEX file that you were trying to Flash the radio, in order to get its contents as they currently are?

This may all be a red herring. But for what it's worth, here is the console command to read the radio's Flash, as it currently stands, which I would like to see (again, using this method) ...

Code: Select all

avrdude -c usbasp -P usb -p m2560 -U flash:r:t9xflash.bin:b
That should read the complete 256K of Flash and stick it into t9xflash.bin, as raw binary data.

I do note that the very first byte of the t9xread.bin file you provide does match the 0x08 that the verification error mentions in, '0x0c != 0x08'. That does suggest that the file you already provided was sound. But please, humour me anyway.

@gruvin:

I did what you said. Here is the output and the file:


localhost:~ carloskammerlander$ avrdude -c usbasp -P usb -p m2560 -U flash:r:t9xflash.bin:b

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9801
avrdude: reading flash memory:

Reading | ################################################## | 100% 65.66s



avrdude: writing output file "t9xflash.bin"

avrdude: safemode: Fuses OK

avrdude done. Thank you.

localhost:~ carloskammerlander$
Attachments
t9xflash1.bin.zip
(76.35 KiB) Downloaded 202 times
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

It really drives me nuts. Should I buy another programmer?
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

Koarl wrote:It really drives me nuts. Should I buy another programmer?
No. You dont need a new usbasp. You already have 2 of them

Are both your programmers the same ?
Did you update them both ?
Do you have them clearly marked so that you dont get them mixed up ?

depending on your answers i think you are ready to do a flash write. these last couple posts are flash reads. If no one else chimes in i will post a write command, after you reply to these questions.
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Hello,

Yes both are the same. As far as I can remember I flashed both at the first flashing attempt, but I'm not sure.
Before I haven't marked them, now I did.

Thanks!
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

and how did you flash them both at the ' first flashing attempt ' . you realize the only usbasp that is updated is the one that you are shorting out the programming jumper ?
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

I think i tried to flash both of them like in this thread using epee viewtopic.php?f=10&t=2927

I know the jumpered one will be flashed.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

lets go ahead and reflash both of your usbasp's so we are sure that you are using an updated one.

hook the usbasp's together and put the jumper on the one on the end.
be sure you are in the directory with firmware.hex. firmware.hex should be the romulo firmware you downloaded from this thread earlier. then run the following code

Code: Select all

avrdude -c usbasp -P usb -p m8 -U flash:w:firmware.hex
POST THE OUTPUT. label the post with 'usbasp number 1' or however else you marked this unit
I have noticed that sometimes you write ' I got an error' when really it is not an error, just the output.

now after you have posted the output to the forum, remove the jumper from the one usbasp, put it on the other usbasp. switch thte positions of the usbasp so that the one with the jumper is on the end.

now rerun the same code as posted above.

POST THE OUTPUT. label the post with usbasp number 2 or however else you marked this unit.

after this I will provide a flash WRITE command
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

Thanks!

Here is the output of programmer 1


localhost:~ carloskammerlander$ avrdude -c usbasp -P usb -p m8 -U flash:w:firmware.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware.hex"
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: writing flash (3966 bytes):

Writing | ################################################## | 100% 2.18s



avrdude: 3966 bytes of flash written
avrdude: verifying flash memory against firmware.hex:
avrdude: load data flash data from input file firmware.hex:
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: input file firmware.hex contains 3966 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.98s



avrdude: verifying ...
avrdude: 3966 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

localhost:~ carloskammerlander$
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

Koarl wrote:Thanks!
Here is the output of programmer 1
that is good. that programmer is updated
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

And programmer number 2


localhost:~ carloskammerlander$ avrdude -c usbasp -P usb -p m8 -U flash:w:firmware.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware.hex"
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: writing flash (3966 bytes):

Writing | ################################################## | 100% 2.15s



avrdude: 3966 bytes of flash written
avrdude: verifying flash memory against firmware.hex:
avrdude: load data flash data from input file firmware.hex:
avrdude: input file firmware.hex auto detected as Intel Hex
avrdude: input file firmware.hex contains 3966 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.95s



avrdude: verifying ...
avrdude: 3966 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

localhost:~ carloskammerlander$
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

Koarl wrote:And programmer number 2
This one looks good also.

One quick question .
Do you want your firmware in German ? I think you downloaded a german firmware. we are going to test with it either way.

I'll have another response soon
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

I don´t care, really.
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

my bad. I was thinking Australia and now I looked closer and see Austria :oops:
Koarl
Posts: 203
Joined: Sun Jul 01, 2012 5:08 pm
Country: -

Re: 9x wont turn on after flashing

Post by Koarl »

No kangoroos here. ;-)
User avatar
rperkins
Posts: 1422
Joined: Sun Jan 08, 2012 12:51 pm
Country: -

Re: 9x wont turn on after flashing

Post by rperkins »

ok lets try to flash with the firmware you posted in this thread
viewtopic.php?f=95&t=7804#p103772

be sure that you have unzipped the hex file and it is in your current directory

run this code, it should all be on one line. the filename is long but I think I got it copied correctly

Code: Select all

avrdude -c usbasp -P usb -p m2560 -U flash:w:opentx-gruvin9x-templates-nocurves-PXX-ppmca-gvars-potscroll-autosource-autoswitch-dblkeys-battgraph-pgbar-ppmus-de-2.1.3.hex
post your output.

if the firmware is wrong the radio still might not come on. all we are really looking for at this time is to be sure the 'mismatch error' is resolved. basically we just want to be able to write to the MCU in the radio

Post Reply

Return to “Hardware”