Page 1 of 1

flashing avr multi with 9xtreme maintenance mode

Posted: Thu Sep 28, 2017 9:45 pm
by willhac
Hi guys,

I'm trying to get back in the hobby after a period of inactivity, so a good start is to update everything !
9xtreme now has the latest test version, the bootloader is updated.
It has an external avr multi module, and an internal one : I compiled hex files and uploaded them with ISP -> everything works.

The problem appears when I try to flash with maintenance mode (nice feature by the way !) :
-> optiboot flashed on both modules
-> external module (COM1 inverted) : I can flash it once, it works, but after that a second flashing attemp always fails, I must do something wrong with the bootloader
-> internal module (COM2) : flashing always seems to work, but the module doesn't operate, LED blinks fast like when optiboot has just been flashed

Any idea ?
Thanks in advance

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Thu Sep 28, 2017 10:17 pm
by MikeB
Make sure the compiled program for the AVR leaves space for the bootloader (512 bytes).
When you compile the Multi code, do you have "CHECK_FOR_BOOTLOADER" defined. Without this, the Multi firmware won't detect a flash attempt and drop out to the bootloader. You can check this if you try flashing a second time, but hold the bind button pressed until the flashing operation starts, this keeps the module in the bootloader.

I'm not sure about the internal module, I may need to connect one to my 9Xtreme to check.

Mike.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Thu Sep 28, 2017 10:34 pm
by willhac
I can't find "CHECK_FOR_BOOTLOADER", is it a line to comment/uncomment ? in _config.h ?

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Thu Sep 28, 2017 11:10 pm
by jhsa
Mike, perhaps the firmware has to be compiled with the option "Upload Method" set to "STM32duino bootloader"??

João

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 7:11 am
by willhac
willhac wrote: Thu Sep 28, 2017 10:34 pm I can't find "CHECK_FOR_BOOTLOADER", is it a line to comment/uncomment ? in _config.h ?
...and also I don't have any bind button connected. Do I need it for flashing in maintenance mode ? If yes when do I press it ?
My hex files are 29 Ko and 43Ko with just the protocols needed, so they should leave space for the optiboot. These files don't have a bootloader/optiboot inside, is it OK ? (compiled with latest arduino software, I can post them later to check if needed)

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 8:15 am
by jhsa
Please disregard my post above.. I have just realized you are using the AVR module, not the STM32 one.. Sorry about that :(

João

Sent from my BLN-L21 using Tapatalk



Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 8:55 am
by MikeB
Try getting the Multi source files from here: https://github.com/midelic/DIY-Multiprotocol-TX-Module, these have the "CHECK_FOR_BOOTLOADER" code included.
I posted these changes here: https://www.rcgroups.com/forums/showpos ... count=8563.

29K is fine for the AVR, is the 43K one for a STM module? If not, then it is too big for the AVR.

Mike.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 9:21 am
by willhac
OK
I was downloading the code from here :
https://github.com/pascallanger/DIY-Mul ... -TX-Module
where the "CHECK_FOR_BOOTLOADER" code is not included.
As far as I understand I don't need the bind button.
I'll try again this evening.

Strange for the 43Ko file (size of .hex file in windows, not .bin) : when I compile it says only 49% of the space is used, I removed a lot of unused protocols.

Thanks again for the links ;)

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 10:34 am
by MikeB
43K is OK for a .hex file, I had assumed this was the size reported by the Arduino IDE.

Mike.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 3:46 pm
by willhac
Now flashing works well with the external module on second and further attempts. :D

Still the same with the internal one, it seems it doesn't program, despite this message :

0000 0000
Flashing Complete
1E95 0F10 0000 0000 0000

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 6:49 pm
by MikeB
Please try setting the external module off and the internal module on with the Multi protocol. Also, set the Telem. Com port to 2.
Now cycle the power then look on the protocol menu. Do you see the firmware revision, e.g. (1.1.6.21) beside the Bind option?
The Led flashes fast if the selected protocol is not present in the module.

Mike.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 9:04 pm
by willhac
I can't see 1.1.6.21 beside the bind option...
If I flash the same file with the ISP the led stays solid (I can control a model) and I can see 1.1.6.21.

My external module is with board 2.3c, and the internal is with an arduino pro mini, does it make a difference ? Fuses are the same with D6 at H.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Fri Sep 29, 2017 10:13 pm
by MikeB
A Pro Mini shouldn't make any difference.
I'll look to run some tests, but I'll need to re-wire my 9Xtreme as I have a bluetooth module on COM2 at the moment. I have a spare multi module I can use.

Mike.

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Sat Sep 30, 2017 12:14 am
by jhsa
On mine I have the i2C lines set to COM3 for the bluetooth. That frees COM2 for the internal module..

João

Sent from my BLN-L21 using Tapatalk


Re: flashing avr multi with 9xtreme maintenance mode

Posted: Sat Sep 30, 2017 7:34 am
by willhac
My modules are updated and the radio is ready for flying, so don't look at it if it takes too much time.
I'm not sure I will flash the internal module so often !

Thank you both for your help

Edit : I found what happened : a second led and resistor was added to see the status led at the back of the radio, and the led on the pro-mini was not removed, it seems it perturbed D13 at startup and was entering optiboot almost each time. With the second led removed everything is OK !

Re: flashing avr multi with 9xtreme maintenance mode

Posted: Sat Sep 30, 2017 9:41 pm
by MikeB
Oh, good.
I have re-wired my 9Xtreme, put the bluetooth module on COM3, the module plugs in so I can still revert COM3 to the I2C function easily.
I've also added a 5-way connector for an internal module so I can plug a Multi module on to it. With that, I did just test flashing and using the internal module all works correctly anyway.

Mike.